Quick Search:
CODE
Oracle PL/SQL Code Library
JOBS
Find Or Post Oracle Jobs
FORUM
Oracle Discussion & Chat
 The Oracle EXECUTE Procedure      [Return To Index] Jump to:  
  Looking for the original pages? (formerly called "Morgan's Library") You can find them here.

Term: EXECUTE

Definition:
EXECUTE is a built-in Oracle procedure which is used to run a statement and direct its output to a message buffer. Note that EXECUTE is a SQL* Plus command. It is similar to executing a statement in an anonymous PL/SQL block.

Example Usage:

The SQL command line statement below executes DBMS_OUTPUT.PUT_LINE to display '100'.

SQL> EXECUTE DBMS_OUTPUT.PUT_LINE(100);
100

PL/SQL procedure successfully completed.


The EXECUTE statement below runs the stored procedure 'P_GET_SAL' to get the salary of an employee from the EMPLOYEE table. Note that G_SAL is a bind variable used to capture the OUT parameter data of the procedure.

SQL> VAR G_SAL NUMBER;
SQL> EXECUTE P_GET_SAL(100,:G_SAL);

PL/SQL procedure successfully completed.

SQL> PRINT :G_SAL;
2300


Note that EXECUTE is an Object privilege. If a user BOB seeks to execute a procedure whose owner is JANE, then JANE must grant the execute privilege on the procedure to BOB. For example, to grant the EXECUTE privilege for the procedure 'SPECIAL_PROC' to BOB:

SQL> GRANT EXECUTE ON SPECIAL_PROC TO BOB;

Grant succeeded.


Related Links:
 
Home      :      Code Library      :      Sponsors      :      Privacy      :      Terms of Use      :      Contact Us 45 users online    © 2009 psoug.org
PSOUG LOGIN
Username: 
Password: 
Forgot your password?