Yes Martijn you are quite rigth, exactly what I wanted to do ...
Thank you,
Hernando.
Hi to all,
This is one approach (Maybe could be done one more efficient):
/**
* Firebird 2.5
*/
-- 1.Create new fields
ALTER TABLE some_table
ADD id INTEGER DEFAULT 0 NOT NULL,
ADD foo_dummy CHAR(1);
-- 2.Create generador
CREATE GENERATOR some_table_id_gen;
--
Wouldn’t leaving out the “temp trigger” and “foo” and simply doing:
update sometable set id = gen_id(some_table_id_gen, 1);
have the same result?
With regards,
Martijn Tonies
Upscene Productions
http://www.upscene.com
Download Database Workbench for Oracle, MS SQL Server, Sybase SQL
Anywhere,