You can type execute procedure (short term EXEC)
like EXEC procedure_name;
-- Write a Plsql procedure that accept employee_id from user
and print his/her salary .
CREATE OR REPLACE PROCEDURE SALPRO(P_ID IN NUMBER)
IS
V_SAL NUMBER;
BEGIN
SELECT SALARY INTO V_SAL FROM EMPLOYEES WHERE EMPLOYEE_ID=P_ID;
DBMS_OUTPUT.PUT_LINE('The salary is earn by this employee is'||V_SAL);
END SALPRO;
/
SQL> execute salpro(100);
PL/SQL procedure successfully completed.
SQL> set serveroutput on
SQL> execute salpro(100);
The salary is earn by this employee is 16000
To view Procedure In Oracle You can try this Command.
SELECT * FROM USER_OBJECTS
WHERE OBJECT_TYPE='PROCEDURE';
SELECT *
FROM USER_PROCEDURES;
like EXEC procedure_name;
-- Write a Plsql procedure that accept employee_id from user
and print his/her salary .
CREATE OR REPLACE PROCEDURE SALPRO(P_ID IN NUMBER)
IS
V_SAL NUMBER;
BEGIN
SELECT SALARY INTO V_SAL FROM EMPLOYEES WHERE EMPLOYEE_ID=P_ID;
DBMS_OUTPUT.PUT_LINE('The salary is earn by this employee is'||V_SAL);
END SALPRO;
/
SQL> execute salpro(100);
PL/SQL procedure successfully completed.
SQL> set serveroutput on
SQL> execute salpro(100);
The salary is earn by this employee is 16000
To view Procedure In Oracle You can try this Command.
SELECT * FROM USER_OBJECTS
WHERE OBJECT_TYPE='PROCEDURE';
SELECT *
FROM USER_PROCEDURES;
0 comments:
Post a Comment