Hi,
I would like to know if I can get the position error in TOraScript, like the GetErrorPos on the TOraQuery.
I'm using Odac 3.80.0.49 for Delphi 5.
Thanks,
Rodrigo Cesar
Error Position in TOraScript
You can use one of the following solutions : or for more information pls. see "TOraScript.ErrorOffset" and "TOraDataSet.GetErrorPos" topic in ODAC help.
Code: Select all
OraScript1.DataSet.GetErrorPos(...)
Code: Select all
OraScript1.ErrorOffset
To use TOraScript.DataSet property you need to set it up before with instance of any TOraDataSet descendant. e.g.
Code: Select all
//OraQuery1 : TOraQuery; - placed on the form at design-time
procedure TForm1.FormCreate(Sender: TObject);
begin
OraScript1.DataSet := OraQuery1;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
OraScript1.Execute;
end;
procedure TForm1.OraScript1Error(Sender: TObject; E: Exception;
SQL: String; var Action: TErrorAction);
var
Row,Col : integer;
begin
OraScript1.DataSet.GetErrorPos(Row,Col);
. . .
end;