sql - PLSQL - Triggers: Cannot modify a column which maps to a non key-preserved table -
What I'm anticipating to do when placed in an order, the amount to be sold in the inventory table is updated To use the trigger is the concession_sold table (an insert is used). I believe that I want to suck on PLSQL, so I'm not sure I'm going right about this. The error I am getting is:
SQL> Insert in concessions - 2 values (33, 104, '26-ap-09', 50); Line 1: Enter the discounted_solid * error in ORA-01779: One column can not be modified which maps to a non-key-protected tableMy code:
After creating or transforming the trigger LabX 5_1 after inserting the concessional_old for each row, update it again (List I, Concession Isc CS, concession in i.Inventory_id = c.inventory_id And c.concession_id = cs.concession_id), set quantity to I.quantity =: New.quantity; end if; End LabEx5_1; First of all, if you trigger "for each line" then you are required
does not work on the entire table, there is only one line, so select
from the list. Icantity, concession is where C I.inventory_id = c.inventory_id and c.concession_id = cs.concession_id
select i.quantity from the list I, quotes_sold cs, The concession should change to C where i.inventory_id = c.inventory_id and c.concession_id =: Second, the update should be something like this: Update Item List Set = Quantity: New Where inventory_id = (from the concession of inventory_id) C where concession_id =: new.concession_id); The trigger should look like this:
After converting or altering the trigger LabX 5_1 after inserting the concessional_old for each row, the update list Set the amount while inserting: = New.quantity where inventory_id = (select concent_id =: new.concession_id) from concession c; end if; End LabEx5_1;
Comments
Post a Comment