|Subject||Re: [firebird-support] Generator problem|
|Author||Svein Erling Tysvaer|
> I am using FireBird Data base. when i use the following queryThis will return one value (row) for every record in TIMER_DETAILS.
> select gen_id(TIMER_GENERATOR,1) from timer_details;
> Here the sequence name is: TIMER_GENERATOR. schema name is:
> when i execute above query i am getting thePresumably you used some object that outputs maximum one row, i.e. an
> java.sql.SQLException: Error: executeQueryForObject returned too many
> when i execute the same query at the command prompt it works fine.
object that is normally used for DSQL and not cursors?
If you want only one value returned, you could use
select gen_id(TIMER_GENERATOR,1) from rdb$database;
rdb$database is a table that exists in every Firebird database and that
table always contains only one record.