connect

Establishes a database connection.

Available in:

Apps (win) Apps (char) Reportwriter RPC Standalone PL
X X X X X

Syntax

void connect(id[,connect-string])
int          id
string       connect-string

Description

Establishes a connection to a database with the specified id, using the specified connect-string. If the function is successful, the connection becomes the active database.
id identifies the connection.

connect-string (optional) specifies the connect string to use for the database connection. If no connect-string is specified, then previously established connection identified by id becomes the active connection. If the connect-string value is NULL, then the connection identified by id, if any, is released.

Notes

The VORTEX Installation and Operations Manual details the connect string syntax.

Example

Displays a list from an Rdb database based on data from an Oracle database:
{
connect(0,"oracle:niklas/back");
connect(1,"rdb:salary_data");
.
.
connect(0);
L1 = list_open("SELECT name FROM staff",1000,"Staff");
list_view(L1,0);
connect(1);
L2 = list_open("SELECT sal FROM personnel "
               "WHERE name = &/list_curr(L1,0)/",1,"Salary");
.
.
}