The EDB OCL Connector, version 13.1.4.2, is certified with OTL 4.0. To use OTL-supported data types and for other OTL-specific behavior, define the OTL environment variable (the value is not important) on the shell before running an OTL-based app. For example: You can export OTL=TRUE for conditional execution of scenarios that are related to OTL.
EDB OCL Connector is certified with the following OTL features:
Connect, disconnect, commit, and rollback using otl_connect.
Constant SQL statements (a SQL statement is constant if it doesn't have any bind variables) using the static function otl_cursor::direct_exec. It includes most DDL statements like CREATE TABLE and CREATE PROCEDURE/FUNCTION.
SQL statements with bind variable using otl_stream class. It includes most DML statements like SELECT, UPDATE, DELETE, INSERT, and PROCEDURE/FUNCTION calls.
Date/Time data types using otl_datetime.
Raw/Long Raw data types using otl_long_string.
Ref cursors using otl_refcur_stream.
Connect and log in
The following example initializes OCL and connects to a database using tnsnames.ora based connection string:
CREATE TABLE, INSERT, and SELECT
The following example uses otl_cursor::direct_exec to create a table and then insert a row in this table. You can then use otl_stream to retrieve the inserted row.
UPDATE
The following example uses bind parameters in an UPDATE statement:
Stored procedure
The following example creates a stored procedure using otl_cursor::direct_exec and then calls it using otl_stream:
Function
The following example creates a function using otl_cursor::direct_exec and then calls it using otl_stream:
Note
This example is using the emp table in the edb sample database.
REF CURSOR
The following example creates a package with a procedure that returns three ref cursors as OUT parameters and then calls it.
Note
This example is using the emp table in the edb sample database.