Subject | Re: [Firebird-Java] Autoincrement Values with Open-Office via jdbc |
---|---|
Author | Roman Rokytskyy |
Post date | 2004-12-20T21:32:05Z |
> I want to switch from MS Produkts to Open-Source and one of myFirebird does not have autoincrement fields. You can mimic it with triggers
> favorites is Firebird with open-office as backend via jdbc.
> No I have one great problem, Open-office is not able to fetch
> autoincrement values from Firebird.
> Any Ideas?
and generators, but Firebird does not provide any means to access the value
assigned to the column. There are two possible solutions:
a) fetch next value using SELECT gen_id(generatorName, 1) FROM rdb$database;
that gives you value of the "auto-increment" field, then you have to INSERT
INTO myTable (...) VALUES (....)
b) create a stored procedure that gets value from a generator, performs an
insert and returns the value to the client.
Hope this helps.
Roman