Advertisement
tko_pb

tpb_hitung_saldo_awal function

Jan 24th, 2020
609
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. create function tpb_hitung_saldo_awal (transaction_id integer, product_id integer, locator_id integer)
  2.     returns integer  as $func$
  3. begin
  4.     return  (
  5.     select sum(movementqty) into qty from m_transaction mt  
  6.     where m_transaction_id <= transaction_id
  7.         and m_product_id = product_id
  8.         and m_locator_id  = locator_id
  9.     );
  10. end $func$
  11. LANGUAGE PLPGSQL;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement