Subject | Re: [firebird-support] Generator problem |
---|---|
Author | Svein Erling Tysvaer |
Post date | 2006-06-15T09:58:52Z |
> 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:
> timer_details
> 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
> results.
> 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.
HTH,
Set