Question: I am trying to insert null
value in numeric data type and I got an ORA-01400 error?
Here is the insertion statement:
INSERT INTO
INVOICE
(ITEM_NUM,
ITEM_DESC,
DEL_QTY,
SO_QTY,
DATE_PURCHASE,
RETAIL_PRICE,
DISCOUNT,
CUSTOMER_NUM)
You have 8 columns
to inxert:
VALUES (
'69112-95B',
'HORN KIT, CHROM',
1,
NULL,
'OCT-11-03',
79.95,
15.99,
30086);
Answer: Oracle oerr has this
information on the ORA-01400 error:
ORA-01400: cannot insert NULL into (string)
Cause: An attempt was made to insert a NULL into
the column "USER"."TABLE"."COLUMN".
For example, if
you enter:
connect scott/tiger create table a (a1
number not null); insert into a values (null);
Oracle
returns:
ORA-01400 cannot insert NULL into
("SCOTT"."A"."A1") : which means you cannot insert NULL into
"SCOTT"."A"."A1".
Action: Retry the operation
with a value other than NULL
To see if a table allows NULL values, use tthe SQL*Plus
desc command on the table name:
SQL> desc invoice
Another solution for the ORA-01400 error is to modify the
table to make the column NULLABLE (i.e. allow a NULL value.
See my notes on how tp
make a Oracle
table column nullable