EXEC_SQL.OPEN_CONNECTION
built-in functionThis function opens a connection and assigns it a connection handle.
FUNCTION EXEC_SQL.OPEN_CONNECTION
(username IN VARCHAR2,
password IN VARCHAR2,
datasource IN VARCHAR2)
RETURN EXEC_SQL.ConnType;
Parameter |
Description |
|
A string specifying the user name used to connect to the database. |
|
A string specifying the password for the user name. |
|
Either a string specifying the SQLNet alias or the OCA
connection starting with |
A handle to the new database connection.
PROCEDURE getData IS
-- a connection handle must have a datatype of EXEC_SQL.CONNTYPE
connection_id EXEC_SQL.CONNTYPE;
...
BEGIN
-- a connection string is typically of the form 'username/password@datasource'
connection_id := EXEC_SQL.OPEN_CONNECTION('connection_string');
...
END;
About the EXEC_SQL
built-in package
Copyright © 1984, 2005, Oracle. All rights reserved.