Home » SQL & PL/SQL » SQL & PL/SQL » How to give defalt value for a column in oracle??
How to give defalt value for a column in oracle?? [message #23414] Fri, 06 December 2002 00:43 Go to next message
Praveen
Messages: 57
Registered: November 2001
Member
dear sir/madam,

I want to know " how to give a default value for a column at the time of creating table???" . is it possible??? If it is not possible in create command then any other way to do this. Is there somthing like "Default" constraint?? I want this feature if i am providing value for that column then it will accept that and if i am not providing any value to that column then it will go for default value.
waiting for reply...

thanks ....

Praveen Gattani
Bangalore-10
India
Re: How to give defalt value for a column in oracle?? [message #23415 is a reply to message #23414] Fri, 06 December 2002 00:50 Go to previous messageGo to next message
Suresh
Messages: 189
Registered: December 1998
Senior Member
Example:
========
create table employee
(
empno number(2),
deptno number(2) default 10
);

Regards
Suresh
Re: How to give defalt value for a column in oracle?? [message #23417 is a reply to message #23414] Fri, 06 December 2002 01:17 Go to previous message
Suresh
Messages: 189
Registered: December 1998
Senior Member
hi suresh,

thanks for reply.
Tell me one more thing Is this default a constraint or it is some attribute built in oracle create query.

thanks onecs again....

Praveen Gattani
Previous Topic: String comparison...............
Next Topic: Timestamp Arithmetics
Goto Forum:
  


Current Time: Wed May 15 06:42:17 CDT 2024