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

CodePudding user response:

refer to 6th floor js14982 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 - is the delivery

Is that the multiple batch has the same kind of material, in the current material inventory is not deducting the outbound number, the deduction is zero. Continue to deduct a batch. Until all the outbound number out to the end.

CodePudding user response:

refer to 7th floor jason19810924 response:
Quote: refer to the sixth floor js14982 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 - is the delivery

Is that the multiple batch has the same kind of material, in the current material inventory is not deducting the outbound number, the deduction is zero. Continue to deduct a batch. Until all the outbound number out to the end.


Once found only the oldest one batch, determine whether conform to the requirements of the inventory, conform to the outbound, if does not conform to, less than the number calculated, recycling continue to determine the next batch, this line not line?

CodePudding user response:

refer to the eighth floor js14982 response:
Quote: refer to 7th floor jason19810924 response:

Quote: refer to the sixth floor js14982 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 - is the delivery

Is that the multiple batch has the same kind of material, in the current material inventory is not deducting the outbound number, the deduction is zero. Continue to deduct a batch. Until all the outbound number out to the end.


Once found only the oldest one batch, determine whether conform to the requirements of the inventory, conform to the outbound, if does not conform to, less than the number calculated, recycling continue to determine the next batch, this line not line?

In front of the logic is right, but if the inventory shortage. Suggest insufficient inventory directly out of the loop.
  • Related