DB_CONNECT Function

Connects PV‑WAVE to a database.

Usage

dbms_id = DB_CONNECT( 'dbms', 'login' )

Input Parameters

dbms—A string specifying the database management system (DBMS).

login—A string containing the commands used to log in to the database. The string can contain the following elements:

user—The username of a user authorized to connect to the database.

password—The user’s database password.

node_name—The name of the workstation on which the DBMS is running. By default, this is the workstation you are logged onto.

db_name—The name of the database to connect to within the DBMS. By default this is the default database defined for your DBMS.

See the Discussion section below for more information on the login parameter.

Returned Value

dbms_id—An ID number (handle) representing the DBMS.

Keywords

None.

Discussion

The Oracle database management system is supported.

Note: The syntax of the login string may vary slightly depending on the type of DBMS you are using. See your DBMS documentation or database administrator for additional information on the login string syntax.

Tip: If you have trouble connecting to an Oracle database, it may be that environment variables are improperly set. If you cannot establish a connection to Oracle, first be sure that you can use sqlplus to access the database you want to connect to from the workstation on which PV‑WAVE is running. If this works you may have to set the ORACLE_HOME and ORACLE_SID environment variables. See your database administrator for information on setting these environment variables properly.

Example 1

This example shows the default connection, where the DBMS is ORACLE, and the username and password are given in the login string. In this case, it is assumed that the database is running on the workstation the user is currently logged onto, and the database the user wants to access is set up as the default database for the DBMS.

oracle_id = DB_CONNECT('ORACLE','scott/tiger')

Example 2

This example shows a login string that specifies:

the workstation (dbnode) running the DBMS and

the database (mydb) to connect to within the DBMS.

oracle_id = DB_CONNECT('ORACLE', 'scott/tiger@mydb')

See Also

DB_SQL,  DB_DISCONNECT

See the following related functions in the PV-WAVE Reference:

BUILD_TABLE Function GROUP_BY Function,  ORDER_BY Function,  QUERY_TABLE Function, UNIQUE Function