Forum Stats

  • 3,758,411 Users
  • 2,251,384 Discussions
  • 7,870,185 Comments

Discussions

SYS_GUID not being inserted in PLSQL Expression

User_RZ2O1
User_RZ2O1 Member Posts: 3 Green Ribbon

Hello,

I have a form in my application to add a row into a lookup table. This is the insert statement contained in the dynamic action that executes a server-side code.

INSERT INTO NON_APPLICATION_ACTIVITY (NON_APPLICATION_ACTIVITY_ID, ACTIVITY_EN_NAME,

ACTIVITY_FR_NAME, ACTIVE_IND, EXPIRY_DATE, EFFECTIVE_DATE, LAST_MODIFIED_DATE, LAST_MODIFIED_USER)

VALUES ((SELECT SYS_GUID() FROM DUAL), :P13_ACTIVITY_EN_NAME, :P13_ACTIVITY_FR_NAME, 1, sysdate, sysdate, sysdate,(SELECT USERNAME 

FROM PERSON

WHERE (SELECT NVL ((UPPER (APEX_UTIL.get_username (APEX_UTIL.get_current_user_id))), USER)

FROM SYS.DUAL) = UPPER(USERNAME) ) );

When I click on the button to execute this code, it says it can't insert null into NON_APPLICATION_ACTIVITY_ID. Does anyone know why the statement 'SELECT SYS_GUID() FROM DUAL' would return null in APEX? This work just using PL/SQL Developer.

Tagged: