Instruments:
ZEOSDBO-7.1.3a-stable
Lazarus v1.2.4-fpc-2.6.4-win32
Database: Personal Oracle Database 11g Release 11.2.0.3.0 - 64bit
Problem:
I have some PL/SQL script:
begin
<schema_name>.PKG_DOCUMENTS.SetValue('1');
end;
When I execute this code in TOAD(Tools for Oracle Application Development), all will be alright. But when I try execute PL/SQL code in (Lazarus) TZQuery, I have error:
with TZQuery.Create(nil) do
try
Connection := <SomeConnection>;
SQL.Text := 'begin
<schema_name>.PKG_DOCUMENTS.SetValue(''1'');
end;'
ExecSQL; //<- error here
finally
Free;
end;
When I try execute this code I have next error:
Runtime error occurred: 6550 (ORA-06550: line 1, column 6: PLS-00103: Encountered the symbol "" when expecting one of the following: begin case declare exit for goto if loop mod null pragma raise return select update while with <an identifier=""> <a double-quoted delimited-ident)</an>
Solution:
When I try add to PL/SQL code character #0 - code executed.
...
SQL.Text := 'begin <schema_name>.PKG_DOCUMENTS.SetValue(''1''); end;' + #0;
...
Note:
PL/SQL procedure looks like:
CREATE OR REPLACE PACKAGE PKG_DOCUMENTS AS
PROCEDURE SetValue(nZoneID NUMBER);
END Documents;
/
CREATE OR REPLACE PACKAGE BODY PKG_DOCUMENTS AS
PROCEDURE SetValue(nValueID NUMBER) IS
BEGIN
...;
END SetValue;
END PKG_DOCUMENTS;
/
Hi this is strange...
ok did look to the docs of OCI: http://docs.oracle.com/cd/B10501_01/appdev.920/a96584/oci16ms6.htm
as you can see we indicate the length. But we do NOT indicate the Length(stmt)+1(trailing #0)
attached is a patch made against R3280 \testing-7.2 from SVN.
On my side i can't see behavior changes if we add the #0 trailing terminator to the length indication.
I would apply the patch if it resolves your issue. So please test the patch and give me a reply.
Cheers, Michael
Hi Michael.
I tested new changes, it's work fine. Stored procedure executed without errors.
Cheers, A. Androschuk
Did commit the Patch: R3282 \testing-7.1 (SVN)
Patch will be merged to trunk an 7.1 soon.
I'll close this tiket now.
Cheers, Michael