Subject Re: [firebird-support] Return integer row_id in record set
Author Ronan van Riet
Thank you Thomas.

I am not sure I am following. Could you possibly provide some more information on how this could work?

Thanks in advance,
Ronan


----- Original Message -----
From: Thomas Steinmaurer
To: firebird-support@yahoogroups.com
Sent: Sunday, July 24, 2011 8:54 AM
Subject: Re: [firebird-support] Return integer row_id in record set



> I wish to display the ID (of all time points = 0). I can handle this programatically but rather would do in SQL.
>
> The following query returns the time points
>
> SELECT ID as VAL
> FROM x
> WHERE "TIME" = 0
> order by id
>
> The values are
> 87
> 117
> 120
>
> Now, is there a function in FB that will return me an ID (sequential, starting at 1 and increments of 1) for each of the records like so?
>
> ID VAL
> 1 87
> 2 117
> 3 120

Although it might be possible with a mix of RDB$SET_CONTEXT,
RDB$GET_CONTEXT, it's rather easy with a selectable stored procedure.

--
With regards,

Thomas Steinmaurer
Upscene Productions
http://www.upscene.com
http://blog.upscene.com/thomas/

Download LogManager Series, FB TraceManager today!
Continuous Database Monitoring Solutions supporting
Firebird, InterBase, Advantage Database, MS SQL Server
and NexusDB!




__________ NOD32 6319 (20110723) Informatie __________

Dit bericht is gecontroleerd door het NOD32 Antivirus Systeem.
http://www.nod32.nl


[Non-text portions of this message have been removed]