Subject | Re: [firebird-support] How do I retrieve the primary key after an insert? |
---|---|
Author | Martijn Tonies |
Post date | 2005-03-29T13:24:26Z |
Hello,
The best way to do all this is:
1) get your GUID (eg: select myfunc from rdb$database)
2) save your master record, including the guid
3) save your child record
With regards,
Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server
Upscene Productions
http://www.upscene.com
> Sorry for the newbie question, but I have a table with a UUIDI assume you're generating the GUID in a trigger...
> (compressed reversed GUID) as the primary key.
>
> I am using it as a link to a child table so I need to know what the
> value is before I write the child records.
>
> How is this done with firebird and also is it possible to do the whole
> thing in one trasaction?
The best way to do all this is:
1) get your GUID (eg: select myfunc from rdb$database)
2) save your master record, including the guid
3) save your child record
With regards,
Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server
Upscene Productions
http://www.upscene.com