Progress
Programming
Handbook


Progress Database Connection Functions

Table 9–2 lists the Progress functions that allow you to test database connections, get information on connected databases, and get information on the types of databases that you can access.

Table 9–2: Progress Database Functions 
Progress Function
Description
CONNECTED
Tests whether a given database is connected.
DATASERVERS
Returns a character string containing a list of database types supported by the installed Progress product. For example, “Progress,ORACLE.”
DBTYPE
Returns the database type of a currently connected database. For example “Progress,” “ORACLE,” etc.
DBRESTRICTIONS
Returns a character string that describes the Progress features that are not supported for a particular database. For example, if the database is an ORACLE database, the return string is: “LAST,PREV,RECID,SETUSERID”.
DBVERSION
Returns a “7” if a connected database is a Version 7 database and an “8” if it is a Version 8 database. For non-Progress databases, you see the appropriate version number of your database.
FRAME–DB
Returns a character string that contains the logical name of the database for the field in which the cursor was last positioned for input.
NUM–DBS
Returns the number of connected databases.
LDBNAME
Returns the logical name of a currently connected database.
PDBNAME
Returns the physical name of a currently connected database.
SDBNAME
Returns the logical name of a schema holder for a database.

Some of these functions take arguments; for more information on these functions, see the Progress Language Reference .

Use these functions to perform various tasks related to connection, such as determining connection status. The following procedure displays a status report for all connected databases:

p-infor.p
DEFINE VARIABLE x AS INTEGER FORMAT "99". 
DO x = 1 TO NUM-DBS WITH DOWN: 
  DISPLAY PDBNAME(x) LABEL "Physical Database"  
    LDBNAME(x) LABEL "Logical Name" 
    DBTYPE(x) LABEL "Database Type"  
    DBRESTRICTIONS(x) LABEL "Restrictions" 
    SDBNAME(LDBNAME(x)) LABEL "Schema Holder DB". 
END. 


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095