Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: why my dynamic sql statement failed?
"Sybrand Bakker" <postbus_at_sybrandb.demon.nl> wrote in message
news:l887v15iqimd8862uercvbp9g9c0tmmo50_at_4ax.com...
: On 15 Feb 2006 13:32:08 -0800, zlmei_at_hotmail.com wrote:
:
: >. Anyone know why?
:
: string literals can't continue across linefeeds. It should have been
: execute immediate 'UPDATE <blabla> '||
: 'set foo = bar '||
: 'where 1=1';
: Also there needs to be a space between immediate and the single quote.
:
: --
: Sybrand Bakker, Senior Oracle DBA
nope.
there's no restriction on literal newlines in a string literal, nor required
spacing between tokens:
SQL> begin
2 execute immediate'insert into dept(deptno,dname)
3 values(99,''sample'') 4 ';
PL/SQL procedure successfully completed.
OP's error seems to be a logic error -- it compiles, it ran, it gave results, but results were incorrect
++ mcs Received on Wed Feb 15 2006 - 16:14:13 CST