CREATE ALIAS statement

Creates an alias for a database. Once an alias is created, it can be used in place of the database's logical name.

Note: A database can have more than one alias, but each alias refers to one and only one database.

Syntax

CREATE ALIAS alias-string | value ( expression )
  FOR DATABASE logical-name-string | value ( expression )
  [ NO-ERROR ]
alias-string | value ( expression )
An unquoted string, quoted string, or CHARACTER expression that represents an alias for the database.
FOR DATABASE logical-name-string | value ( expression )
An unquoted string, quoted string, or CHARACTER expression that represents the logical name of the database.
Note: The logical name must already be set.
NO-ERROR
Tells the AVM to allow the alias to be created even if the database is not connected.

If you CREATE ALIAS for a database that is not connected and omit NO-ERROR, the AVM reports a run-time error.

Note: The NO-ERROR option of the CREATE ALIAS statement behaves differently from the NO-ERROR option of other ABL elements.

Example

This procedure creates the alias myalias for database mydb:

r-cralas.p

CREATE ALIAS myalias FOR DATABASE mydb NO-ERROR

Notes

See also

ALIAS function, CONNECT statement, CONNECTED function, CREATE CALL statement, DATASERVERS function, DBCODEPAGE function, DBCOLLATION function, DBRESTRICTIONS function, DBTYPE function, DBVERSION function, DELETE ALIAS statement, DISCONNECT statement, DYNAMIC-CURRENT-VALUE function, DYNAMIC-NEXT-VALUE function, ERROR-STATUS system handle, FRAME-DB function, LDBNAME function, NUM-DBS function, PDBNAME function, SDBNAME function