Support for getting ID of newly added record?
Ruslan Zasukhin
sunshine at public.kherson.ua
Sun Jul 6 13:30:58 CDT 2003
on 7/6/03 10:18, Francois Van Lerberghe at fvanlerberghe at freegates.be wrote:
>> Ruslan,
>>
>> At some point a while ago you'd mentioned that you'd be adding support for
>> getting the new RecID of a newly added record to a table.
>
> Don't you could simply add the RecID field in your cursor ?
> Once the new record is created, you ask the value of this field.
We talk about other problem.
Assume you do SQL's INSERT.
INSERT INTO Person ...
Now you want add related record to second table and link it to just add
Person.
INSERT INTO Phone (number, personPtr) VALUES ('12324345', ???? )
How to get RecID of just added BY ME (!!!) record ?
The way you point require creation of EMPTY cursor and then Add() call then
deletion of cursor. Command INSERT seems to require less work, correct?
So for this way we need some way to get last RecID without cursor
INSERT INTO Phone (number, personPtr)
VALUES ('12324345', LastRecID('person') )
Or
INSERT INTO Phone (number, personPtr)
VALUES ('12324345', Person.LastRecID )
--
Best regards,
Ruslan Zasukhin [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com
To subscribe to the Valentina mail list go to:
http://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------
More information about the Valentina
mailing list