Logical database names
- Last Updated: January 16, 2024
- 2 minute read
- OpenEdge
- Version 12.8
- Documentation
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 .db 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 following command:
|
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) as the database you compiled the procedure against.
- 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 an ABL procedure with the CREATE ALIAS statement. For more information about logical and
physical database names and aliases, and the CREATE ALIAS
statement, see ABL Reference and OpenEdge
Programming Interfaces.