Subject SV: [ib-support] Porting from mysql to firebird
Author Datatal AB - Gauffin, Jonas
I've found the generators.

Got these tables:
user_info
================
userid (PK)

user_extension
========================
userid (FK)
Extension

user_number
========================
userid (FK)
number

(That's not all columns)

So if I want to insert data to all three tables (using odbc):
1. Run a query to fetch a id from gen_id
2. Insert data to user_info
3. insert data to user_extension
4. insert data to user_number

Or am I missing something?

Thanks,
Jonas

> -----Ursprungligt meddelande-----
> Från: Svein Erling Tysvaer
> [mailto:svein.erling.tysvaer@...]
> Skickat: den 21 februari 2003 13:56
> Till: ib-support@yahoogroups.com
> Ämne: Re: [ib-support] Porting from mysql to firebird
>
>
> We've got generators, which are outside transaction control.
> Used correctly
> (i.e. by calling GEN_ID(<generatorname>, 1) every time you want a new
> number) these guarantee unique numbers. However, since they
> are outside
> transaction control, you have to first grab the number using
> GEN_ID and
> then insert it into whatever field you want. Using something like
> GEN_ID(<generatorname>, 0) I assume is similar to
> last_insert_id(), but
> this isn't safe in a multiuser environment where two people
> can insert
> simultaneously.
>
> There exists no column type AUTO_INCREMENT, most of us use
> INTEGER and
> fills them using generators.
>
> HTH,
> Set
>
> At 13:27 21.02.2003 +0100, you wrote:
> >Hello
> >
> >I'm about to port my application from using mysql to firebird.
> >Although Im going to do some testing first. In mysql there are a sql
> >function called last_insert_id() the returns the last
> inserted primary
> >key (if the column got the type AUTO_INCREMENT).
> >
> >Are there a similiar function in firebird? That is,
> auto_increment and
> >last_insert_id()?
> >
> >Thanks,
> > Jonas
>
>
> ------------------------ Yahoo! Groups Sponsor
> ---------------------~-->
> Get 128 Bit SSL Encryption!
> http://us.click.yahoo.com/FpY02D/vN2EAA/xGHJAA/67folB/TM
> --------------------------------------------------------------
> -------~->
>
> To unsubscribe from this group, send an email to:
> ib-support-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>
>
>