This is the extraction from DB2 for AS/400 SQL Programming
Using ALIAS Names Sometimes it is useful to have a second name for
an existing table or view. To refer to an AS/400 physical file
that consists of multiple members without using an alias
name requires the use of file overrides. This override can be avoided by
creating a table alias that defines a name for the file,
including the specific member name.
This alias name can then be used in an SQL statement as though it were a
table name. Unlike overrides, alias names are objects that exist until they are
dropped. For example, if there is a multiple member file MYLIB.MYFILE with members
MBR1 and MBR2, an alias can be created for the second member so that SQL can
easily refer to it.
CREATE ALIAS MYLIB.MYMBR2_ALIAS FOR MYLIB.MYFILE (MBR2)
When alias MYLIB.MYMBR2_ALIAS is specified on the following insert
statement, the values are inserted into member MBR2 in MYLIB.MYFILE.
INSERT INTO MYLIB.MYMBR2_ALIAS VALUES(©ABC©, 6) |