|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Generators
Hai,
I am new to this firebird. Can anybody help for creating a generator . (Auto increment) thanks |
|
#2
|
|||
|
|||
|
You have several ways to establish autoincrementing using generators. The first - you may create before insert trigger and fill your ID field like following:
new.ID=gen_ID(<your generator name>, 1); This way can be used only when you don't need to return ID value to the application. The second way is to create stored procedure that will return new ID value and then perform actual INSERT. The third way is to create stored procedure to insert record that will look like: begin ID=gen_ID(<your generator name>,1); insert into <Table>(ID,....<other fields>) values (:ID,...<other variables>) .... end Modern developer tools are able to create such triggers or procedures for you. ---- Best regards, Pavel Kutakov SQLLY Development Interbase/Firebird Development Studio - complete development solution. |
![]() |
| Viewing: Dev Shed Forums > Databases > Firebird SQL Development > Generators |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|