Subject | RE: [firebird-support] Get the row number in a select |
---|---|
Author | Sasha Matijasic |
Post date | 2008-03-28T18:12:43Z |
>Very nice :)
> I have just figured out my own tricky way :-)
>
> I think it's cheap, multi-user friendly and can be achieved using just
> a simple select:
>
> select
> rdb$get_context('USER_TRANSACTION', 'row#') as row_number,
> rdb$set_context('USER_TRANSACTION', 'row#',
> coalesce(cast(rdb$get_context('USER_TRANSACTION', 'row#') as integer),
> 0) + 1),
> a.rdb$relation_name
> from
> rdb$relations a
> order by
> a.rdb$relation_name
>
Sasha