Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Escape Qoute and insert into Table

user10348635Apr 18 2013 — edited Apr 18 2013
Hi ALL,

I have a big file in UNIX.

sample records :
topic_id|1624|AIDS-HIV||
topic_id|1625|Allergies||
topic_id|1626|Alzheimer s||
topic_id|1627|Knee Pain||
topic_id|1628|Autism||
topic_id|1629|Atrial Fibrillation||
topic_id|1630|Acne Care||
topic_id|1632|Urinary Tract Infection||
topic_id|1633|Children's Vaccines||

i have a loop which stores the records in a unix variable WHOLE_REC_TXT and loads in a table column one by one

sample query

insert into WMD_BAD_DATA(Proc_Id, File_Id, File_Dt, Bad_Rec_Seq_Nbr, Whole_Rec_Txt)
values(${PROC_ID}, ${FILE_ID}, to_date(${DATADATE},'yyyymmdd'), ${BAD_REC_SEQ_NBR}, ''${WHOLE_REC_TXT}'');

error ia m getting is :
ERROR:
ORA-01756: quoted string not properly terminated

The last record in the sample records contains single qoute which seems to be creating problem.
i tried SET SCAN OFF, SET DEFINE OFF but didnt work. Please all provide your inout/suggestions on the above.

Thanks,
Arun
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 16 2013
Added on Apr 18 2013
7 comments
240 views