Marcus Gelleschun wrote:
> "Art S. Kagel" <kagel@bloomberg.net> wrote:
>
> > Not a problem. DBINFO is returning session specific information. The
> > engine places the serial number it inserted in the last record in your
> > session into a data structure that you are accessing with the DBINFO
> > function. If you do an insert and do not leave your session or perform
> > anyother SQL in between you could go on vacation for a year and assuming
> > the server stays up you will get the original serial value no matter how
> > many millions of rows were inserted while you were away.
>
> This seems to work even if the INSERT fires a trigger which calls a
> procedure, where more records are inserted into other tables with a
> serial column. After all this the DBINFO structure still has the new
> serial value of the originally inserted record.
>
> I think I'm even able to retrieve the other serial values, while I'm
> inside the triggererd procedure. There must be some kind of stack
> which holds the information of the different context. Or are there any
> limitations in this mechanism?
>
> Mit bestem Gruss, Marcus.
> --
> Marcus.Gelleschun, ProSieben Information Service GmbH
> Gutenbergstr. 3, D-85767 Unterfoehring, Tel: 089/9507-5149
I wouldnt really call it a stack. When you connect to a server it stores
information about your session in the shared memory it allocates. One of the
things it stores is the sqlca information. The memory holding this
information is not released for someone else to use until you disconnect. So
as long as you leave your session open you can get the proper sqlca
information.
Hope this helps,
Will