Subject | AW: [firebird-support] Re: About trigger |
---|---|
Author | Nikolaus Kern |
Post date | 2012-02-02T16:06:28Z |
Hi,
The context variable needs to be done inside Firebird.
Eg. For the batch processing you will create a SP that will do the job.
Inside the SP you can set the context variable.
Niko
Von: firebird-support@yahoogroups.com
[mailto:firebird-support@yahoogroups.com] Im Auftrag von nathanelrick
Gesendet: Donnerstag, 02. Februar 2012 16:33
An: firebird-support@yahoogroups.com
Betreff: [firebird-support] Re: About trigger
this could be a good idea, but it's will be too much dependent of the
application (what if developer forget to set this context variable?)
--- In firebird-support@yahoogroups.com
<mailto:firebird-support%40yahoogroups.com> , "Nikolaus Kern"
<parzival1969@...> wrote:
Tyrakowski
The context variable needs to be done inside Firebird.
Eg. For the batch processing you will create a SP that will do the job.
Inside the SP you can set the context variable.
Niko
Von: firebird-support@yahoogroups.com
[mailto:firebird-support@yahoogroups.com] Im Auftrag von nathanelrick
Gesendet: Donnerstag, 02. Februar 2012 16:33
An: firebird-support@yahoogroups.com
Betreff: [firebird-support] Re: About trigger
this could be a good idea, but it's will be too much dependent of the
application (what if developer forget to set this context variable?)
--- In firebird-support@yahoogroups.com
<mailto:firebird-support%40yahoogroups.com> , "Nikolaus Kern"
<parzival1969@...> wrote:
>not
> Hi,
>
>
>
> Did you consider to use Context Variables inside the transaction or stored
> procedure ?
>
>
>
> You can set a context variable RDB$SET_CONTEXT ('USER_TRANSACTION',
> 'UPDATEPARENTDATE', 'NEIN');
>
>
>
> And check for it in the trigger. If it exists, do one thing, if it does
> the other.<mailto:firebird-support%40yahoogroups.com>
>
>
>
> IF (RDB$GET_CONTEXT ('USER_TRANSACTION', 'UPDATEPARENTDATE') IS NULL) THEN
>
>
>
> Niko
>
>
>
> Von: firebird-support@yahoogroups.com
> [mailto:firebird-support@yahoogroups.com<mailto:firebird-support%40yahoogroups.com> ] Im Auftrag von Tomasz
Tyrakowski
> Gesendet: Donnerstag, 02. Februar 2012 15:40<mailto:firebird-support%40yahoogroups.com>
> An: firebird-support@yahoogroups.com
> Betreff: Re: [firebird-support] About triggerat
>
>
>
>
>
> Hi,
>
> I've pondered on the problem for some time. All I was able to come up
> with was to add an extra insert at the end of the batch, with a
> "special" value in one of the fields, which would be recognized by the
> trigger and would cause it to execute its code (otherwise the trigger
> just exists immediately after being fired).
> That's not a very elegant solution, though, but better than nothing.
>
> cheers
> Tomasz
>
> On 2012-02-02 14:05, nathanelrick wrote:
> > Hello,
> >
> > when i execute several insert (or update or delete), is it possible to
> create a trigger that will be raise not on each insert/update/delete but
> the end of these "bulk" inserts ? i can off course call the storedprocedure
> from the program but for good database integrity i prefer that thedatabase
> do it itself ... i thing that their is no possibilities to do so but incase
> ....[Non-text portions of this message have been removed]
> >
> >
>
> --
> __--==============================--__
> __--== Tomasz Tyrakowski ==--__
> __--== SOL-SYSTEM ==--__
> __--== http://www.sol-system.pl ==--__
> __--==============================--__
>
>
>
>
>
> [Non-text portions of this message have been removed]
>