amount
/* Start main block */ DECLARE order_id NUMBER := 101; product_id VARCHAR2(4) := 'DOGGY'; amount NUMBER(9,2); BEGIN IF order_id > 100 AND dept_code = 'DOG' THEN amount := 100; ELSE amount := 50; END IF; END;
order_id
101
dept_code
DOG
pet_commission
pet_sales
500
IF pet_sales < 100 THEN pet_commission := (pet_sales * 10 / 100); ELSIF pet_sales < 200 THEN pet_commission := (pet_sales * 20 / 100); ELSIF pet_sales < 300 THEN pet_commission := (pet_sales * 30 / 100); ELSE pet_commission := (pet_sales * 50 / 100); END IF
300
ELSE
IF
DECLARE v_start_sales NUMBER := 2; v_end_sales NUMBER := 100; BEGIN FOR i IN v_start_sales..v_end_sales LOOP INSERT INTO messages(msgid) VALUES v_start_sales; END LOOP; END;
FOR ... LOOP