|Subject||Re: [firebird-support] Serial number in a query result|
> On 25-03-2011 12:02 PM, Thomas Steinmaurer wrote:I hope you won't create a mass of generators for that purpose?
>>>> A throw-away SEQUENCE would also do the trick, I think:
>>>> sql> create sequence AdHoc;
>>>> sql> select next value for AdHoc as SrNo, d.* FROM (...) d;
>>> This is exactly what I want.
>> Needless to say, if the generator/sequence is used by multiple users,
>> then this isn't safe.
> And also, it will exhaust after 32000 queries am i right (if a new
> sequence is used every time)?
A sequence/generator returns a 64-bit integer, so you won't run out of
generator values in your life-time-. ;-)
Download LogManager Series, FB TraceManager today!
Continuous Database Monitoring Solutions supporting
Firebird, InterBase, Advantage Database, MS SQL Server