Please help me how to write a Query to change the primary
key constraint from 1 attribute to another attribute in a
table
Answer Posted / dinesh a.
You can assing only one primary key on a table , so you
can't modify directoly one column to another , you need to
drop first one then create on another attribute.
SQL>ct constraint_name,constraint_type from user_constraints
where table_name='EMP' and constraint_type='P';
CONSTRAINT_NAME C
------------------------------ -
SYS_C00125220 P
SQL> alter table emp drop constraint SYS_C00125220;
sql> alter table any_table add constraint my_cons_nm
primary key(column_of_tab)
| Is This Answer Correct ? | 6 Yes | 1 No |
Post New Answer View All Answers
What is data file?
What is a nested table?
What is oracle open database communication (odbc)?
What is object data modeling?
What happens in oracle commit?
What is the simplest tool to run commands on oracle servers?
What is a partition in oracle?
Explain the use of owner option in exp command.
What is the difference between sharding and partitioning?
What is the difference between count (*), count (expression), count (distinct expression)?
What are the execution control statements?
How to run the anonymous block again?
What is oracle server autotrace in oracle?
Is the After report trigger fired if the report execution fails ?
hello friends Im doing my final year engineering in B.Tech.. one of uncle said he can provide job in his company if im good in database management. but i have only basic knowledge about database, so like to join database management course in good intuition. so friends kindly help me to get good intuition because its my future.