Skip to Main Content

Oracle Forms

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!

how to capture exception in ON-INSERT trigger (oracle 10g)

Darren2Jun 19 2014 — edited Jun 20 2014


I have my own custom alert function.  It At the data block level, I have this in the ON-INSERT trigger:

custom_alert.show( 'begin insert' );

BEGIN

     INSERT_RECORD;

     custom_alert.show( 'insert successful' );

EXCEPTION

     custom_alert.show( 'insert failed: ' || SQLCODE || ',' || SQLERRM );

     RAISE;

END;

I force an error by purposely trying to insert a record with no data in a NOT NULL contraint field.  When I commit this record, I see the following sequence:

my custom alert with the message "begin insert".

I press OK and then see my custom alert "insert successful" at the same time the status message in the form says, "FRM-40508: ORACLE error: unable to INSERT record."

I press OK and then see an Oracle generated alert with the message, "FRM-40508:  ORACLE error: unable to INSERT record."

Basically, the error is not being caught by the exception clause.

Is there a solution to this?

Darren

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 18 2014
Added on Jun 19 2014
6 comments
7,620 views