I'm trying to insert a record into a table, but getting the error -
'ORA-01400: cannot insert NULL into (....'. The table structure is:
I migrate from Mysql to Oracle.
On Mysql this works, but on Oracle it is not working. How can I fix this? Do I need write all column insert query or unselect not null option
Try this:
create or replace trigger EDITIONS_COR
before insert or update on EDITIONS
for each row
begin
if INSERTING then
select EDITIONS_SEQ.nextval into :new.ID from DUAL;
end if;
:new.CORDATE:=SYSDATE;
:new.USERNAME:=USER;
end;