Trapping Oracle Error in Forms overriding Forms Error [message #158929] |
Wed, 15 February 2006 02:15 |
nirmalnarayan
Messages: 261 Registered: April 2005 Location: India
|
Senior Member |
|
|
Hi,
I created a Data block based on a Table say 'A' this table have child records in 'B'. I am having only one datablock on this form which is based on table 'A'.
I am having the standard Oracle forms Toolbar for inserting , deleting , etc., on this form.
The Column 'Code' of this table is set as primary key and this field is displayed on the datablock. Whenever i try to enter a duplicate record into this field i want to trap the Oracle Primary key violation error.
But i coded this in ON-INSERT trigger, but this is not firing instead i am getting the following error.
"FRM-40508: ORACLE error: unable to INSERT record."
I want to override this error, and trap the Oracle Primary key violation error.
What can be done to achieve this ?
Thanks and Regards,
Nirmal Narayanan.
|
|
|
Re: Trapping Oracle Error in Forms overriding Forms Error [message #158963 is a reply to message #158929] |
Wed, 15 February 2006 04:24 |
|
Maaher
Messages: 7065 Registered: December 2001
|
Senior Member |
|
|
Don't mess with the ON-INSERT trigger unless you are really sure because this overrides the standard forms insert processing. You will have to write your own insert processing in this trigger if you use it.
To trap errors, you use the ON-ERROR trigger. Take a look at dbms_error_code and and forms_error_code and the other error built-ins. I don't have Forms here so I can't give you full details but I think there's an example in Forms Help.
MHE
|
|
|