Release 10.1A: OpenEdge Deployment:
Managing 4GL Applications

> ## Logical database names

> A logical database name is a database reference that represents the name of a connected physical database. OpenEdge uses the logical database name to resolve database references. When a procedure is compiled against a database, OpenEdge stores the logical database name in the procedure’s r-code. When a procedure executes, its database references must match the logical name of a connected database.

> A database has a logical name whenever it is connected. When you connect to a database, OpenEdge automatically assigns a default logical name for the current session. The default logical name consists of the physical database name without the `.d` `b` suffix. For example, if you connect to a database with the physical name `mydb1.db`, the default logical database name is `mydb1`. Alternatively, you can use the Logical Database Name (-ld) startup parameter to specify a logical database name other than the default.

> For example, to assign the logical name `firstdb` to the physical database `mydb1.db` using the PRO command, enter the command using the following syntax:

>     pro mydb1 -ld firstdb

> Logical database names allow you to run procedures on different physical databases without recompiling. To run a compiled procedure on a second physical database, the database must meet the following criteria:

> - It must have the identical structure (data definitions) and table time stamps as the database you compiled the procedure against. However, if you use CRC-based object code (the default), the database’s table time stamps do not affect the ability of the code to run on the database. The structure of the database must be the same. For more information about CRC-based object code, see Appendix B "R-code Features and Functions."

> - It must be connected with the same logical name as the database you compiled the procedure against.

> A database connection fails if the logical database name of the database that you are connecting has the same logical name as an already connected database. If you try to connect a database with a logical database name that matches the logical database name of an existing connected database of the same database type (OpenEdge RDBMS, ORACLE, etc.), OpenEdge assumes that database is connected and ignores the request.

> You can change a database’s logical name in a Progress 4GL procedure with the `CREATE ALIAS` statement. For more information about logical and physical database names and aliases, and the `CREATE ALIAS` statement, see OpenEdge Development: Progress 4GL Reference and OpenEdge Development: Programming Interfaces .

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