Subject Re: [firebird-support] Re: Firebird record number
Author Alexandre Benson Smith
legrand_legrand_63 wrote:
>> Hi,
>> i don't know if my trouble is about sql or about firebird but i would
>> like to return the record number of each record in a table,
>> so a kind of :
>> "select field1, field2..., recnumber as myfield from mytable.
>>
>> i try also with rownumber etc... but no success
>>
>> Thanks for your help
>> Julien
>>
>>
>
>
> Salut,
> Firebird has a pseudo column called ROW_NUM that answer your question,
> but it is only available in PSQL:
> http://www.janus-software.com/fbmanual/manual.php?book=PSQL&topic=96
>
> With this ROW_NUM you should be able to write a procedure returning
> the "rownumber" (In fact even without it, you should be able to write
> a procedure counting records before to return them).
>
> And last Fyracle (Firebird Oracle-mode) has a rownum feature available
> in its Firebird distribution
> http://www.janus-software.com/runtime_dl.html (but please don't use it
> for prod it is a frozen project ;o)
>
> Regards
> PAscal
> Regards
> PAscal
>
>
>

Pascal,

I think there is some mis-information here.

ROW_NUM should be a Fyracle implementaton to mimic Oracle's ROW_NUM as
you said Fyracle ir Oracle Mode Firebird.

Fyracle is not a frozen product.

Firebird has RDB$KEY virtual column that identifies a row uniquely
across a database, Google for RDB$KEY and read the Claudios articles
about it.

But I think first thet the original author of the question could explain
what he is looking for and for what propose.

see you !

--
Alexandre Benson Smith
Development
THOR Software e Comercial Ltda
Santo Andre - Sao Paulo - Brazil
www.thorsoftware.com.br