SQL*Plus User's Guide and Reference

Contents Index Home Previous Next

EXECUTE

Purpose

Executes a single PL/SQL statement. The EXECUTE command is often useful when you want to execute a PL/SQL statement that references a stored procedure. For more information on PL/SQL, see your PL/SQL User's Guide and Reference.

Syntax

EXEC[UTE] statement

Terms and Clauses

Refer to the following for a description of the term or clause:

statement Represents a PL/SQL statement.
Usage Notes

If your EXECUTE command cannot fit on one line because of the PL/SQL statement, use the SQL*Plus continuation character (a hyphen) as shown in the example below.

The length of the command and the PL/SQL statement cannot exceed the length defined by SET LINESIZE.

Examples

The following EXECUTE command assigns a value to a bind variable:

SQL> EXECUTE :n := 1

The following EXECUTE command runs a PL/SQL statement that references a stored procedure:

SQL> EXECUTE -
:ID := EMP_MANAGEMENT.HIRE('BLAKE','MANAGER','KING',2990,'SALES')

Note that the value returned by the stored procedure is being placed in a bind variable, :ID. For information on how to create a bind variable, see the VARIABLE command in this chapter.


Contents Index Home Previous Next