Advertisement
jbonanno

Total purchase = host variable

Jul 11th, 2017
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PL/SQL 0.33 KB | None | 0 0
  1. VARIABLE  g_purchase_num NUMBER(3)
  2.  
  3. BEGIN
  4. g_purchase_num := 500;
  5. END
  6.  
  7. DECLARE
  8. lv_rating CHAR (4);
  9. BEGIN
  10. IF :g_purchase_num > 200 THEN
  11. lv_rating  := ‘HIGH’;
  12. ELSEIF :g_purchase_num < 200 AND  :g_purchase_num > 100 THEN
  13. lv_rating  := ‘MID’;
  14. ELSE
  15. lv_rating  := ‘LOW’;
  16. END IF;
  17. DBMS_OUTPUT.PUT_LINE(lv_rating);
  18. END;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement