Progress
Programming
Handbook
Database Aliases
An alias is a synonym for a logical database name. You use an alias as a database reference in Progress procedures in place of a logical database name.
You establish a logical database name when you connect a Progress session to a physical database. You create and assign an alias to a logical database name of an already connected database using the CREATE ALIAS statement. By reassigning an alias to different logical database names, you can run a compiled procedure on other connected databases that have identical structure and time stamps or CRC values for the tables referenced by the procedure. A logical database name can have more than one alias, but each alias refers to only one logical database name at a time.
The Progress Data Dictionary offers an example of alias usage. The Progress Data Dictionary is a general-purpose Progress application that works on any database that has DICTDB as an alias. The first database connected during a Progress session automatically receives the alias DICTDB. During a Progress session, you can reassign the DICTDB alias to another connected database with the Select Working Databases option on the Database menu in the Progress Data Dictionary.
NOTE: Because of the need to reassign of the DICTDB alias, Progress does not allow you to run the Progress Data Dictionary against a database connected with the logical name DICTDB.Use the CREATE ALIAS statement during a Progress session to assign or reassign an alias to a connected database. You can use this statement from the Progress editor or from an application procedure. This is the syntax for the CREATE ALIAS statement:
The alias argument can be an unquoted string, a quoted string, or an expression. The logical–name argument represents the existing logical name of a connected database. It can be an unquoted string, a quoted string, or an expression. You cannot create an alias that is the same as the logical database name of a connected database. The named database must be connected unless you use the NO–ERROR option.
When you create an alias, Progress logs the alias assignment in a table that remains in memory for the current session. If you use the DISCONNECT statement to disconnect a database from within an application, all existing aliases assigned to the logical database name remain in the alias table until the end of the Progress session. Later, if you connect to a database with the same logical database name during the same Progress session, you can use the same aliases to reference that logical database name. If you create an alias that already exists in the session alias table, Progress replaces the existing alias with the new alias. This allows you to reassign existing aliases to new logical database names.
The DELETE ALIAS statement allows you to delete an alias from the alias table of the current Progress session:
The alias argument represents an alias that exists in the current alias session table.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |