Try OpenEdge Now
skip to main content
Programming Interfaces
Data Management : Database Access : Logical database names
 

Logical database names

When you connect to a database, OpenEdge automatically assigns that database a default logical name for the current OpenEdge session. The default logical name consists of the physical database name without the .db file extension. For example, if you connect to a database with the physical name mydb1.db, the default logical database name is mydb1. OpenEdge uses the logical database name mydb1 to resolve database references, and stores it in the compiled r-code of any procedures that you compile that reference the mydb1.db database.
The Logical Database Name (–ld) connection parameter allows you to specify a logical database name other than the default.
The following example establishes the logical name firstdb for the physical database mydb1.db during the current OpenEdge session:
pro mydb1 -ld firstdb
When you develop and compile an application to run on the mydb1.db database, it is the logical name, not the physical name, that OpenEdge stores in the r-code. You must use the logical name firstdb in your procedures (.p) to reference the mydb1.db database.
Logical database names allow you to change physical databases without recompiling an application. To run a compiled application on a new physical database without recompiling, the new database must have identical structure and time stamp or Cyclic Redundancy Check (CRC) values for the tables accessed by the application and must be connected with the same logical name (or alias) used to compile the application. For example:
pro mydb2 -ld firstdb
The previous example establishes the logical name firstdb for a new physical database mydb2.db.
Note: OpenEdge does not allow you to run the OpenEdge Data Administration tool or character Data Dictionary against a database connected with the logical name DICTDB.
A database connection fails if the logical database name of the database that you connect to has the same logical name as an already connected database of the same database type (OpenEdge, ORACLE, etc.). If you try to do this, OpenEdge assumes that database is already connected and ignores the request.
For information about the characters allowed in the logical name, see OpenEdge Deployment: Startup Command and Parameter Reference.