Hi,
I try to log the last sql query send to the database when an error appear. I looked at OnError event in TOraSession class but i don't know how to get the last sql query.
How to get the last sql query sent when error appear
Re: How to get the last sql query sent when error appear
Hello,
To retrieve the last SQL statement that has led to the error, you can use the Component property of the EDAError class, e.g. as follows:
To retrieve the last SQL statement that has led to the error, you can use the Component property of the EDAError class, e.g. as follows:
Code: Select all
procedure TForm1.OraSession1Error(Sender: TObject; E: EDAError;
var Fail: Boolean);
begin
if E.Component is TCustomDADataSet then
ShowMessage(TCustomDADataSet(E.Component).SQL.Text);
end;Re: How to get the last sql query sent when error appear
I had not seen 'Component' property. Thank's a lot.