Subject | Re: [IBO] Unique Key, Bookmark and refresh |
---|---|
Author | Artur Anjos |
Post date | 2002-03-13T13:33:21Z |
Gerhardus:
Couldn't you change the way of doing it and use a similar way to the way
GeneratorLinks work? Ie, change your Unique Key builder from inside the
trigger to a Stored Procedure, and call the SP before posting? That will do
the trick, and you will be able to use your Unique Key as it was a
Generator. In this way, you will be able to retrieve the single row with a
refresh, and you will not need to refresh the all dataset.
Note that this is a turnaround.
Artur
Couldn't you change the way of doing it and use a similar way to the way
GeneratorLinks work? Ie, change your Unique Key builder from inside the
trigger to a Stored Procedure, and call the SP before posting? That will do
the trick, and you will be able to use your Unique Key as it was a
Generator. In this way, you will be able to retrieve the single row with a
refresh, and you will not need to refresh the all dataset.
Note that this is a turnaround.
Artur
----- Original Message -----
From: "Gerhardus Geldenhuis" <flooder@...>
To: <IBObjects@yahoogroups.com>
Sent: Wednesday, March 13, 2002 12:55 PM
Subject: RE: [IBO] Unique Key, Bookmark and refresh
> Hi
> I was not specific enough. My primary key looks something like this
> RANDI3459 where rand can by GLEN or BOKS and the I can be either I,Q,S or
C.
> Generator links will definitely not work in this context.
>
> >
> > Hi,
> > try with TIBOQuery->GeneratorsLink, this property can solve your problem
> > without lines of code.
> >
> > Regards,
> > Enrico Raviglione.
> >
> >
> >
> >
> > Hi
> > I have a trigger that generates a unique primary key for my
> > table. I set the
> > required property of the field to not required so that ibo does not moan
> > when I want to post the record. My problem is that I want to display the
> > value of this key to the user immediatly after creation. Refresh
> > works fine
> > but it causes the cursor position to change. Bookmarking this record
also
> > does not work because when going to the bookmark after refreshing
> > I get the
> > following error: Record not found. I have also tried
> > InvalidateBookmark but
> > this also does not have the desired effect.
> >
> > Here is the piece of code, I have tried it in various orders to get it
> > working.
> > IBOQPOS_QISC.InvalidateBookmark(S);
> > S:=IBOQPOS_QISC.Bookmark;
> > IBOQPOS_QISC.Refresh;
> > IBOQPOS_QISC.Bookmark:=S;
> >
> > How do I get the new value of the primary key without loosing the cursor
> > position? Would it be better to have a storedprocedure create the table
> > entry and return the primarykey value and then doing a refresh
> > and locate?
> >
> > Im using TIBOQuery.
> >
> > Groete
> > Gerhardus
>
>