Subject Re: [firebird-support] RecNo in query
Author emel.hu
>>How can I create simple SELECT query that will, in addition to
>>standard columns A,B,C give me count number (recno) as one of
>>resulting columns?

> You could:
>
> 1. Use generator. It will only work if you are the only user doing the select
> at a time.

If no problem a not one started counter and/or not continuous counter,
you can use generator in multiuser environment ;)

... and you can slide a uniq number from RDB$DB_KEY too.

eMeL



Hier two "nice" UDF function:

//-----------------------------------------------------------------------------------

int eMeL_DBKey2RowNum(char * str8bytes)
{
int * ipLow = (int *)(str8bytes + 4);
return *ipLow;
}
//-----------------------------------------------------------------------------------

int eMeL_DBKey2TableID(char * str8bytes)
{
int * ipHigh = (int *)(str8bytes);
return *ipHigh;
}
//-----------------------------------------------------------------------------------