Hands On 2.txt - 2.1 DECLARE lv_test_date DATE:='10-DEC-12 lv_test_num CONSTANT NUMBER(3:= 10 lv_test_txt VARCHAR2(10 BEGIN

Hands On 2.txt - 2.1 DECLARE lv_test_date DATE:='10-DEC-12...

This preview shows page 1 - 3 out of 4 pages.

2.1 DECLARE lv_test_date DATE := '10-DEC-12'; lv_test_num CONSTANT NUMBER (3) := 10; lv_test_txt VARCHAR2(10); BEGIN DBMS_OUTPUT.PUT_LINE(lv_test_date); DBMS_OUTPUT.PUT_LINE(lv_test_num); DBMS_OUTPUT.PUT_LINE(lv_test_txt); END; 2.3 DECLARE lv_test_total NUMBER(5,2); BEGIN lv_test_total := 350; IF lv_test_total <= 100 THEN DBMS_OUTPUT.PUT_LINE ('LOW'); ELSIF lv_test_total >= 201 THEN DBMS_OUTPUT.PUT_LINE ('HIGH'); ELSE DBMS_OUTPUT.PUT_LINE ('MID'); END IF; END; 2.4 DECLARE lv_test_total NUMBER(5,2):= 99; BEGIN CASE WHEN lv_test_total <= 100 THEN DBMS_OUTPUT.PUT_LINE ('LOW'); WHEN lv_test_total >= 201 THEN DBMS_OUTPUT.PUT_LINE ('HIGH'); ELSE DBMS_OUTPUT.PUT_LINE ('MID'); END CASE; END; 2.5 DECLARE lv_acct_balance NUMBER(5,2):=125; lv_pmt_rcvd NUMBER(5,2):= 75; lv_rmg_balance BOOLEAN:= (lv_acct_balance - lv_pmt_rcvd) > 0; BEGIN IF lv_rmg_balance = TRUE THEN DBMS_OUTPUT.PUT_LINE('TRUE'); ELSE DBMS_OUTPUT.PUT_LINE('FALSE'); END IF; END; 2.6 DECLARE lv_total_amount NUMBER(10,2):=550; lv_price NUMBER (10,2):=55; lv_item_buy integer;
lv_money_spend INTEGER :=0; lv_money_left NUMBER(10); BEGIN lv_item_buy:=(lv_total_amount/lv_price); for i IN 1..lv_item_buy LOOP lv_money_spend:=lv_money_spend+lv_price; END LOOP;

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture