Oracle8i Distributed Database Systems Release 8.1.5 A67784-01 |
|
This appendix describes the procedures and functions in the package DBMS_HS_PASSTHROUGH for pass-through SQL of Heterogeneous Services. See Chapter 7, "Application Development with Heterogeneous Services" for more information on how to use this package.
Referenced in this appendix are:
To bind an "IN" variable positionally with a PL/SQL program variable. See Chapter 7, "Application Development with Heterogeneous Services" on how to bind variables.
PROCEDURE BIND_VARIABLE (c IN BINARY_INTEGER NOT NULL, pos IN BINARY_INTEGER NOT NULL, val IN <dty> [,name IN VARCHAR2])
Where <dty> is one of
To bind RAW variables use the procedure DBMS_HS_PASSTHROUGH.BIND_VARIABLE_RAW
Purity level defined: WNDS, RNDS
DBMS_HS_PASSTHROUGH.OPEN_CURSOR DBMS_HS_PASSTHROUGH.PARSE DBMS_HS_PASSTHROUGH.BIND_OUT_VARIABLE DBMS_HS_PASSTHROUGH.BIND_VARIABLE_RAW
To bind IN variables of type RAW.
PROCEDURE BIND_VARIABLE_RAW (c IN BINARY_INTEGER NOT NULL, pos IN BINARY_INTEGER NOT NULL, val IN RAW [,name IN VARCHAR2])
Purity level defined : WNDS, RNDS
DBMS_HS_PASSTHROUGH.OPEN_CURSOR DBMS_HS_PASSTHROUGH.PARSE DBMS_HS_PASSTHROUGH.BIND_VARIABLE DBMS_HS_PASSTHROUGH.BIND_OUT_VARIABLE
To bind an OUT variable with a PL/SQL program variable. See Chapter 7, "Application Development with Heterogeneous Services" for more information on binding OUT parameters.
PROCEDURE BIND_OUT_VARIABLE c IN BINARY_INTEGER NOT NULL, pos IN BINARY_INTEGER NOT NULL, val OUT <dty>, [,name IN VARCHAR2])
Where <dty> is one of
For binding OUT variables of datatype RAW, see BIND_OUT_VARIABLE_RAW
Purity level defined : WNDS, RNDS
DBMS_HS_PASSTHROUGH.OPEN_CURSOR DBMS_HS_PASSTHROUGH.PARSE DBMS_HS_PASSTHROUGH.BIND_OUT_VARIABLE_RAW DBMS_HS_PASSTHROUGH.BIND_VARIABLE DBMS_HS_PASSTHROUGH.BIND_VARIABLE_RAW DBMS_HS_PASSTHROUGH.GET_VALUE
To bind an OUT variable of datatype RAW with a PL/SQL program variable. See Chapter 7, "Application Development with Heterogeneous Services" for more information on binding OUT parameters.
PROCEDURE BIND_OUT_VARIABLE c IN BINARY_INTEGER NOT NULL, pos IN BINARY_INTEGER NOT NULL, val OUT RAW, ,name IN VARCHAR2])
Purity level defined : WNDS, RNDS
DBMS_HS_PASSTHROUGH.OPEN_CURSOR DBMS_HS_PASSTHROUGH.PARSE DBMS_HS_PASSTHROUGH.BIND_OUT_VARIABLE DBMS_HS_PASSTHROUGH.BIND_VARIABLE DBMS_HS_PASSTHROUGH.BIND_VARIABLE_RAW DBMS_HS_PASSTHROUGH.GET_VALUE
To bind IN OUT bind variables. See Chapter 7, "Application Development with Heterogeneous Services" for more information on binding IN OUT parameters.
PROCEDURE BIND_INOUT_VARIABLE c IN BINARY_INTEGER NOT NULL, pos IN BINARY_INTEGER NOT NULL, val IN OUT <dty>, ,name IN VARCHAR2]
Where <dty> is one of
For binding IN OUT variables of datatype RAW see BIND_INOUT_VARIABLE_RAW.
Purity level defined : WNDS, RNDS
DBMS_HS_PASSTHROUGH.OPEN_CURSOR DBMS_HS_PASSTHROUGH.PARSE DBMS_HS_PASSTHROUGH.BIND_INOUT_VARIABLE_RAW DBMS_HS_PASSTHROUGH.BIND_OUT_VARIABLE DBMS_HS_PASSTHROUGH.BIND_OUT_VARIABLE_RAW DBMS_HS_PASSTHROUGH.BIND_VARIABLE DBMS_HS_PASSTHROUGH.BIND_VARIABLE_RAW DBMS_HS_PASSTHROUGH.GET_VALUE
To bind IN OUT bind variables of datatype RAW. See Chapter 7, "Application Development with Heterogeneous Services" for more information on binding IN OUT parameters.
PROCEDURE BIND_INOUT_VARIABLE c IN BINARY_INTEGER NOT NULL, pos IN BINARY_INTEGER NOT NULL, val IN OUT RAW, [,name IN VARCHAR2]);
Purity level defined : WNDS, RNDS
DBMS_HS_PASSTHROUGH.OPEN_CURSOR DBMS_HS_PASSTHROUGH.PARSE DBMS_HS_PASSTHROUGH.BIND_INOUT_VARIABLE DBMS_HS_PASSTHROUGH.BIND_OUT_VARIABLE DBMS_HS_PASSTHROUGH.BIND_OUT_VARIABLE_RAW, DBMS_HS_PASSTHROUGH.BIND_VARIABLE DBMS_HS_PASSTHROUGH.BIND_VARIABLE_RAW DBMS_HS_PASSTHROUGH.GET_VALUE
This function closes the cursor and releases associated memory after the SQL statement has been executed at the non-Oracle system. If the cursor was not open, the operation is a "no operation".
PROCEDURE CLOSE_CURSOR (c IN BINARY_INTEGER NOT NULL);
Parameter | Description |
---|---|
c |
Cursor to be released. |
Exception | Description |
---|---|
ORA-28555 |
A NULL value was passed for a NOT NULL parameter. |
Purity level defined : WNDS, RNDS
DBMS_HS_PASSTHROUGH.OPEN_CURSOR
This function executes a SQL statement immediately. Any valid SQL command except SELECT can be executed immediately. The statement must not contain any bind variables. The statement is passed in as a VARCHAR2 in the argument. Internally the SQL statement is executed using the PASSTHROUGH SQL protocol sequence of OPEN_CURSOR, PARSE, EXECUTE_NON_QUERY, CLOSE_CURSOR.
FUNCTION EXECUTE_IMMEDIATE ( S IN VARCHAR2 NOT NULL ) RETURN BINARY_INTEGER;
Parameter | Description |
---|---|
s |
VARCHAR2 variable with the statement to be executed immediately. |
The number of rows affected by the execution of the SQL statement.
Exception | Description |
---|---|
ORA-28544 |
Max open cursors. |
ORA-28551 |
SQL statement is invalid. |
ORA-28555 |
A NULL value was passed for a NOT NULL parameter. |
Purity level defined : NONE
DBMS_HS_PASSTHROUGH.OPEN_CURSOR
DBMS_HS_PASSTHROUGH.PARSE
DBMS_HS_PASSTHROUGH.EXECUTE_NON_QUERY
DBMS_HS_PASSTHROUGH.CLOSE_CURSOR
This function executes a SQL statement. The SQL statement cannot be a SELECT statement. A cursor has to be open and the SQL statement has to be parsed before the SQL statement can be executed.
FUNCTION EXECUTE_NON_QUERY (c IN BINARY_INTEGER NOT NULL) RETURN BINARY_INTEGER
Parameter | Description |
---|---|
c |
Cursor associated with the pass-through SQL statement. Cursor must be opened and parsed, using the routines OPEN_CURSOR and PARSE respectively. |
The number of rows affected by the SQL statement in the non-Oracle system
Purity level defined : NONE
DBMS_HS_PASSTHROUGH.OPEN_CURSOR DBMS_HS_PASSTHROUGH.PARSE
To fetch rows from a result set. The result set is defined with a SQL SELECT statement. When there are no more rows to be fetched, the exception NO_DATA_FOUND is raised. Before the rows can be fetched, a cursor has to be opened, and the SQL statement has to be parsed.
FUNCTION FETCH_ROW (c IN BINARY_INTEGER NOT NULL [,first IN BOOLEAN]) RETURN BINARY_INTEGER;
The returns the number of rows fetched. The function will return "0" if the last row was already fetched.
Purity level defined : WNDS
DBMS_HS_PASSTHROUGH.OPEN_CURSOR DBMS_HS_PASSTHROUGH.PARSE
This procedure has two purposes:
PROCEDURE GET_VALUE (c IN BINARY_INTEGER NOT NULL, pos IN BINARY_INTEGER NOT NULL, val OUT <dty>);
Where <dty> is one of
For retrieving values of datatype RAW, see GET_VALUE_RAW.
Purity level defined : WNDS
DBMS_HS_PASSTHROUGH.OPEN_CURSOR DBMS_HS_PASSTHROUGH.PARSE
DBMS_HS_PASSTHROUGH.FETCH_ROW DBMS_HS_PASSTHROUGH.GET_VALUE_RAW DBMS_HS_PASSTHROUGH.BIND_OUT_VARIABLE DBMS_HS_PASSTHROUGH.BIND_OUT_VARIABLE_RAW DBMS_HS_PASSTHROUGH.BIND_INOUT_VARIABLE DBMS_HS_PASSTHROUGH.BIND_INOUT_VARIABLE_RAW
Similar to GET_VALUE, but for datatype RAW.
PROCEDURE GET_VALUE_RAW (c IN BINARY_INTEGER NOT NULL, pos IN BINARY_INTEGER NOT NULL, val OUT RAW);
Purity level defined : WNDS
DBMS_HS_PASSTHROUGH.OPEN_CURSOR DBMS_HS_PASSTHROUGH.PARSE
DBMS_HS_PASSTHROUGH.FETCH_ROW DBMS_HS_PASSTHROUGH.GET_VALUE DBMS_HS_PASSTHROUGH.BIND_OUT_VARIABLE DBMS_HS_PASSTHROUGH.BIND_OUT_VARIABLE_RAW DBMS_HS_PASSTHROUGH.BIND_INOUT_VARIABLE DBMS_HS_PASSTHROUGH.BIND_INOUT_VARIABLE_RAW
To open a cursor for executing a pass-through SQL statement at the non-Oracle system. This function must be called for any type of SQL statement The function returns a cursor, which must be used in subsequent calls. This call allocates memory. To deallocate the associated memory, you call the procedure DBMS_HS_PASSTHROUGH.CLOSE_CURSOR.
FUNCTION OPEN_CURSOR RETURN BINARY_INTEGER;
The cursor to be used on subsequent procedure and function calls.
Exception | Description |
---|---|
ORA-28554 |
Maximum number of open cursor has been exceeded. Increase Heterogeneous Services' OPEN_CURSORS initialization parameter. |
Purity level defined : WNDS, RNDS
DBMS_HS_PASSTHROUGH.CLOSE_CURSOR
To parse SQL statement at non-Oracle system.
PROCEDURE GET_VALUE_RAW (c IN BINARY_INTEGER NOT NULL, stmt IN VARCHAR2 NOT NULL);
Parameter | Description |
c |
Cursor associated with the pass-through SQL statement. Cursor must be opened using function OPEN_CURSOR. |
stmt |
Statement to be parsed. |
Exception | Description |
---|---|
ORA-28550 |
The cursor passed is invalid. |
ORA-28551 |
SQL statement is illegal. |
ORA-28555 |
A NULL value was passed for a NOT NULL parameter. |
Purity level defined : WNDS, RNDS
DBMS_HS_PASSTHROUGH.OPEN_CURSOR DBMS_HS_PASSTHROUGH.PARSE
DBMS_HS_PASSTHROUGH.FETCH_ROW DBMS_HS_PASSTHROUGH.GET_VALUE DBMS_HS_PASSTHROUGH.BIND_OUT_VARIABLE DBMS_HS_PASSTHROUGH.BIND_OUT_VARIABLE_RAW DBMS_HS_PASSTHROUGH.BIND_INOUT_VARIABLE DBMS_HS_PASSTHROUGH.BIND_INOUT_VARIABLE_RAW