Solved

sequence number in db2

Posted on 2001-08-23
4
1,402 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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

I guess that all of us know that caching the data usually increase the performance, but I worried if all of us are aware about the risk that caching the data provides and how to minimize this.  That’s the reason why I decided to write this short art…
Read about achieving the basic levels of HRIS security in the workplace.
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…

747 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

11 Experts available now in Live!

Get 1:1 Help Now