Guest User

Untitled

a guest
Jan 16th, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. FOREACH v_recipient IN ARRAY recipients
  2. LOOP
  3. v_total := v_total + v_recipient.amount;
  4. INSERT INTO tmp_recipients(id, amount) VALUES(v_recipient.id, v_recipient.amount::numeric(10,2));
  5. END LOOP;
  6.  
  7. FOR v_recipient IN SELECT vr FROM unnest(recipients) x(vr)
  8. LOOP
  9. ....
  10. END LOOP;
Add Comment
Please, Sign In to add comment