| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Default column values
oradba_n_az_at_my-deja.com ÐÉÛÅÔ × ÓÏÏÂÝÅÎÉÉ <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?
>
By example, in DBMS Linter (Russua):
create table test (d date, v varchar(2), n number default 50);
insert into test(d,v,n) values (to_date ('23.09.2000','dd.mm.yyyy'),'1',56);
insert into test(d,v) values (to_date ('23.09.2000','dd.mm.yyyy'),'2');
insert into test(d,v,n) values (to_date
select * from test;
|23.09.2000 |1 | 56.0 | |23.09.2000 |2 | 50.0 | |23.09.2000 |3 | <null> | |23.09.2000 |4 | 59.0 | |<null |<null> | 50.0 |Received on Mon Oct 23 2000 - 08:20:24 CDT
![]() |
![]() |