IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Is there any concept of rowid and rownum in db2


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
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
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
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
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

Moderator Emeritus


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

PostPosted: Thu Jan 14, 2010 1:44 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts ROWID field for LOBs DB2 1
No new posts JCL overriding concept JCL & VSAM 14
No new posts Image copy concept DB2 6
No new posts SRRCMIT concept for MQ COBOL Programming 6
No new posts Is the concept of Tracker site availa... DB2 1
Search our Forums:

Back to Top