Home » SQL & PL/SQL » SQL & PL/SQL » Default values of a column
Default values of a column [message #21136] Mon, 15 July 2002 20:45 Go to next message
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 Go to previous messageGo to next message
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.....
Re: Default values of a column [message #21170 is a reply to message #21138] Wed, 17 July 2002 00:51 Go to previous message
P.Deshmukh
Messages: 17
Registered: March 2002
Junior Member
Thanks Ravi, its working fine. Only problem I faced that while dropping the primary key Child records found error was encounterd, which somehow I have rectified.
Thanks again ,
Previous Topic: solving the query
Next Topic: new data type of oracle 9i
Goto Forum:
  


Current Time: Thu Apr 25 06:23:25 CDT 2024