Cannot insert null value message
536299Oct 2 2006 — edited Oct 11 2006Hello all,
I'm using Application Express 2.1.0.00.39 with Oracle Database Express.
I am getting the following error message :
ORA-01400: cannot insert NULL into ("EXAM"."HISTORY"."EXA_TRAINING")
Error Unable to process row of table HISTORY.
I got a table HISTORY with the following structure :
HIS_ID NUMBER(8,0) NOT NULL,
EXA_ID NUMBER(8,0),
USR_LOGIN VARCHAR2(8),
EXA_TRAINING NUMBER(1,0) NOT NULL,
EXA_BEGIN DATE NOT NULL,
EXA_END DATE,
EXA_RESULT NUMBER(2,0)
On APEX I created a page with a form on a table or view. I defined the items created by APEX to have the following sources :
P2_USR_LOGIN (Display as Text, saves state) : PL/SQL Expression, :APP_USER
P2_EXA_TRAINING (Display as Text, saves state) : SQL Query,
SELECT DECODE(T.TOTAL, 0, 1, 0)
FROM (SELECT COUNT(HIS_ID) TOTAL FROM HISTORY
WHERE EXA_TRAINING = 1
AND EXA_ID = :P2_EXA_ID
AND USR_LOGIN = :APP_USER) T;
P2_EXA_BEGIN (Display as Text, saves state) : SQL Query,
SELECT TO_CHAR(SYSDATE, 'DD-MON-YYYY HH24:MI') FROM DUAL;
After getting the error message, I checked the session state and all items are defined correctly : P2_EXA_ID, P2_USR_LOGIN, P2_EXA_TRAINING, P2_EXA_BEGIN.
So what did I do wrong ?
Thanks,
Message was edited by:
Sebastien Mathy