Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Is there any concept of rowid and rownum in db2

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
View previous topic :: :: View next topic  
Author Message
ipavan

New User


Joined: 12 Jun 2005
Posts: 28
Location: Hyderabad

PostPosted: Wed Jul 20, 2005 9:38 pm    Post subject: Is there any concept of rowid and rownum in db2
Reply with quote

please clarify my doubts.

1. Is there any concept of rowid and rownum in db2.

2. I have tried to alter an already created table. The only change i could do
was add a column.
can we modify a column , add primary key constraint,foreign key constraint. If its possible , can u please mention the syntax.

3. can we update the values in a column such a way that each row of the column have a different value. i want to do it in a single sql query.
Back to top
View user's profile Send private message

vijayamadhuri

Active User


Joined: 06 Apr 2005
Posts: 180

PostPosted: Wed Jul 20, 2005 11:08 pm    Post subject:
Reply with quote

.
Quote:

Is there any concept of rowid and rownum in db2


Yes

Quote:

I have tried to alter an already created table. The only change i could do
was add a column.
can we modify a column , add primary key constraint,foreign key constraint. If its possible , can u please mention the syntax.


It is not possible to alter the primary key oncethe table has been defined .In case u want to change the primary key we should first delete the data of the table and then reconfgure the key taking care of the constraints of the the primary key.
A foreign key can be changed as per the requirement.

please could u be more clear in the 3rd question.
Back to top
View user's profile Send private message
vidyadhar

New User


Joined: 17 Nov 2007
Posts: 2
Location: chennai

PostPosted: Thu Jan 14, 2010 1:34 am    Post subject:
Reply with quote

SELECT ROW# FROM RNXPSC2T TB1,
TABLE (SELECT COUNT(*) + 1 AS ROW#
FROM RNXPSC2T TB2
WHERE TB2.ID_PSCR < TB1.ID_PSCR) AS TEMP_TAB
WHERE ROW# = 2;
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Jan 14, 2010 1:44 am    Post subject:
Reply with quote

Hello,

How does that query relate to some question in the original post?
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts ROWID field for LOBs gangapd DB2 1 Wed Oct 05, 2016 11:49 am
No new posts JCL overriding concept s.saranya srinivasan JCL & VSAM 14 Wed Oct 07, 2015 4:07 pm
No new posts Image copy concept sravz chinnu DB2 6 Thu Apr 19, 2012 5:10 pm
No new posts SRRCMIT concept for MQ kunal jain COBOL Programming 6 Mon Mar 19, 2012 1:20 pm
No new posts Is the concept of Tracker site availa... dejunzhu DB2 1 Sun Apr 10, 2011 4:27 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us