-
insert statement
Hi
I was wondering when I write an insert statement how do I leave a date field blank( Not Null Date) and also the number field (NOT NULL NUMBER) blank.
thanks,
bvg
-
try one of these ...
SQL> create table my_table (col1 char(1),col2 number,col3 date);
Table created.
SQL> insert into my_table (col1) values ('A');
1 row created.
SQL> insert into my_table (col1,col2,col3) values ('A',null,null);
1 row created.
SQL> insert into my_table (col1,col2,col3) values ('A',to_number(null),
2 to_date(null));
1 row created.
SQL> select * from my_table;
C COL2 COL3
- ---------- ---------
A
A
A
SQL>
-
bvg, are the columns defined as NOT NULL? If so, you can't leave them blank . . .
"The power of instruction is seldom of much efficacy except in those happy dispositions where it is almost superfluous" - Gibbon, quoted by R.P.Feynman
-
thank you so much DAV and DAPI for the info.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|