This content has been marked as final. Show 8 replies
The error has nothing to do with your trigger. When you base a block on a table (a so called database block) and you insert data there, forms will automatically create the needed INSERT-statement when you a COMMIT_FORM. In your case, something went wrong with this. Go to the menu Help->Show errors there you will find the reason for the error.
The INSERT-statement in your trigger can be deleted.
btw... If you have to do an INSERT, you should always give the list of column-names in the INSERT
after you compile and run the form...... press CTRL+SHIFT+E
It will give you the description if the error.....
check it out .....
Edited by: Suhail Faraaz on Aug 28, 2010 9:52 AM
Hi the detail error is:
INSERT INTO ORDER_LINE_LIST(INV_ID,ITEM_DESC,INV_SIZE,COLOR,INV_PRICE,OK_QUANTITY,O_ID)
ORA-01779:cannot modify a column which maps to a non key-preserved table.
BTW the data block was created based on a view.
Edited by: 791401 on 28/08/2010 22:40
Edited by: 791401 on 28/08/2010 22:45
Since your block is based on a View, you cannot Insert, Update or Delete records directly as you do in blocks based on table.
You need to use the ON-INSERT, ON-UPDATE, ON-DELETE, and ON-LOCK triggers for inserting, updating and deleting records.
For instance in the ON-INSERT trigger you can use the INSERT statements to insert record in the order_master (check the table name) and order_line table.
Hope this helps.
You need to use the ON-INSERT, ON-UPDATE, ON-DELETE, and ON-LOCK triggers for inserting, updating and deleting records.Not neccecarily:
- You could set the "DML data target Name" to the undrlying table of the view, where you want to apply the DML to
- You could create INSTEAD-OF-triggers on the view and do the logic there.
Thanks. Can you pls tell me how I can set the "DML data target Name" to the undrlying table of the view?
go to the blocks properties (section Advanced Database) and enter the table name in the mentioned property.
thanks for the reply. helped me a lot.
Edited by: user8833740 on 15/08/2012 10:45 AM