Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Default column values
Do not state column name in insert clause. If you hava number column(num1) in table1 table like below
insert into table(col1, col2)
values ('value1','value2');
then num1 will be 50.
<oradba_n_az_at_my-deja.com> wrote in message
news:8sq57p$kjs$1_at_nnrp1.deja.com...
> I have a test table with a date column, a
> varchar2 column and a number column with a
> default value of 50. When I insert data into the
> table and leave the number field blank (NULL), it
> stays NULL (doesn't insert the default value of
> 50). If I modify the column to be NOT NULL and
> try to insert the same data, I violate the NOT
> NULL constraint. How does the default value get
> inserted into the table when no value is given in
> the insert statement?
>
>
> Thanks!!
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Received on Sat Oct 21 2000 - 09:27:48 CDT