base.SqlHandle.open

Opens the SQL handle (SELECT or INSERT cursor).

Syntax

open()

Usage

Call the open() method to execute the prepared SQL statement, and open the result set cursor or insert cursor.

The SQL statement must have been prepared with a prepare() call.

If the SQL statement contains ? parameter placeholders, use a setParameter() call for each parameter value:
  • For a statement with a result set (SELECT), values must be provided before the open() call.
  • For an insert cursor, values must be provided after the open() call and before each put() call.

As with standard Genero SQL instructions, SQL errors can be trapped with WHENEVER ERROR or TRY / CATCH blocks and by testing sqlca.sqlcode.

Example

DEFINE sh base.SqlHandle
...
CALL sh.open()

For a complete example, see Example 2: SqlHandle with result set SQL.