Solved

sequence number in db2

Posted on 2001-08-23
4
1,447 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

These days, all we hear about hacktivists took down so and so websites and retrieved thousands of user’s data. One of the techniques to get unauthorized access to database is by performing SQL injection. This article is quite lengthy which gives bas…
This post looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.
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…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…

691 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