CREATE OR REPLACE PROCEDURE ANNSAL(P_SAL IN NUMBER,P_ANNSAL OUT NUMBER)
IS
BEGIN
P_ANNSAL :=P_SAL*12;
END ANNSAL;
/
CREATE OR REPLACE PROCEDURE EMPSAL(P_ID IN NUMBER)
IS
V_SAL NUMBER;
V_ANNSAL NUMBER;
BEGIN
SELECT SALARY INTO V_SAL FROM EMPLOYEES WHERE EMPLOYEE_ID=P_ID;
ANNSAL(V_SAL,V_ANNSAL);
DBMS_OUTPUT.PUT_LINE('SALARY IS '||V_SAL||' AND ANNSAL IS '||V_ANNSAL);
END EMPSAL;
/
SHO ERR
EXECUTE EMPSAL(103)
SQL> EXECUTE EMPSAL(103);
SALARY IS 9000 AND ANNSAL IS 108000
PL/SQL procedure successfully completed.
IS
BEGIN
P_ANNSAL :=P_SAL*12;
END ANNSAL;
/
CREATE OR REPLACE PROCEDURE EMPSAL(P_ID IN NUMBER)
IS
V_SAL NUMBER;
V_ANNSAL NUMBER;
BEGIN
SELECT SALARY INTO V_SAL FROM EMPLOYEES WHERE EMPLOYEE_ID=P_ID;
ANNSAL(V_SAL,V_ANNSAL);
DBMS_OUTPUT.PUT_LINE('SALARY IS '||V_SAL||' AND ANNSAL IS '||V_ANNSAL);
END EMPSAL;
/
SHO ERR
EXECUTE EMPSAL(103)
SQL> EXECUTE EMPSAL(103);
SALARY IS 9000 AND ANNSAL IS 108000
PL/SQL procedure successfully completed.
0 comments:
Post a Comment