![]() |
SQL-J Language Reference
|
Reference Manual |
EXECUTE STATEMENT statementExecutes stored prepared statements created with CREATE STATEMENT. EXECUTE STATEMENT locates the specified stored prepared statement and executes it (without recompiling if possible). The statement returns the same ResultSet or update counts that it would if it were prepared directly. If the statement has been invalidated, it is automatically recompiled upon execution, and the new execution information is updated in the relevant system tables. Syntax
EXECUTE STATEMENT StatementName A SingleRowResultSet is a query that returns a single row, usually a VALUES expression or a SELECT. If used, the SingleRowResultSet supplies the parameters for the execution of the statement. See Supplying Parameters. NOTE: Avoid using stored prepared statements for positioned updates and deletes. They are useful only if the cursor that the stored prepared statement uses to position itself exists at the time the stored prepared statement is created and will exist at the time the stored prepared statement is executed, a situation that will probably never occur! Working with EXECUTE STATEMENT in JDBCWithin a Java program, you can execute a stored prepared statement using the EXECUTE STATEMENT statement in one of the following ways:
Supplying ParametersThere are two different ways to pass parameters to an EXECUTE STATEMENT statement:
NOTE: The SQL-J statement that provides the SingleRowResultSet has its own compilation and execution costs, so it is more costly than explicitly setting parameter values. EXECUTE STATEMENT Examples// Execute a prepared statement and supply paramters via JDBC PreparedStatement getDirectFlights = conn.prepareStatement(
-- Execute a prepared statement using parameters passed
-- Execute a prepared statement using parameters from |
|
![]() Cloudscape Version 3.6 For information about Cloudscape technical support, go to: www.cloudscape.com/support/.Copyright © 1998, 1999, 2000 Informix Software, Inc. All rights reserved. |