ORA-6550 with multi-line string

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
heidenbluth
Posts: 56
Joined: Mon 08 Nov 2004 19:01
Location: Germany

ORA-6550 with multi-line string

Post by heidenbluth » Thu 09 Feb 2006 15:59

Hello,

you can run a PL/SQL block like

declare
vstmt varchar2(2000) :=
'BEGIN
dbms_output.put_line( :1 );
dbms_output.put_line( :2 );
END;';
v1 number := 234;
v2 varchar2(100) := 'Hallo';
begin
execute immediate vstmt using in v1, in v2; end;


from SQL*Plus. The vstsmt string comprises multiple rows.
If I execute this block from a TOraQuery I get ORA_6550 and PLS-103 errors.

Maybe SQL*Plus separates lines UNIX-like by LF only and ODAC separates them WINDOWS-like by CR+LF? Can this be changed?

Regards,
Holger

Challenger
Devart Team
Posts: 925
Joined: Thu 17 Nov 2005 10:53

Post by Challenger » Fri 10 Feb 2006 15:07

It happens because ODAC doesn't remove CR symbols within a pair of quotes. To avoid this problem you should fit vstmt string in one line or remove CR symbols from SQL statement before executing it.

Post Reply