Subject | Re: [firebird-support] Doubt with trigger before insert |
---|---|
Author | Andrei Luís |
Post date | 2013-01-23T18:16:09Z |
Hummm, ok. I was getting this conclusion. It is clear to me that the data
isn't still inserted yet.
Thanks André.
[]s
Andrei
2013/1/23 André Knappstein <Knappstein@...>
isn't still inserted yet.
Thanks André.
[]s
Andrei
2013/1/23 André Knappstein <Knappstein@...>
> > ...[Non-text portions of this message have been removed]
> > where nfi.registro_id=new.registro_id
>
> assuming that "new.registro_id" is indeed a new ID (not already
> existing in the NFI table), I would expect to get an empty resultset
> like you actually do.
>
> The Trigger is "BEFORE" insert and is operating on the table
> "Notasfiscaisitens" (NFI) which means that the "new.registro_ID"
> is not yet inserted into that relation.
> Therefore, no record matches the WHERE condition in your case and you
> get NULLs.
>
> best regards,
> André
>
>
>
>
>
> ------------------------------------
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Visit http://www.firebirdsql.org and click the Resources item
> on the main (top) menu. Try Knowledgebase and FAQ links !
>
> Also search the knowledgebases at http://www.ibphoenix.com
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> Yahoo! Groups Links
>
>
>
>