Oracle8i Supplied Packages Reference Release 8.1.5 A68001-01 |
|
The pass-through SQL feature allows an application developer to send a statement directly to a non-Oracle system without being interpreted by the Oracle server. This can be useful if the non-Oracle system allows for operations in statements for which there is no equivalent in Oracle.
You can run these statements directly at the non-Oracle system using the PL/SQL package DBMS_HS_PASSTHROUGH
. Any statement executed with this package is run in the same transaction as regular "transparent" SQL statements.
See Also:
For detailed information on Heterogeneous Services and on binding variables, see Oracle8i Distributed Database Systems. |
The DBMS_HS_PASSTHROUGH
package conceptually resides at the non-Oracle system. Procedures and functions in the package must be called by using the appropriate database link to the non-Oracle system.
Subprogram | Description |
---|---|
BIND_VARIABLE procedure |
Binds an |
BIND_VARIABLE_RAW procedure |
Binds |
BIND_OUT_VARIABLE procedure |
Binds an |
BIND_OUT_VARIABLE_RAW procedure |
Binds an |
BIND_INOUT_VARIABLE procedure |
Binds |
BIND_INOUT_VARIABLE_RAW procedure |
Binds |
CLOSE_CURSOR procedure |
Closes the cursor and releases associated memory after the SQL statement has been run at the non-Oracle system. |
EXECUTE_IMMEDIATE procedure |
Runs a (non- |
EXECUTE_NON_QUERY function |
Runs a (non- |
FETCH_ROW function |
Fetches rows from a query. |
GET_VALUE procedure |
Retrieves column value from |
GET_VALUE_RAW procedure |
Similar to |
OPEN_CURSOR function |
Opens a cursor for running a passthrough SQL statement at the non-Oracle system. |
PARSE procedure |
Parses SQL statement at non-Oracle system. |
This procedure binds an IN
variable positionally with a PL/SQL program variable.
DBMS_HS_PASSTHROUGH.BIND_VARIABLE ( c IN BINARY_INTEGER NOT NULL, pos IN BINARY_INTEGER NOT NULL, val IN <dty>, name IN VARCHAR2);
Where <dty>
is either DATE
, NUMBER
, or VARCHAR2
Purity level defined: WNDS, RNDS
This procedure binds IN
variables of type RAW
.
DBMS_HS_PASSTHROUGH.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
This procedure binds an OUT
variable with a PL/SQL program variable.
DBMS_HS_PASSTHROUGH.BIND_OUT_VARIABLE ( c IN BINARY_INTEGER NOT NULL, pos IN BINARY_INTEGER NOT NULL, val OUT <dty>, name IN VARCHAR2);
Where <dty>
is either DATE
, NUMBER
, or VARCHAR2
Purity level defined : WNDS, RNDS
This procedure binds an OUT
variable of datatype RAW
with a PL/SQL program variable.
DBMS_HS_PASSTHROUGH.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
This procedure binds IN
OUT
bind variables.
DBMS_HS_PASSTHROUGH.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 either DATE
, NUMBER
, or VARCHAR2
Purity level defined : WNDS, RNDS
This procedure binds IN
OUT
bind variables of datatype RAW
.
DBMS_HS_PASSTHROUGH.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
This function closes the cursor and releases associated memory after the SQL statement has been run at the non-Oracle system. If the cursor was not open, then the operation is a "no operation".
DBMS_HS_PASSTHROUGH.CLOSE_CURSOR ( c IN BINARY_INTEGER NOT NULL);
Parameter | Description |
---|---|
c |
Cursor to be released. |
Exception | Description |
---|---|
ORA-28555 |
A |
Purity level defined : WNDS, RNDS
This function runs a SQL statement immediately. Any valid SQL command except SELECT
can be run 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 run using the PASSTHROUGH
SQL protocol sequence of OPEN_CURSOR
, PARSE
, EXECUTE_NON_QUERY
, CLOSE_CURSOR
.
DBMS_HS_PASSTHROUGH.EXECUTE_IMMEDIATE ( S IN VARCHAR2 NOT NULL) RETURN BINARY_INTEGER;
Parameter | Description |
---|---|
s |
|
The number of rows affected by the execution of the SQL statement.
Exception | Description |
---|---|
ORA-28551 |
SQL statement is invalid. |
ORA-28544 |
Max open cursors. |
ORA-28555 |
A |
None
This function runs 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 run.
DBMS_HS_PASSTHROUGH.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 |
The number of rows affected by the SQL statement in the non-Oracle system
None
This function fetches 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.
DBMS_HS_PASSTHROUGH.FETCH_ROW ( c IN BINARY_INTEGER NOT NULL, first IN BOOLEAN) RETURN BINARY_INTEGER;
The returns the number of rows fetched. The function returns "0" if the last row was already fetched.
Purity level defined : WNDS
This procedure has two purposes:
SELECT
statements, after a row has been fetched.
OUT
bind values, after the SQL statement has been run.
DBMS_HS_PASSTHROUGH.GET_VALUE ( c IN BINARY_INTEGER NOT NULL, pos IN BINARY_INTEGER NOT NULL, val OUT <dty>);
Where <dty>
is either DATE
, NUMBER
, or VARCHAR2
Purity level defined : WNDS
This procedure is similar to GET_VALUE
, but for datatype RAW
.
DBMS_HS_PASSTHROUGH.GET_VALUE_RAW ( c IN BINARY_INTEGER NOT NULL, pos IN BINARY_INTEGER NOT NULL, val OUT RAW);
Purity level defined : WNDS
This function opens a cursor for running 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, call the procedure CLOSE_CURSOR
.
DBMS_HS_PASSTHROUGH.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' |
Purity level defined : WNDS, RNDS
This procedure parses SQL statement at non-Oracle system.
DBMS_HS_PASSTHROUGH.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 |
stmt |
Statement to be parsed. |
Exception | Description |
---|---|
ORA-28550 |
The cursor passed is invalid. |
ORA-28551 |
SQL statement is illegal. |
ORA-28555 |
A |
Purity level defined : WNDS, RNDS