Re: Stored procedure problem
Posted in 1999
Octav Chiriac <com@netinfo-moldova.com> wrote:
> I'm just not sure how accurate is this sysmaster
> query in a multiuser environment.
> Does it return MY last generated serial value ?
Not of course. It keeps just highest value and that's it.
You even can force to insert explicitly any value less
than highest (just for testing) and highest in sysmaster
will not change.
It was just answer to 'where' question. 'why' is separate
issue. Well, I don't know... ;)
Best regards
Vardan
>
> Best Regards,
> Octav
>
> Vardan.Aroustamian@chase.com wrote:
> >
> > Octav Chiriac <com@netinfo-moldova.com> wrote:
> >
> > >
> > >
> > > You can use the dbinfo('sqlca.sqlerrd1') function to retrieve
> > > the last generated serial value after an INSERT.
> > >
> > > Hope this help,
> > > Octav
> > >
> > > On Wed, Feb 10, 1999 at 03:07:19PM +0800, Organo, Norman wrote:
> > > > Hi Informix-list,
> > > >
> > > > How do you get the newest/highest value of a serial column inside a
> > stored
> > > > procedure?
> > > > I remember that a certain system catalog table is used to store
this.
> > Can
> > > > anyone tell me
> > > > what table that is?
> >
> > I prefer to use method mentioned above, but anyway there is a place:
> >
> > select tabname, serialv
> > from systables t, sysmaster:sysptnhdr p
> > where tabname = 'your_table' and
> > t.partnum = p.partnum;> >
> > > >
> > > > Norman
> > >
> > > --
> > > Octav Chiriac Phone: (373) 2 21 20 96
> > > NetInfo S.R.L. Fax: (373) 2 21 36 59
> > > Chisinau (373) 2 24 00 83
> > > Moldova, Republic of mailto:com@netinfo-moldova.com
> > >
> >
> > HTH also
> >
> > Vardan Aroustamian
> >
> > --
> > vaar@geocities.com
>
--
vaar@geocities.com