Answers for "constraint primary key oracle"

SQL
1

drop primary key oracle

-- Dropping Using alter
ALTER TABLE table_name
DROP CONSTRAINT constraint_name;
Posted by: Guest on September-21-2020
0

identify primary key in oracle table

-- syntax:
SELECT cols.table_name, cols.column_name, cols.position, cons.status, cons.owner
FROM all_constraints cons, all_cons_columns cols
WHERE cols.table_name = '<table-name>' -- Replace <table-name> with your table-name
AND cons.constraint_type = 'P'
AND cons.constraint_name = cols.constraint_name
AND cons.owner = cols.owner


-- example:
SELECT cols.table_name, cols.column_name, cols.position, cons.status, cons.owner
FROM all_constraints cons, all_cons_columns cols
WHERE cols.table_name = 'CUSTOMERS' 
AND cons.constraint_type = 'P'
AND cons.constraint_name = cols.constraint_name
AND cons.owner = cols.owner
Posted by: Guest on April-17-2020

Code answers related to "constraint primary key oracle"

Code answers related to "SQL"

Browse Popular Code Answers by Language