Page 1 of 1

TOraQuery: Output parameters

Posted: Fri 06 Mar 2009 08:55
by Quake_MSC
Dear people,

i have 2 parameters in a sql statement, 1 to retrieve and 1 to send.


code:
WITH OraQueryIAAD
DO
BEGIN
SQL.Clear;
SQL.Add('select adr_name1, adr_name2, adr_str, adr_plz, adr_ort, ' +
'adr_staid ');
SQL.Add('from sadr_adresse where adr_adrid = :iadrid into :sadrname1');
OraQueryIAAD.ParamByName('iadrid').AsInteger:= iAdrid;
OraQueryIAAD.ParamByName('iadrid').AsString:= isadrname1;
Prepare;
Open;
....

execution will get an error:
ORA-01036: variable not found

How can i define the correct output variable and use it...

thx a lot

Posted: Wed 11 Mar 2009 08:38
by Plash
We could not reproduce the problem. Please send to odac*devart*com a complete small sample that demonstrates the problem, including the script for creating database objects.

Use FieldByName

Posted: Wed 01 Apr 2009 06:56
by Morris
WITH OraQueryIAAD DO
BEGIN
SQL.Clear;
SQL.Add('select adr_name1, adr_name2, adr_str, adr_plz, adr_ort, ' +
'adr_staid ');
// Removed into ....
SQL.Add('from sadr_adresse where adr_adrid = :iadrid');
// Pass parameters to query - Use ParamByName
ParamByName('iadrid').AsInteger:= iAdrid;
Prepare;
Open
// Get Results of query - Use FieldByName
vAdr_Name1 := FieldByName('adr_name1').AsString;
vAdr_Name2 := FieldByName('adr_name2').AsString;
... :lol: etc