If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > Inserting a large .log file in CLOB field of Oracle DB, giving exception ORA-01756

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-12-10, 04:00
orpurajesh orpurajesh is offline
Registered User
 
Join Date: Jul 2010
Posts: 5
Inserting a large .log file in CLOB field of Oracle DB, giving exception ORA-01756

Hi,

I want to insert long .log file into CLOB field of Oracle DB. The Log file will increase its size dynamically.

When i am trying to insert the file in CLOB i am getting ERROR:
ORA-01756: quoted string not properly terminated.

Please find below the code.
myLogCount=$(cat $LogFile | wc -c)
echo "myLogCount in Actual Program::::: $myLogCount"
if [ $myLogCount -gt 32767 ]
then
awk '{n=n+length+1}
n <= 32500
n > 32500 {n-=length;print substr($0,1,(32500-n));exit}
' $LogFile > $myTmpLog

echo "Log file too large to view, Please visit server to view complete log" >> $myTmpLog
myTmpLogCount=$(cat $myTmpLog | wc -c)
br_Update_Proxy_Job_Run_Status "$Comment" \
"$RunStatusId" \
"$WarningCount" \
"" \
"" \
"" \
"" \
"" \
"$RptTotalRejectedDF" \
"$myTmpLog" \
"$ProxyJobStatus"
else
br_Update_Proxy_Job_Run_Status "$Comment" \
"$RunStatusId" \
"$WarningCount" \
"" \
"" \
"" \
"" \
"" \
"$RptTotalRejectedDF" \
"$LogFile" \
"$ProxyJobStatus"
fi

Please help me with sample code or tell me where i am doing wrong.

Thanks-
Raj
Reply With Quote
  #2 (permalink)  
Old 07-12-10, 07:55
kitaman kitaman is offline
Papabi's friend
 
Join Date: Sep 2009
Location: Ontario
Posts: 629
Since half the variables in the script are not defined within the script, I would suggest first finding out what the actual value of those variables is.
If one of them contains an embedded meta character then the script may fail.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On