Solved

sequence number in db2

Posted on 2001-08-23
4
1,413 Views
Last Modified: 2009-12-09
How can I create a sequence number like x=x+1 directly in select statement in db2.
Sample SELECT x=x+1 || oid FROM tablename.
0
Comment
Question by:hj
4 Comments
 

Expert Comment

by:hitachi
ID: 6431359
Hi
   Can you please elaborate more on what you want.
I guess if you want the sequence functionality then
there is facility of auto genration of numbers in db2.
For that you have to crate a table with a field which is
populated by db2 itself. You can find detail about on db2
manuals.
          If you want row number like functionality then
you can use ROW_NUMBER() function.




Hitachi
0
 

Author Comment

by:hj
ID: 6433615
I'm trying to create a view on existing tables. All these tables contains a column OID (because the application above is object oriented). I wanna combine all the OID's in one column in the view and exactly for this I need an additional sequence number.
0
 
LVL 54

Expert Comment

by:nico5038
ID: 7259728

No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
 - PAQ'd and pts refunded
Please leave any comments here within the
next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

Nic;o)
0
 

Accepted Solution

by:
Jgould earned 0 total points
ID: 7289416
Question has been closed as per recommendation

JGould-EE Moderator
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SQL Command Tool comes with APEX under SQL Workshop. It helps us to make changes on the database directly using a graphical user interface. This helps us writing any SQL/ PLSQL queries and execute it on the database and we can create any database ob…
CCModeler offers a way to enter basic information like entities, attributes and relationships and export them as yEd or erviz diagram. It also can import existing Access or SQL Server tables with relationships.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

947 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now