Default values of a column [message #21136] |
Mon, 15 July 2002 20:45 |
P.Deshmukh
Messages: 17 Registered: March 2002
|
Junior Member |
|
|
How can one retrive the default values of a column?
Also, can we modify the constraint like if the composit primary is on 3 columns ,I would like to have it only on two columns.
Thanks & Regards,
|
|
|
Re: Default values of a column [message #21138 is a reply to message #21136] |
Mon, 15 July 2002 21:16 |
Ravi
Messages: 251 Registered: June 1998
|
Senior Member |
|
|
1. To retrive the default values of a column
select data_default from user_tab_columns
where table_name = 'YOUR TABLE'
and column_name = 'YOUR COLUMN'
2. You can't modify a constraint, To do this you have to drop the constraint from your table first and then add another constraint.
alter table table_name
drop primary key;
then
alter table table_name
add constraint primary_key(col1,col2);
but keep in mind if data already in table violating the rule of primary key.. it will not create primary key.
let me know if this works.....
|
|
|
|