ORA-01756 Error while inserting a file in CLOB field


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting ORA-01756 Error while inserting a file in CLOB field
# 1  
Old 07-12-2010
ORA-01756 Error while inserting a file in CLOB field

Hi,

Please guide me where i am doing wrong, i am getting
ORA-01756:quoted string not properly terminated when i am trying to insert file into CLOB cloumn of Oracle DB.

Please find below the code where log file variable is myLogFile. Please let me know where i am doing wrong.



Code:
br_Update_Proxy_Job_Run_Status()
{
 typeset -i myArgCount=$#[/B]
 if [ $myArgCount -lt 2 ]
 then
  br_PrintMessage W \
  "NOT Enough arguments [$myArgCount] for ** br_Update_Proxy_Job_Run_Status ** function"
  return $BR_WARNING_STATUS
 fi
 
 typeset    myJobRunStatusMsg="$1"
 typeset -i myRunStatusId="$2"
 typeset    myFeedID="$4"
 myLogFile="${10}"
 myProxyJobStatus="${11}"
 
 typeset    myClobFile=""[/B]
 if [ -z "$3" ]
 then  
  myWarningCount=null
 else
  myWarningCount="$3"
 fi
 
 if [ -z "$4" ]
 then  
  myFeedID=""
 else
  myFeedID="$4"
 fi
 
 if [ -z "$5" ]
 then  
  myRptTotalInsertedETL=null
 else
  myRptTotalInsertedETL="$5"
 fi
 
 if [ -z "$6" ]
 then  
  myRptTotalUpdatedETL=null
 else
  myRptTotalUpdatedETL="$6"
 fi
 
 if [ -z "$7" ]
 then  
  myRptTotalErrorETL=null
 else
  myRptTotalErrorETL="$7"
 fi
 
 if [ -z "$8" ]
 then  
  myRptRecordCount=null
 else
  myRptRecordCount="$8"
 fi
 
 
 if [ -z "$9" ]
 then  
  myTotalRejects=null
 else
  myTotalRejects="$9"
 fi
 
 if [ -z "$myLogFile" ]
 then
  myClobFile=""
 else
  myClobFile=`cat $myLogFile | sed "s/\'/''/g"`
 fi
 
 sqlplus -s $brDBCredentials  <<-EndOFSQL
 SET DEFINE OFF;
 SET SERVEROUT ON
 DECLARE
  i_run_status_id      NUMBER := $myRunStatusId;
  i_total_records     NUMBER := $myRptRecordCount;
  i_total_errors       NUMBER := $myRptTotalErrorETL;
  i_total_warnings     NUMBER := $myWarningCount;
  i_total_inserted     NUMBER := $myRptTotalInsertedETL;
  i_total_updated      NUMBER := $myRptTotalUpdatedETL;
  i_total_rejected     NUMBER := $myTotalRejects ;
  i_job_run_message    VARCHAR2(512) := '$myJobRunStatusMsg';
  i_feed_id            VARCHAR2(20) := '$myFeedID';
  i_status             VARCHAR2(20) := '$myProxyJobStatus';
  i_modlast_by         VARCHAR2(1000);
  o_sqlcode        NUMBER := 0 ;
  o_sqlmsg         VARCHAR2(1000);
 BEGIN
  $USP_UPD_JOB_RUN_STATUS
  (
   i_run_status_id,
   i_total_records,
   i_total_warnings,
   i_total_inserted,
   i_total_updated,
   i_total_errors,
   i_total_rejected,
   '$myClobFile',
   i_job_run_message,
   i_feed_id,
   i_status,
   i_modlast_by,
   o_sqlcode,
   o_sqlmsg
  );
 END; 
 /
 EndOFSQL
}

Please tell me the correct sample script.

Thanks
Raj

Last edited by Scott; 07-12-2010 at 06:59 AM.. Reason: Code tags, please...
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Inserting a field without disturbing field separator on other fields

Hi All, I have the input as below: cat input 032016002 2.891 97.109 16.605 27.172 24.017 32.207 0.233 0.021 39.810 0.077 0.026 19.644 13.882 0.131 11.646 0.102 11.449 76.265 23.735 16.991 83.009 8.840 91.160 0.020 99.980 52.102 47.898 44.004 55.996 39.963 18.625 0.121 1.126 40.189... (15 Replies)
Discussion started by: am24
15 Replies

2. Shell Programming and Scripting

Error inserting a clob file into DB table

Hi all, I am reading control file log from my server and putting it to a variable for j in $(cat $dirname/ctl_file.log) do if then Y=${#fileclob_ctl_file} if then fileclob_ctl_file=$j else fileclob_ctl_file="${fileclob_ctl_file},${j}" fi fi ... (5 Replies)
Discussion started by: Pratiksha Mehra
5 Replies

3. UNIX for Dummies Questions & Answers

Inserting a sequential number into a field on a flat file

I have a csv flatfile with a few million rows. I need to replace a field (field number is 85) in the file with a sequential number. As an example, let's assume there are only 4 fields in the file: A,A,,32 A,A,,27 A,B,,43 C,C,,354 If I wanted to amend the 3rd field in this way my... (2 Replies)
Discussion started by: BristolSmithy
2 Replies

4. Shell Programming and Scripting

Inserting string in between field in comma separated file

Hello Mates, I have one txt file having commo seperated values. I have to insert string "FALSE" in 2nd field from the end. E.G SE18 6RN,,,,5439070,1786840,,1000002148671600,123434 Out put should be: SE18 6RN,,,,5439070,1786840,FALSE,1000002148671600,123434 Can some one help me to... (8 Replies)
Discussion started by: krsnadasa
8 Replies

5. Shell Programming and Scripting

Inserting a new field inbetween two exisitng field

I have a '|' delimited file. My file looks like below 23|nationalhoilday|feb12||||||||||||||california|northdistrict|| In the same way, each record has 164 fields. I have to insert one more field after the 85th field. Expected output... (3 Replies)
Discussion started by: machomaddy
3 Replies

6. UNIX for Dummies Questions & Answers

Best method for inserting a field from a file into another file?

Hello, Hoping someone can help! I have a file (fileA) with a potentially different number of | delimited fields the file looks like: fileA A|B|C|D|E|F|G| A|B|C|D|E|F|G| This file could have 100+ fields and have 2million+ records I have another file (fileB) which contains an 8 digit... (3 Replies)
Discussion started by: dendright
3 Replies

7. UNIX for Advanced & Expert Users

grep all ORA errors except one ORA error

Hi - I am trying to grep all "ORA" errors in a log files.I have to grep all ORA errors except one error for example ORA-01653.How can exclude that error in "grep" command? In following "grep" command I want to exclude "ORA-01653" error grep -i ORA alert.log >>/tmp/ora_errors.txt ... (7 Replies)
Discussion started by: Mansoor8810
7 Replies

8. Solaris

maxuprc and maxusers - ORA-27300, ORA-27301, ORA-27302

Hi all, Am intermittently getting the following errors on one of my databases. Errors in file /oracle/HRD/saptrace/background/hrd_psp0_13943.trc: ORA-27300: OS system dependent operation:fork failed with status: 12 ORA-27301: OS failure message: Not enough space ORA-27302:... (1 Reply)
Discussion started by: newbie_01
1 Replies

9. Shell Programming and Scripting

gawk help for inserting a field of a .txt file in the same file

i had the following type of data file vchrdump: Vouchers For Date :05/01/2009 * ... (4 Replies)
Discussion started by: KANNI786
4 Replies

10. HP-UX

KSH to find a ORA error in a log file

Hi: i have writen a script that needs a finishing Pourpouse is to find a particular error in a file after we enter file name and the return msg would describe if >there is a error -> "Contact DBA" if there is no oracle error ->"No ora error found." for the same i have written a script... (6 Replies)
Discussion started by: techbravo
6 Replies
Login or Register to Ask a Question