Subject | debugging queries |
---|---|
Author | duilio_fos |
Post date | 2002-09-22T14:03:09Z |
I use IBO 3 and FB 1.
I have a (rather complex) query that works ok when executed directly
against a database.
However, when I use parameters, the result is different from what
expected.
Is there a way to see the query formed by IBO (and sent to the
database) after parameters are set ?
I hope I am not saying something stupid here. I mean something like
this:
if I write
var
q:TIB_Query;
begin
q:=TIB_Query.Create(nil);
with q do
try
DatabaseName:='db';
Sql.Add('select * from ATable where AField=:field_value');
Prepare;
ParamByName('field_value').AsString:='blah'; {1}
Open;
...
finally
Free;
end;
end;
I suppose than in {1} IBO will change the SQL text into
select * from ATable where AField='blah'
My question is: is it possible to have a look of the finished SQL
text in order to debug the code ?
TIA
Duilio Foschi
I have a (rather complex) query that works ok when executed directly
against a database.
However, when I use parameters, the result is different from what
expected.
Is there a way to see the query formed by IBO (and sent to the
database) after parameters are set ?
I hope I am not saying something stupid here. I mean something like
this:
if I write
var
q:TIB_Query;
begin
q:=TIB_Query.Create(nil);
with q do
try
DatabaseName:='db';
Sql.Add('select * from ATable where AField=:field_value');
Prepare;
ParamByName('field_value').AsString:='blah'; {1}
Open;
...
finally
Free;
end;
end;
I suppose than in {1} IBO will change the SQL text into
select * from ATable where AField='blah'
My question is: is it possible to have a look of the finished SQL
text in order to debug the code ?
TIA
Duilio Foschi