Subject Re: [IBO] how to maintain data position on newly inserted row
Author Jason Wharton
I think you are best off using a surrogate key for the table and let a
generator drive it. use the GeneratorLinks property and you will not have
any problems from here out.

Jason Wharton
CPS - Mesa AZ
http://www.ibobjects.com


----- Original Message -----
From: "R. S. Patil" <rspatil@...>
To: <IBObjects@yahoogroups.com>
Sent: Tuesday, February 27, 2001 12:43 AM
Subject: [IBO] how to maintain data position on newly inserted row


> Hello Friends,
>
> I have a updatable query on a table.
>
> select
> <fields ....>
> From
> < table Name >
> for update;
>
>
> The primary key for that table is work_day + Tran_no (i.e.
> Tran no starts from 1 for each work_day).
>
> On the form.show i insert a record in the query. Then user
> updates the fields on the form. when done he presses OK
> button. On OK press i use query.post and tran_no is
> generated in before insert trigger of the table. The Tran_no
> is generated with help of Generator and records are being
> inserted properly without PK violation exceptions. Now i
> want to get the Tran_no generated in the afterPost event of
> the query and show it to user.
>
> I tried
>
> in AfterInsert event of query
> BkMrk := qry.Bookmark;
>
> in afterPost event of query
> qrySBTran.InvalidateBookmark(bkMrk);
> Tran_No := qry.FieldByName('TRAN_NO').AsInteger;
> Showmessage (... + intToStr(Tran_No));
>
> I am always getting Tran_no 1 even though tran_no advances
> to value like 2,3,4,5.
>
> Can somebody tell me how to maintain data position on newly
> inserted row and refresh the row buffers freshly inserted.
>
> Thanks
>
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>