You Asked
Hi Tom,
I am generating a lot of Insert statements from a source database, which will be executed in Destination database. I am using PL/SQL code to print Insert statements using DBMS_OUTPUT.PUT_LINE from few tables. So because of Max limit, after 250 characters I have to print the rest of the statement in new line. When the statement is printed like below:
INSERT INTO INSTRUMENT VALUES ('095000294E',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'','',NULL,'','','','',NULL,NULL,NULL,'TMP','','','095000294F','','','','','','','','095000022U','','ADV','','','','','CB1','N',NULL,'','',NULL,NU
LL,NULL,'',NULL,NULL,'','',NULL,'O',NULL,'','','','','','','','','','');
it gives this error:
LL,NULL,'',NULL,NULL,'','',NULL,'O',NULL,'','','','','','','','','','')
*
ERROR at line 2:
ORA-00917: missing comma
I tried continuation character(-), like below, but it does not work here.
'095000022U','','ADV','','','','','CB1','N',NULL,'','',NULL,NU-
LL,NULL,'',NULL,NULL,'','',NULL,'O',NULL,'','','','','','','','','','');
Can you please tell me, How can I continue a line here?
Appreciate your help.
and Tom said...
suggestion:
well, my first suggestion is "do not do this", but if you must - just build the inserts like this:
insert into t values (
'column1',
'column2',
'column3',
null,
null,
'whatever'
);
that way - you will be limited to dumping columns of length 250 or less and won't have to worry about any word wrapping issues - just use a separate dbms_output.put_line for each column...
Rating
(3 ratings)
Is this answer out of date? If it is, please let us know via a Comment