View previous topic :: View next topic
|
Author |
Message |
ipavan
New User
Joined: 12 Jun 2005 Posts: 28 Location: Hyderabad
|
|
|
|
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 |
|
|
vijayamadhuri
Active User
Joined: 06 Apr 2005 Posts: 180
|
|
|
|
.
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 |
|
|
vidyadhar
New User
Joined: 17 Nov 2007 Posts: 2 Location: chennai
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
How does that query relate to some question in the original post? |
|
Back to top |
|
|
|