Page 1 of 1

TOraScript and "SQLType"

Posted: Thu 10 Mar 2005 09:15
by upscene
Hi there,

Would it be possible to somehow know the sqltype of the current statement in the TOraScript component?

I figured I could use the .Dataset.SQLType property, but the Dataset is never assigned.

Any other way?

I would like to create a visual indicator of a transaction commit/rollback in the script, so I need to know the statement type...

Thank you.
--
Martijn Tonies
Upscene Productions

Posted: Thu 10 Mar 2005 16:19
by Alex
You can assign TOraScript.DataSet property manually to some DataSet object, and all script's SQL will execute in this object, also you can move through scripts execution by calling TOraScript.ExecuteNext method. e.g.

Code: Select all

 procedure TForm1.FormCreate(Sender: TObject);
 begin
  OraScript1.DataSet := SmartQuery1;
 end;
 
 procedure TForm1.Button1Click(Sender: TObject);
 begin
  OraScript1.ExecuteNext;
 end;

Posted: Thu 10 Mar 2005 21:54
by upscene
Hello Alex,

Ah, I couldn't find neither the DataSet or the ExecuteNext stuff in the Help.

So, I can use a TOra command to execute script statements. That's good. Will the TOraScript events (like OnError and OnStatement) still fire?

Additionally, will the Ora-DataSet events BeforeExecute and AfterExecute fire?

(no, I didn't try yet, it's way too late to fire up Delphi now :wink: )

Thanks for the help.

--
Martijn Tonies
Upscene Productions

Posted: Fri 11 Mar 2005 09:20
by Alex
All events in TOraScript and DataSet objects will be triggered as usual.

Posted: Fri 11 Mar 2005 15:15
by upscene
Alex,

Thanks. I'll take a look at that then.

--
Martijn Tonies
Upscene Productions