DBTYPE function

Returns, as a character string, the database type of a currently connected database. This function returns one of the following strings: "MSS", "ORACLE", or "PROGRESS".

Syntax

DBTYPE ( integer-expression|logical-name|alias )
integer-expression
The sequence number of a database the ABL session is connected to. For example, DBTYPE(1) returns information on the first database the ABL session is connected to, DBTYPE(2) returns information on the second database the ABL session is connected to, etc. If you specify a sequence number that does not correspond to a database the ABL session is connected to, the DBTYPE function returns the Unknown value (?).
logical-name or alias
These forms of the DBTYPE function require a quoted character string or a character expression as a parameter. An unquoted character string is not permitted. If the parameter is an alias of a connected database or the logical name of a connected database, then the AVM returns the database type. Otherwise, it returns the Unknown value (?).

Example

This procedure displays the logical name and database type of all connected databases:

r-dbtype.p

DEFINE VARIABLE ix AS INTEGER NO-UNDO.

REPEAT ix = 1 TO NUM-DBS:
  DISPLAY LDBNAME(ix) DBTYPE(ix) FORMAT "x(40)".
END.

Note

You can reference the DBTYPE function within a preprocessor expression. For more information, see the &IF, &THEN, &ELSEIF, &ELSE, and &ENDIF preprocessor directives reference entry.

See also

ALIAS function, CONNECT statement, CONNECTED function, CREATE ALIAS statement, CREATE CALL statement, DATASERVERS function, DBCODEPAGE function, DBCOLLATION function, DBRESTRICTIONS function, DBVERSION function, DELETE ALIAS statement, DISCONNECT statement, FRAME-DB function, LDBNAME function, NUM-DBS function, PDBNAME function, SDBNAME function