Subject | RE: [ib-support] more questions on use of generators |
---|---|
Author | Alan McDonald |
Post date | 2002-11-11T21:38:16Z |
Jon,
you can't use this syntax in MySQL...!
you have to ask for the LAST_INSERT_ID() which is connection specific,
non-table specific.
I think you would find the IB/FB generator construct a lot more flexible
Alan
-----Original Message-----
From: news@... [mailto:news@...]On Behalf Of Jon Perez
Sent: Tuesday, 12 November 2002 3:05
To: ib-support@yahoogroups.com
Subject: [ib-support] more questions on use of generators
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?
Yahoo! Groups Sponsor
ADVERTISEMENT
To unsubscribe from this group, send an email to:
ib-support-unsubscribe@egroups.com
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
[Non-text portions of this message have been removed]
you can't use this syntax in MySQL...!
you have to ask for the LAST_INSERT_ID() which is connection specific,
non-table specific.
I think you would find the IB/FB generator construct a lot more flexible
Alan
-----Original Message-----
From: news@... [mailto:news@...]On Behalf Of Jon Perez
Sent: Tuesday, 12 November 2002 3:05
To: ib-support@yahoogroups.com
Subject: [ib-support] more questions on use of generators
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?
Yahoo! Groups Sponsor
ADVERTISEMENT
To unsubscribe from this group, send an email to:
ib-support-unsubscribe@egroups.com
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
[Non-text portions of this message have been removed]