Escape Qoute and insert into Table
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