SQLSTATE [HY000]:常规错误:1400 OCIStmtExecute:ORA-01400:无法将NULL插入(“ PABW2”。“ BASKET”。“ ID_BARANG”)(ext \ pdo_oci \ oci_statement.c:159)
答案 0 :(得分:2)
根据您到目前为止所写的信息,我会说您错了。
这是一个例子:
SQL> create table basket
2 (id_barang number NOT NULL,
3 name varchar2(20) NOT NULL
4 );
Table created.
SQL> insert into basket (id_barang, name) values (null, 'Little');
insert into basket (id_barang, name) values (null, 'Little')
*
ERROR at line 1:
ORA-01400: cannot insert NULL into ("SCOTT"."BASKET"."ID_BARANG")
SQL> -- OK, let's fix it
SQL> insert into basket (id_barang, name) values (100, 'Little');
1 row created.
SQL>