db.open-oci9i

function

Library: Database access (OMDB)
Import : omdb.xmd

Returns: A db.database object for the opened database connection.


Declaration
export external database function 
   open-oci9i          value string database-name
                  user value string user-name optional initial { "" }
              password value string password  optional initial { "" }

      

Argument definitions

database-name
is the name of the Oracle database to which you want to connect.
user-name
is the user name that will be supplied to the database when the connection is made.
password
is the password that will be supplied to the database when the connection is made.


Purpose

Use db.open-oci9i to create a connection to an Oracle database using an Oracle 9i or higher client installation. Connectivity using OCI9i is supported on SunOS 5.8 only. The function returns an instance of type db.database.

Requirements

You must have an Oracle 9i (or higher) client installed on your machine, with SQL*NET configured to locate your Oracle server.

database-name must:

else external exception OMDB501 is thrown.

user-name and password are optional with default values of an empty string. Check what access requirements are needed for the specified database.

Usage Notes

You must have declared a shelf of type db.database to reuse a database connection in other OMDB functions.

This function will throw external exception OMDB501 if there are any OCI errors. The exception will include any error numbers and descriptive text generated by the OCI. Consult your Oracle documentation for further details on the error condition.

Example

Create a connection to an Oracle database named DatabaseDemo via OCI using username charley and password chaplin. This connection can be reused in other OMDB functions.

  import "omdb.xmd" prefixed by db.
  
  process
     local db.database d
  
     set d to db.open-oci9i "DatabaseDemo" user "charley" password "chaplin"