PreviousNextIndex

LDBNAME function

Returns the logical name of a database that is currently connected.

Syntax

LDBNAME 
  ( 
    {   integer-expression 
      | logical-name 
      | alias 
      | BUFFER bufname 
    } 
  ) 

integer-expression
logical-name or alias
BUFFER bufname
Example

This procedure disconnects all currently connected databases. After a database is disconnected, the connected databases are renumbered to reflect the change. For example, if databases 1, 2, 3, and 4, are connected and the procedure disconnects database 3, database 4 becomes database 3.

r-ldbnm.p
DO WHILE LDBNAME(1) <> ? : /* the parameter. is the number 1 */ 
  DISCONNECT VALUE(LDBNAME(1)). 
END. 

Note

To determine if a particular name is an ALIAS or a logical database name, use the following procedure:

r-tstnm.p
DEFINE VARIABLE testnm AS CHARACTER NO-UNDO. 
SET testnm. 
IF LDBNAME(testnm) = testnm THEN  
  MESSAGE testnm "is a true logical database name.". 
ELSE IF LDBNAME(testnm) = ? THEN  
  MESSAGE testnm "is not the name or alias of any connected database.". 
ELSE  
  MESSAGE testnm "is an ALIAS for database " LDBNAME(testnm). 

See also

CONNECT statement, CONNECTED function, CREATE ALIAS statement, DBCODEPAGE function, DBCOLLATION function, DBRESTRICTIONS function, DBTYPE function, DELETE ALIAS statement, DISCONNECT statement, FRAME-DB function, NUM-DBS function, PDBNAME function


OpenEdge Release 10.2B
Copyright © 2009 Progress Software Corporation
PreviousNextIndex