Online Documentation for SQL Manager for DB2

Aliases


An Alias is an alternative name used to identify a table, a view, a database, or a nickname. An alias can be used in SQL statements to refer to a table or view in the same DB2 subsystem or a remote DB2 subsystem.

 

 

Creating Aliases

 

To create a new alias:

Hint: To create a new alias, you can also right-click the Aliases node of the DB Explorer tree and select the New Alias... context menu item.

 

To create a new alias with the same properties as one of existing aliases has:

Alternatively, you can right-click an alias in the DB Explorer tree and select the Duplicate Alias <alias_name>... context menu item.

 

Duplicate Object Wizard allows you to select the database to create a new alias in, and to edit the result SQL statement for creating the alias.

 

 

Editing Aliases

 

To edit an existing alias:

  • select the alias for editing in the DB Explorer tree (type the first letters of the alias name for quick search);
  • right-click the object and select the Edit Alias <alias_name>... context menu item, or simply double-click the alias;
  • edit alias definition using the appropriate tabs of Alias Editor.

 

Dropping Aliases

 

To drop an alias:

  • select the alias to drop in the DB Explorer tree;
  • right-click the object and select the Drop Alias <alias_name>... context menu item;
  • confirm dropping in the dialog window.

 

Note: If more convenient, you can also use the following shortcuts:

Ctrl+N to create a new alias;

Ctrl+O to edit the selected alias;

Shift+Del to drop the object from the database.