Page 1 of 1
Error Position in TOraScript
Posted: Tue 07 Jun 2005 18:16
by Rodrigo Cesar
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
Posted: Fri 10 Jun 2005 07:39
by Alex
You can use one of the following solutions :
Code: Select all
OraScript1.DataSet.GetErrorPos(...)
or
for more information pls. see "TOraScript.ErrorOffset" and "TOraDataSet.GetErrorPos" topic in ODAC help.
Posted: Fri 10 Jun 2005 20:15
by Rodrigo Cesar
The GetErrorPos(...) result a Access Violation error. In debug I can see the DataSet property is "nil", no exists.
The ErrorOffset result a number, but I dont now what I can do with this. The Delphi help dont explains how I work with this. In the demos have one example?
Thanks,
Rodrigo Cesar
Posted: Tue 14 Jun 2005 12:19
by Alex
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;
Posted: Thu 23 Jun 2005 21:02
by Rodrigo Cesar
I try it, but dont works... when I make de Execute on OraScript get a error "DataSet is not prepared".
I need make some else on the OraQuery?
Posted: Fri 24 Jun 2005 13:29
by Alex
You are right - there is a bug in TOraScript.ExecuteNext function in ODAC 3.90 or lower version. The fix will be included in the next ODAC 3 build.