Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Inserting a record before the Automatic Row Processing

Javier PMar 23 2021

Hi,
In Apex 20.2
I have a process that insert a page item into another table before the automatic row processing.
The page item is not bound to any field.
This is the code:

declare
l_dname varchar2(100);
begin
l_dname := upper( trim( :P45_NEW_LOCAL ) );
insert into risk_locales ( local, organizacion_id )
values( l_dname, :P45_ORGANIZACION_ID )
returning local into :P45_LOCAL;
exception when dup_val_on_index
then
-- if local already exists, fetch id
select local
into :P45_LOCAL
from risk_locales
where 1 = 1
and local = l_dname
;
end;

The problem is that am getting ORA-01400: cannot insert NULL into ("RISKMANDEV"."RISK_LOCALES"."LOCAL"). I checked in the session and :P45_NEW_LOCAL has a value. Why am I receiving that message.
What could be a happening?
Thanks for the help!

This post has been answered by Richard Legge on Mar 25 2021
Jump to Answer
Comments
Post Details
Added on Mar 23 2021
24 comments
918 views