Oracle Server Manager User's Guide

Contents Index Home Previous Next

EXECUTE

Purpose

Executes a one-line PL/SQL statement.

Prerequisites

You must be currently connected to a database. You must also have privileges to use any stored procedures, packages, package variables, and functions referenced with this command.

Syntax

EXECUTE command ::=

Usage Notes

You can execute only one line of PL/SQL code with the EXECUTE command. If you wish to execute a PL/SQL block with many lines, you must use the format:

BEGIN 
	[PL/SQL BLOCK] 
END; 

You can reference any command line mode bind variables in PL/SQL statements by preceding the variable name with a colon. The example below illustrates the use of bind variables with the VARIABLE, EXECUTE, and PRINT commands.

Example

VARIABLE balance NUMBER

EXECUTE :balance := get_balance(34056) 
PRINT balance 
BALANCE 
---------- 
4678.24 


Contents Index Home Previous Next