Oracle7 Server SQL Reference

Contents Index Home Previous Next

EXECUTE (Prepared SQL Statements and PL/SQL Blocks) (Embedded SQL)

Purpose

To execute a DELETE, INSERT, or UPDATE statement or a PL/SQL block that has been previously prepared with an embedded SQL PREPARE statement.

Prerequisites

You must first prepare the SQL statement or PL/SQL block with an embedded SQL PREPARE statement.

Syntax

Keywords and Parameters

FOR :host_integer

limits the number of times the statement is executed when the USING clause contains array host variables If you omit this clause, Oracle7 executes the statement once for each component of the smallest array.

statement_name block_name

identifies the SQL statement or PL/SQL block to be executed. The SQL statement can only be a DELETE, INSERT, or UPDATE statement. You must use the embedded SQL PREPARE command to associate this identifier with the statement.

USING

specifies a list of host variables with optional indicator variables that Oracle7 substitutes as input variables into the statement to be executed. The host and indicator variables must be either all scalars or all arrays.

Usage Notes

For more information on this command, see the Programmer's Guide to the Oracle Precompilers.

Example

This example illustrates the use of the EXECUTE statement in a Pro*C embedded SQL program:

EXEC SQL PREPARE my_statement 
	FROM :my_string; 
EXEC SQL EXECUTE my_statement
 	USING :my_var; 

Related Topics

DECLARE DATABASE command [*] PREPARE command [*]


Contents Index Home Previous Next