Click here to Skip to main content
15,881,852 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have code mentioed beloow causing error name ORA-12899 anyone can help

$includePath = "$(Split-Path -Path $MyInvocation.MyCommand.Path -Parent | Split-Path -Parent)\include"
. $includePath\utils.ps1;
$AmisysConnectionStringName;

Run-Job -JobName 'ucmu073' {

$filePath = "C:\jobs\AA\DEV6\UCM\ICD10.csv"
$importFile = Import-CSV $filePath
foreach($item in $importFile)
{
$proc1 = $item.DIAG_NBR
$proc2 = $item.DIAG_NBR
# $ymdeff = $item.YMDEFF
#$ymdend = $item.YMDEND
#$ymdtrans = $item.YMDTRANS

Write-Verbose "$proc1, $proc2"

$currentDate = Get-Date -Format yyyyMMdd


# *******************************************************************************
# * Insert codes and fees into the su_edit_detail.
# *******************************************************************************

'{0,-60}{1,20}' -f "Insert TEEN PREGNANCY ICD10 CODES into the su_edit_detail ",(Get-Date -Format yyyyMMdd:hhmmss);

$myQuery = @"
SET PAGES 600;
SET LINES 4000;
SET ECHO ON;
SET serveroutput on;

WHENEVER sqlerror exit sql.sqlcode;

insert into SU_EDIT_DETAIL(EDIT_FUNCTION, TABLE_FUNCTION, CODE_FUNCTION, CODE_TYPE,CODE_BEGIN, CODE_END, EXCLUDE, INCLUDE_X, OP_NBR, TRANSCODE, VOID, YMDEFF, YMDEND, YMDTRANS)
select 'UCM-REPT-TEEN-PREG-DIAG','UCM-REPT','I0','DIAG','$proc1','$proc2',' ',' ','MIS', 'C',' ',20141001, 99991231, 20131120
from dual where not exists(select * from SU_EDIT_DETAIL where (CODE_BEGIN='$proc1' and CODE_END='$proc2'));
commit;
"@
$null = Invoke-SqlPlus -MessageOnFail 'Insert into su_edit_detail failed' -Query $myQuery;
Posted

1 solution

My answers is :

SQL
insert into SU_EDIT_DETAIL(EDIT_FUNCTION, TABLE_FUNCTION, CODE_FUNCTION, CODE_TYPE,CODE_BEGIN, CODE_END, EXCLUDE, INCLUDE_X, OP_NBR, TRANSCODE, VOID, YMDEFF, YMDEND, YMDTRANS)
 select '$edit_func','$table_func','$code_func','DIAG','$proc1','$proc2',' ',' ','MIS', 'C',' ',20141001, 99991231, 20131120
from dual where not exists(select * from SU_EDIT_DETAIL where (EDIT_FUNCTION = '$edit_func' and TABLE_FUNCTION = '$table_func' and CODE_BEGIN='$proc1' and CODE_END='$proc2'));
commit;
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900