This content has been marked as final. Show 6 replies
And what is the event to update the rows? What values do you want to updated?
btw. You should rethink your datamodel, as at least one column is redundant, as its value can be derived from the other values.
any event, for example can be when i press button or pre-insert, but the most important i what to know how write the code which will do that
I still don't understand what should exactly happen. There is some event, and then? Is a new record inserted in your table? Or have some of the rows to be updated? And what is your sort-criteria? Do you have some date-column or some transaction-id?
this is database items with these numbers
when i insert new row it should give me the result of calculation of first row then balance = the total of first row that is mean balance will be like that
and when i insert or update the item add = 20
tjhat is mean total = 220
and the new row will be
and so on
Edited by: yasser_egypt on Nov 12, 2012 12:05 AM
You will have to read all rows from the starting row and process each one by one, e.g. in a loop.
if you are updating the another stock table then use the below code in PRE-INSERT tigger when ever you are updating or inserting a row this will update accordingly.
UPDATE STOCK_TABLE SET STOCK_TABLE.QTY=NVL(QTY,0)+ NVL(:BLOCK.QTY,0) WHERE STOCK_TABLE.ITEM_NO=:BLOCK.ITEM_NO;