Thanks… I needed it to be able to structure a complex report. 

 

From: firebird-support@yahoogroups.com 
[mailto:firebird-support@yahoogroups.com] 
Sent: 13 March 2015 02:35 PM
To: firebird-support@yahoogroups.com
Subject: Re: [firebird-support] How To Generate Auto Increment Number in SQL 
Itself ?

 

  

Louis,

That's some clever get/set_context usage.

With regards,

Martijn Tonies
Upscene Productions
http://www.upscene.com

Download Database Workbench for Oracle, MS SQL Server, Sybase SQL
Anywhere, MySQL, InterBase, NexusDB and Firebird!

cast(rdb$get_context('USER_TRANSACTION', 'row#') as integer) as row_number,

rdb$set_context('USER_TRANSACTION', 'row#',

coalesce(cast(rdb$get_context('USER_TRANSACTION', 'row#') as integer), 0) + 
1),

< other columns>

from MY_TABLE





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

  • ... Vishal Tiwari vishuals...@yahoo.co.in [firebird-support]
    • ... 'Louis van Alphen' lo...@nucleo.co.za [firebird-support]
      • ... 'Martijn Tonies (Upscene Productions)' m.ton...@upscene.com [firebird-support]
        • ... 'Louis van Alphen' lo...@nucleo.co.za [firebird-support]
      • ... Vishal Tiwari vishuals...@yahoo.co.in [firebird-support]
        • ... Vishal Tiwari vishuals...@yahoo.co.in [firebird-support]
          • ... Vishal Tiwari vishuals...@yahoo.co.in [firebird-support]
            • ... Ann Harrison aharri...@ibphoenix.com [firebird-support]
              • ... Svein Erling Tysvær svein.erling.tysv...@kreftregisteret.no [firebird-support]
              • ... 'Louis van Alphen' lo...@nucleo.co.za [firebird-support]
                • ... 'Louis van Alphen' lo...@nucleo.co.za [firebird-support]
                • ... Vishal Tiwari vishuals...@yahoo.co.in [firebird-support]
                • ... Svein Erling Tysvær svein.erling.tysv...@kreftregisteret.no [firebird-support]
              • ... Mark Rotteveel m...@lawinegevaar.nl [firebird-support]

Reply via email to