Aliases
This section describes the DDL commands pertaining to expression aliases.
Create alias
Define a new expression alias in the schema.
[ with with-item [, ...] ]
create alias alias-name := alias-expr ;
[ with with-item [, ...] ]
create alias alias-name "{"
using alias-expr;
[ create annotation attr-name := attr-value; ... ]
"}" ;
where with-item is:
[ module-alias := ] module module-name
Description
The command create alias
defines a new expression alias in the schema.
The schema-level expression aliases are functionally equivalent
to expression aliases defined in a statement with block, but are available to all queries using the schema
and can be introspected.
If name is qualified with a module name, then the alias is created in that module, otherwise it is created in the current module. The alias name must be distinct from that of any existing schema item in the module.
Parameters
Most sub-commands and options of this command are identical to the SDL alias declaration, with some additional features listed below:
- [ module-alias := ] module module-name
-
An optional list of module alias declarations to be used in the alias definition.
- create annotation annotation-name := value;
-
An optional list of annotation values for the alias. See
create annotation
for details.
Drop alias
Remove an expression alias from the schema.
[ with with-item [, ...] ]
drop alias alias-name ;
Parameters
- alias-name
-
The name (optionally qualified with a module name) of an existing expression alias.
Example
Remove an alias:
drop alias SuperUsers;