FireDAC.Stan.Error.EFDDBEngineException.SQL
Delphi
property SQL: String read FSQL write FSQL;
C++
__property System::UnicodeString SQL = {read=FSQL, write=FSQL};
Contents
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
property | public | FireDAC.Stan.Error.pas FireDAC.Stan.Error.hpp |
FireDAC.Stan.Error | EFDDBEngineException |
Description
Returns a failed SQL command text.
Use the SQL property value to get an SQL command text, for which the DBMS returned an error.
You can use this property with the Params property for debugging purposes.
Example
try
Log('Removing records');
FDQuery1.ExecSQL('delete from tab');
....
Log('Inserting records');
FDQuery1.ExecSQL('insert into tab ...');
except
on E: EFDDBEngineException do begin
Log(E.Message);
Log('Failed SQL: ' + E.SQL);
Log('Failed params: ' + E.Params.Text);
raise;
end;
end;