Subject | Re: [firebird-support] auto increment field |
---|---|
Author | Yves Glodt |
Post date | 2003-10-20T17:55:47Z |
On Monday 20 October 2003 04:01, Lee Jenkins wrote:
integer columns, as in other dbs?
There seems to be popular demand for autoincrement, and it would surely
help (non-dba)users (read "Access", etc...) to migrate to FB.
regards,
Yves
Linux 2.4.22-1-k7 #1 Sat Sep 6 02:13:04 EST 2003 i686
19:51:51 up 38 min, 1 user, load average: 0.32, 0.37, 0.26
> sp2gui wrote:Has it never been considered to provide an "autoincrement" property for
> > is firebird support auto increment data type?
> > (
> > like 'serial8' data type in postgresql.
> > like 'bigint auto_increment' in mysql.
> > )
>
> Yes, but its done through generators. Lookup generators in the docs.
integer columns, as in other dbs?
There seems to be popular demand for autoincrement, and it would surely
help (non-dba)users (read "Access", etc...) to migrate to FB.
regards,
Yves
> Here is an example:--
>
> CREATE GENERATOR GEN_MNU_PRODUCTS_ID;
>
> SET TERM ^ ;
> /* Trigger on the Before Insert of the table */
> CREATE TRIGGER MNU_PRODUCTS_BI FOR MNU_PRODUCTS
> ACTIVE BEFORE INSERT POSITION 0
> AS
> BEGIN
> IF (NEW.MENUITEMID IS NULL OR
> NEW.MenuITEMID = 0) THEN
> NEW.MENUITEMID = GEN_ID(GEN_MNU_PRODUCTS_ID,1);
> END
> ^
> SET TERM ; ^
>
>
> Most of the GUI admin tools for FB have little helpers (wizards?)
> that make the generation of autoinc (Generator) fields easy.
>
> http://ibexpert.com has a very nice admin tool. There are other
> really nice ones out there too. IBExpert has a personal edition that
> you can download from their site. I'm getting ready to purchase the
> full verion since I like it so much.
>
> Lee
>
>
> ------------------------ Yahoo! Groups Sponsor
> ---------------------~--> Buy Ink Cartridges or Refill Kits for your
> HP, Epson, Canon or Lexmark Printer at MyInks.com. Free s/h on orders
> $50 or more to the US & Canada.
> http://www.c1tracking.com/l.asp?cid=5511
> http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/67folB/TM
> ---------------------------------------------------------------------
>~->
>
> To unsubscribe from this group, send an email to:
> firebird-support-unsubscribe@yahoogroups.com
>
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
Linux 2.4.22-1-k7 #1 Sat Sep 6 02:13:04 EST 2003 i686
19:51:51 up 38 min, 1 user, load average: 0.32, 0.37, 0.26