Forum Stats

  • 3,837,097 Users
  • 2,262,225 Discussions


How to delete a record and then run plsql in IG

Cerberus Waits
Cerberus Waits Member Posts: 24 Red Ribbon
edited Nov 21, 2019 2:56PM in APEX Discussions

Thanks in advance for taking the time to help me out.  The product build is

I'm trying to run plsql procedure after saving an interactive grid.  The procedure works fine for adding/modifying a record.  However, when I try to delete a record, I get:

Ajax call returned server error ORA-20987: APEX - ORA-01403: no data found for .

I understand this is because I've deleted a record and then I'm trying to run code on a record that has been removed.  How do I get the procedure to run with the understanding that there is one less record?  At this point, I'm fine with telling my end user that deleting a record cannot be combined with other updates to the IG, which means separate 'Saves' for a delete and for an update/insert.

I tried creating a NO_DATA_FOUND exception in my procedure to stop it from running.  I tried setting up a condition in APEX that prevents the pl sql from running if :APEX$ROW_STATUS = 'D', and I tried preventing the sql from running if :APEX$ROW_SELECTOR = 'X'.

Any advice?