I'm creating a table on our database with version Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64b
create table tahakkuk_kalem(
id int generated always as identity primary key,
aciklama varchar2(250),
tur int default 0 not null
);
and then applying some insert statements :
SQL> insert into tahakkuk_kalem(aciklama) select 'Atıksu' from dual;
SQL> select * from tahakkuk_kalem;
ID ACIKLAMA TUR
-- -------- ---
1 Atıksu 0
SQL> rollback;
SQL> insert into tahakkuk_kalem(aciklama,tur) select 'Atıksu',0 from dual;
ID ACIKLAMA TUR
-- -------- ---
2 Atıksu 0
SQL> rollback;
So far so good, but if I issue the statement below ;
SQL> insert into tahakkuk_kalem(aciklama,tur)
select 'Atıksu',0 from dual union all select 'Ceza',0 from dual;
met an incomprehensible error statement :
ORA-01400: cannot insert NULL into ("MY_SCHEMA"."TAHAKKUK_KALEM"."ID")
Do you have any opinion what could be the reason ?