Error inserting a clob file into DB table


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Error inserting a clob file into DB table
# 1  
Old 05-28-2014
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
Code:
for j in $(cat $dirname/ctl_file.log)
 do
 
   if [ -n $j ]
   then
  Y=${#fileclob_ctl_file}
  if [ $Y = 0 ]
  then
    fileclob_ctl_file=$j
 
  else
    fileclob_ctl_file="${fileclob_ctl_file},${j}"
 
  fi
   fi
 done

when i run below code
Code:
`sqlplus  ${sysuser}/${syspwd} << dataload_ctl_file
     set pagesize 0 feedback off verify on heading off echo off serveroutput on
        whenever sqlerror exit sql.sqlcode;
        whenever oserror exit failure;
      set longchunksize 200000 long 200000 pages 0 
                        execute sp_update_log('$fileclob_ctl_file', $create_seq);      
 
        COMMIT;
       exit;

it doesnt update the clob variable in table :the error it gives is:
SP2-0027: Input is too long (> 2499 characters) - line ignored
# 2  
Old 05-28-2014
The statement has a length limit
U need to look for alternate ways to insert clob data

---------- Post updated at 05:26 AM ---------- Previous update was at 05:21 AM ----------

Put that in a file and load it using sqlldr
# 3  
Old 05-28-2014
The thing is I want to udate a row with clob value ,
Sqlldr will only insert a row
# 4  
Old 05-28-2014
Try breaking the string into lines which are less than 2500 characters long.
# 5  
Old 05-28-2014
But I want to update the row with full string
# 6  
Old 05-28-2014
You cannot use sqlplus for that. You should write some code to do it (PL/SQL, Java etc). Check dbms_lob.LoadFromFile.
Otherwise you may try to concatenate the string parts using a variable and PL/SQL.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to write CLOB parameter in a file or XML using shell script?

I executed a oracle stored procedure using shell script. How can i get the OUT parameter of the procedure(CLOB) and write it in a file or XML in UNIX environment using shell script? (2 Replies)
Discussion started by: vel4ever
2 Replies

2. Red Hat

insmod Error inserting `/lib/raid456.ko` -1 File Exist

hi every one , Wondering if any of you experienced this During "Centos5.6" Boot .. ! 1)NOT USING MMCONFIG 2)insmod Error inserting `/lib/raid456.ko` -1 File Exist Dell PowerEdge T110 with 4sata Controllers with Centos2.6.18-238.9.1.el5xen installed . /boot on /dev/md0 / on ... (18 Replies)
Discussion started by: Saed
18 Replies

3. Programming

Could't pass clob from my shell script

Hello Everyone, I am trying to write a shell script that will read from a file and will call a pl/sql procedure that takes clob as input. Now as varchar2 has a limit much less than clob so i can't just pass the input as in one variable.(size may be >32K). This is what i tried. Not posting the... (0 Replies)
Discussion started by: mayukh.banerjee
0 Replies

4. Shell Programming and Scripting

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. ... (0 Replies)
Discussion started by: rajeshorpu
0 Replies

5. Shell Programming and Scripting

Creating CLOB object in unix

Hi All, I have a big file (basically .log file) want to store in oracle database. Please help me in preparing CLOB object in unix. The log file is stored in some location on unix file server, prepare clob of that file and store in DB. Any sample code or link Thanks Rajesh (1 Reply)
Discussion started by: rajeshorpu
1 Replies

6. UNIX for Dummies Questions & Answers

Does Unix make clob or blob objects

Hi I have a log file stored in unix file server i need to prepare the clob object of that and store in Oracle Database. Please suggest me or give me some examples Thanks Raj (0 Replies)
Discussion started by: rajeshorpu
0 Replies

7. Shell Programming and Scripting

inserting data into a table from a flat file

Hi, I want to insert data into a table from a flat file, the file is having around 25 columns and some 10,000 records. The columns values are seperated by a space. Thanks (1 Reply)
Discussion started by: ss_ss
1 Replies

8. Shell Programming and Scripting

Help Inserting data in mysql table

Cant understand the error #!/bin/bash temp="" A="" D=$(date +"%Y-%m-%d") H=$(date +"%R") temp=$(wget -q -O - website | grep -o "Temperature:]**" | grep \-E -o "+") mysql -D "weather_wise" -e "INSERT INTO weather (Date, Hour, Degrees) VALUES ($D,$H, $temp)"; my data types for... (11 Replies)
Discussion started by: vadharah
11 Replies

9. Shell Programming and Scripting

Inserting records from flat file to db table

I have 20000 numbers present in a file in each line like 25663, 65465, 74579, 56446, .. .. I have created a table in db with single number column in it. create table testhari (no number(9)); I want to insert all these numbers into that table. how can i do it? can anybody please... (4 Replies)
Discussion started by: Hara
4 Replies

10. Shell Programming and Scripting

Inserting Values From A File Into A Table

Guys, I want to insert some values from a log file into a temporary table. the values in the log file looks like this SV_NAME CC_NAME CP_DISP_RUN_STATE ------- ------------------- ----------------- sble01 ALLTEL WorkMon24Hrs Running I want to enter the... (2 Replies)
Discussion started by: ragha81
2 Replies
Login or Register to Ask a Question