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
Give the various rollback segment states.
Is java required for oracle client?
What is the purpose of save points in oracle database?
How to export your own schema?
What is a tns service name?
How do I use unicode codesets with the weblogic jdriver for oracle driver?
How do I know if oracle client is installed on windows?
I am using an Oracle 8i Database my data contains Clob data. I am using toad version 7.6 i am able to get the data in toad but unable to extract the data in excel.when trying to extract the data into the excel the toad error says out of memory. Can any body please help me to extract the data through the same toad version. Thanks in advance
What is the maximum limit on the number of columns in a table?
What is oracle rowcount?
What is tns service name?
In Oracle Applications We are Using Sub Ledger Accounting. When we Transfer the Data all modules (AP,AR,CE,FA) to SLA We done Some customizations? What are They??
Explain drop constraint oracle?
What is a nvl function? How can it be used?
What is the difference between substr & instr functions?