Subject | Re: [IBO] TIB_Script |
---|---|
Author | Andrei Luís |
Post date | 2009-07-31T21:16:59Z |
Hi Jason, thanks for your time.
I'm going through a similar way. I created a table on db to do the log.
On OnStatement, I insert a row, and inform pk, date, time, sqlstatement and
result (this last one I set as 'OK'), also, I store pk in IB_Script.tag. If
OnError is triggered, I do an update and set the collumns: errorresult with
ErrorMessage, and change the result to 'ERROR' for the PK that is stored in
IB_Script.tag.
What do you (and others) think about this? Should it work properly? The
tests I did here was everything ok.
[]
Andrei
2009/7/31 Jason Wharton <supportlist@...>
I'm going through a similar way. I created a table on db to do the log.
On OnStatement, I insert a row, and inform pk, date, time, sqlstatement and
result (this last one I set as 'OK'), also, I store pk in IB_Script.tag. If
OnError is triggered, I do an update and set the collumns: errorresult with
ErrorMessage, and change the result to 'ERROR' for the PK that is stored in
IB_Script.tag.
What do you (and others) think about this? Should it work properly? The
tests I did here was everything ok.
[]
Andrei
2009/7/31 Jason Wharton <supportlist@...>
> One way I suppose would be to only feed your log the previous CurrentSQL[Non-text portions of this message have been removed]
> when OnStatement is called and then to take the last statement from
> OnStatement in the AfterExecute event.
>
> Jason Wharton
>
>
> ----- Original Message -----
> From: "Andrei Luís" <compuvale.software@...>
> To: <ibobjects@yahoogroups.com>
> Sent: Friday, July 31, 2009 12:52 PM
> Subject: [IBO] TIB_Script
>
>
> > Hello,
> >
> > I'm trying to use TIB_Script, to run sql statements when my application
> > starts.
> >
> > The idea is to check the exist of a txt file (that contains one or more
> > sql
> > statements), load it in tib_script.sql and run it. OK, that is running
> > well.
> >
> > Now, I want to implement a log for these sql statements executions. As I
> > can
> > see, AfterExecute is called after the whole script is executed.
> > OnStatement
> > is called before the execution, here I can acess CurrentSQL, and see what
> > statement will be executed, but I don't know if it's well executed.
> > OnError
> > is triggered when the statement execution returns an error, but how can I
> > know that the statement has no errors?
> >
> > []s
> > Andrei
> >
> > Win XP Pro + Delphi 2006 Pro + FB 2.1.2 + IBO 4.8.7
>