| 
       CREATE ALIAS alias-string  value ( expression )
        FOR DATABASE logical-name-string value ( expression ) NO-ERROR | 
| 
       CREATE ALIAS myalias FOR DATABASE mydb NO-ERROR
       | 
 The first OpenEdge database connected during a given session receives the DICTDB alias.
The first OpenEdge database connected during a given session receives the DICTDB alias.
   The first database connected that has an _menu file automatically receives the alias FTDB. You can reassign the FTDB alias to any other FAST TRACK database.
The first database connected that has an _menu file automatically receives the alias FTDB. You can reassign the FTDB alias to any other FAST TRACK database.
   If there is already a database connected with logical name equal to alias, CREATE ALIAS fails.
If there is already a database connected with logical name equal to alias, CREATE ALIAS fails.
   If there is an existing alias equal to alias, the existing alias is replaced by the new alias.
If there is an existing alias equal to alias, the existing alias is replaced by the new alias.
   If you want to use an expression for an alias name or logical name, you must use CREATE ALIAS VALUE (expression) FOR DATABASE VALUE (expression).
If you want to use an expression for an alias name or logical name, you must use CREATE ALIAS VALUE (expression) FOR DATABASE VALUE (expression).
   When a given database is disconnected, the existing aliases that refer to it are not erased, but remain in the session alias table. Later in the same session, if you connect to a database with the same logical name, the same alias is used again.
When a given database is disconnected, the existing aliases that refer to it are not erased, but remain in the session alias table. Later in the same session, if you connect to a database with the same logical name, the same alias is used again.
   Aliases allow a general purpose application (such as the OpenEdge Data Dictionary) to expect a specific database name. The Dictionary only works on databases with logical name or alias "DICTDB". The end user or the application can use CREATE ALIAS to provide the correct alias, in case it is inconvenient to connect the database using the correct logical name. Also, if there are several connected databases, the application can ask the user which one to select, then set the alias accordingly. The Data Dictionary does this when you choose Select Working Database.
Aliases allow a general purpose application (such as the OpenEdge Data Dictionary) to expect a specific database name. The Dictionary only works on databases with logical name or alias "DICTDB". The end user or the application can use CREATE ALIAS to provide the correct alias, in case it is inconvenient to connect the database using the correct logical name. Also, if there are several connected databases, the application can ask the user which one to select, then set the alias accordingly. The Data Dictionary does this when you choose Select Working Database.
   Suppose you connect to a database with logical name MYNAME and compile a procedure that accesses that database. Normally, the saved r-code file contains references to MYNAME.
Suppose you connect to a database with logical name MYNAME and compile a procedure that accesses that database. Normally, the saved r-code file contains references to MYNAME.
   Usually, any alias that exists during the session when you compile a procedure has no effect on the resulting r-code file. When a procedure is compiled, the logical name of the database that is accessed within the procedure is put into the r-code file, not an existing alias. If a procedure accesses more than one database, all of the logical names of accessed databases are placed into the r-code file.
Usually, any alias that exists during the session when you compile a procedure has no effect on the resulting r-code file. When a procedure is compiled, the logical name of the database that is accessed within the procedure is put into the r-code file, not an existing alias. If a procedure accesses more than one database, all of the logical names of accessed databases are placed into the r-code file.
   Changes made to an alias do not take effect within the current procedure. In the following example, alias1.p fails to compile when it reaches the FOR EACH statement, because alias myalias has been created during the compilation:
Changes made to an alias do not take effect within the current procedure. In the following example, alias1.p fails to compile when it reaches the FOR EACH statement, because alias myalias has been created during the compilation:
  | 
       /* alias1.p */
        /* NOTE: this code does NOT work */ CREATE ALIAS myalias FOR DATABASE sports2000. FOR EACH myalias.Customer NO-LOCK: DISPLAY Customer.Name. END. | 
| 
       FOR EACH myalias.Customer NO-LOCK:
        DISPLAY Customer.Name. END. | 
| 
       CREATE ALIAS myalias FOR DATABASE sports2000.
        RUN r-dispnm.p. | 
 Be careful when using shared buffers with aliases. If you reference a shared buffer after changing the alias that initially was used in defining it, the AVM returns a run-time error. See the following example procedures for details.
Be careful when using shared buffers with aliases. If you reference a shared buffer after changing the alias that initially was used in defining it, the AVM returns a run-time error. See the following example procedures for details.
  | 
       CREATE ALIAS myalias FOR DATABASE sports2000.
        RUN r-makebf.p. | 
| 
       DEFINE NEW SHARED BUFFER mybuf FOR myalias.Customer.
        CREATE ALIAS myalias FOR DATABASE sports2. RUN r-disp6.p | 
| 
       DEFINE SHARED BUFFER mybuf FOR myalias.Customer.
        FOR EACH mybuf NO-LOCK: DISPLAY mybuf. END. | 
 Be careful when accessing a database sequence with an alias that points to a different database than the one used when the alias was defined. If you supply an alias name to the CURRENT-VALUE function or the NEXT-VALUE function, only the database used to define the alias is referenced. In this case, it is preferable to use the DYNAMIC-CURRENT-VALUE function and DYNAMIC-NEXT-VALUE function instead of the CURRENT-VALUE function and NEXT-VALUE function, respectively.
Be careful when accessing a database sequence with an alias that points to a different database than the one used when the alias was defined. If you supply an alias name to the CURRENT-VALUE function or the NEXT-VALUE function, only the database used to define the alias is referenced. In this case, it is preferable to use the DYNAMIC-CURRENT-VALUE function and DYNAMIC-NEXT-VALUE function instead of the CURRENT-VALUE function and NEXT-VALUE function, respectively.