<<outer>>

DECLARE

 sal NUMBER(7,2) := 60000;

 comm NUMBER(7,2) := sal * 0.20;

 message VARCHAR2(255) := ' eligible for commission';

BEGIN

DECLARE

 sal NUMBER(7,2) := 50000;

 comm NUMBER(7,2) := 0;

 total_comp NUMBER(7,2) := sal + comm;

BEGIN

 message := 'CLERK not'||message;

 outer.comm := sal * 0.30;


 p(message); --> 1. CLERK not eligible for commission

 p(comm); --> 2. 0

 p(outer.comm); --> 3. 15000

END;


 message := 'SALESMAN and '||message;


         /*

          p(total_comm); --> 4. 에러, ORA-06550

         */


 p(comm); --> 5. 15000

 p(message); --> 6. SALESMAN and CLERK not eligible for commission

END;

/

+ Recent posts