Is it possible to update a primary key value? If not, what
is the error code given? If yes, can more than 1 primary
key column be updated at a time?

Answers were Sorted based on User's Feedback



Is it possible to update a primary key value? If not, what is the error code given? If yes, can mo..

Answer / guest

Primary key value can be updated as well provided the value
you update it with identifies it uniquely.

Is This Answer Correct ?    28 Yes 4 No

Is it possible to update a primary key value? If not, what is the error code given? If yes, can mo..

Answer / keshireddy

further, multiple primary keys can be updated at time. Only
condition is that value should be unquie. else sql code -803

Is This Answer Correct ?    18 Yes 0 No

Is it possible to update a primary key value? If not, what is the error code given? If yes, can mo..

Answer / guest

Ans 3 is correct. If the key already present, while
updating it will show the sql code as = -803.

Is This Answer Correct ?    12 Yes 1 No

Is it possible to update a primary key value? If not, what is the error code given? If yes, can mo..

Answer / guest

also remember, you cannot update a primary key when it has
matching foreign key values.

Is This Answer Correct ?    8 Yes 0 No

Is it possible to update a primary key value? If not, what is the error code given? If yes, can mo..

Answer / haribabu

yes, it is possible, move 'value' to ws-eno. Here ws-eno is
primary-key.

Is This Answer Correct ?    1 Yes 1 No

Is it possible to update a primary key value? If not, what is the error code given? If yes, can mo..

Answer / deepak

First u will need to drop the index and then make the
required changes to PK and later again create the
index,Make sure u have all the conditing to for PK fine.

Is This Answer Correct ?    1 Yes 1 No

Is it possible to update a primary key value? If not, what is the error code given? If yes, can mo..

Answer / priya

If a primary key column cannot be updated, what is the
error code given when an attempt is made to update it
through a SQL query in a COBOL program?

Is This Answer Correct ?    3 Yes 5 No

Is it possible to update a primary key value? If not, what is the error code given? If yes, can mo..

Answer / sujeesh

Primary key column cannot be updated,because it is used as
the key field to find out a row uniquely.

Is This Answer Correct ?    17 Yes 22 No

Post New Answer

More DB2 Interview Questions

Can you Average the Characters ?

3 Answers  


What are types of indexes?

0 Answers  


How would one remove old reorg information from the DB2 catalog?

2 Answers  


Can you access the DB2 Directory table using SQL?

3 Answers  


What is read-only cursor?

1 Answers  






what is the sqlcode -501

5 Answers   IBM, Polaris, Zeus,


If anyone has IBM Certification Dumps pls forward to me & also let me know what are the Certification Codes that are available in DB2

0 Answers  


Before you give the explain statement, what are the prerogatives?

0 Answers  


how do you resolve -818 error in db2. where we have to see time stamp token. i said by seeing in load module and plan .is it correct or not. give clear explination for how to see time stamp token

2 Answers   IBM, TRD,


How to compare data between two tables in db2?

0 Answers  


Update command

1 Answers  


1. what if null values retrived from database and no null indicator mentioned in query. What is sql code.

1 Answers   Cap Gemini,


Categories