ORA-01036 on Execute - why am I getting this?

Here's the code (simplified from the real thing):

with TOracleQuery.Create(nil) do
try
Session := Data2.ARCSession;

SQL.Text := 'select CITSEQUENCE.nextval into :CIT_CIT_CITID from dual; ' +
'insert into CIT_CITATION (CIT_CIT_CITID) values (:CIT_CIT_CITID);';

DeclareVariable(':CIT_CIT_CITID', otInteger);

Execute;

...

------
I get ORA-01036: Illegal variable name/number on Execute. What am I doing wrong? I already know the sequence select works, as I tested it in the SQL-Programmer tool.

Thanks,
Steve

------------------

Steve Magruder
 
I forgot to mention tech details: Oracle8i Enterprise Edition Release 8.1.7.2.1, DOA 3.4.6.1, Delphi 5 SP2.

------------------

Steve Magruder

[This message has been edited by stevemagruder (edited 28 June 2002).]
 
I think I answered my own question today.

Just realized that I needed 'begin' and 'end;' around my SQL statements. Problem appears to be solved.
 
Back
Top