Home > database > Batch update oracle more statements, fifo statements
Batch update oracle more statements, fifo statements
Time:10-12
To write a stored procedure, do first in first out, a great god please help see which to modify the Declare p_partno varchar (40); P_chuku number; P_ziku varchar (40); The begin P_partno:='H2020402D'; P_chuku:=35000; The update tblstock set ZS= Case when the select p_chuku - sum (ZS) from tblstock where ctime<=a.c time and partno=Amy polumbo artno and zhikucode=a.z hikucode) & lt;=0 Then 0 When (the select p_chuku - sum (ZS) from tblstock where ctimeA.Z S - (select p_chuku - sum (ZS) from tblstock where ctimeThe else a.Z S end The from tblstock a Where Amy polumbo artno=p_partno and a.z hikucode=p_ziku); end;
CodePudding user response:
This is bad. All baidu can't find the related information. What a great god give an opinion.
CodePudding user response:
Order can try the cycle
CodePudding user response:
Every time is unordered, outbound data inconsistency, according to the length of the storage time decreasing inventory. This statement in the SQL is feasible.
CodePudding user response:
If it is a single data to update, of course, is first in first out, if it is a batch of data, it is a batch processing, no order,
CodePudding user response:
If a goods inventory quantity is not enough, need to be out of the next batch of inventory? Insufficient or the current stock, the rest of the next batch of goods
CodePudding user response:
And mean field to describe p_chuku - sum (ZS), is the outbound - total inventory quantity? Why the delivery - total inventory & lt;=0 then 0, shouldn't be total inventory - the delivery