Home » Developer & Programmer » Forms » Block pre-insert trigger
Block pre-insert trigger [message #197844] Thu, 12 October 2006 20:28 Go to next message
secchan20
Messages: 31
Registered: April 2005
Member
Hi,
My data block from table has where_clause (id_2 = 0). The id_2 has two values 0 or -1. When a record is deleted from the screen, update id_2 to -1 so that it won't show up. My problem arises when user re-enters the same record and commits. I try to update id_2 to 0 by when-button-pressed trigger as follows.

UPDATE mydata SET id_2 = 0 WHERE myrec = :myblock.myrec;
COMMIT;

However form's pre-insert trigger fires before my COMMIT, and gives "FRM-40508 unable to insert" error. Of course! the record already exists in the table with PK!

To block FRM-40508, I added form level on-error trigger, and it blocked the error message! However, commit is not done. After requery, the record re-entered doesn't show up.

How could I go around this pre-insert trigger and update id_2?
Please help!



Re: Block pre-insert trigger [message #197848 is a reply to message #197844] Thu, 12 October 2006 20:53 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Instead of running the 'update' statement when you do the 'delete' just change 'id_2' to '-1' and do an execute_query.

David
Previous Topic: ORA-00600- INTERNAL CODE ERROR,ARGUMENTS
Next Topic: Horizontal and Vertical record Display
Goto Forum:
  


Current Time: Fri Sep 20 11:37:50 CDT 2024