Subject | more questions on use of generators |
---|---|
Author | Jon Perez |
Post date | 2002-11-11T16:04:33Z |
In isql, why is:
select gen_id(GENNAME, 0) as GenVal from RDB$Database
needed to get the value of a generator instead
of a simple:
select gen_id(GENNAME, 0)
as is the case with MySQL...?
Also, when using SQL embedded in another language (I'm
using Python kinterbasdb), if one wants to be able to
know what number was generated, is it recommended to get
this value first via the above method and then manually
include it in an insert instead of using a before insert
trigger to do it automatically?
Or is there a way to use the before insert trigger method
and still be able to get the last generated value
reliably even in a multi-user environment?
select gen_id(GENNAME, 0) as GenVal from RDB$Database
needed to get the value of a generator instead
of a simple:
select gen_id(GENNAME, 0)
as is the case with MySQL...?
Also, when using SQL embedded in another language (I'm
using Python kinterbasdb), if one wants to be able to
know what number was generated, is it recommended to get
this value first via the above method and then manually
include it in an insert instead of using a before insert
trigger to do it automatically?
Or is there a way to use the before insert trigger method
and still be able to get the last generated value
reliably even in a multi-user environment?