The ALTER NICKNAME statement modifies the federated database's representation of a data source table or view by:
Invocation
This statement can be embedded in an application program or issued through the use of dynamic SQL statements. It is an executable statement that can be dynamically prepared. However, if the bind option DYNAMICRULES BIND applies, the statement cannot be dynamically prepared (SQLSTATE 42509).
Authorization
The privileges held by the authorization ID of the statement must include at least one of the following:
Syntax
>>-ALTER NICKNAME------nickname--------------------------------->
.--------------------------------------------------------------------------------.
| .-,--------------------------------------. |
V .-COLUMN-. V | |
>--------ALTER--+--------+--column-name------+-LOCAL NAME--column-name-----------+--+--+>
+-LOCAL TYPE--data-type-------------+
| (1) |
'-| federated-column-options |------'
>--------------------------------------------------------------><
federated-column-options
.-,----------------------------------------------------.
V .-ADD--. |
|---OPTIONS--(----+-+------+---column-option-name--string-constant--+--+---)-->
| '-SET--' |
'-DROP--column-option-name------------------------'
>---------------------------------------------------------------|
Notes:
Description
The data-type cannot be LONG VARCHAR, LONG VARGRAPHIC, DATALINK, a large object (LOB) data type, or a user-defined type.
Rules
Notes
Examples
Example 1: The nickname NICK1 references a DB2 Universal Database for AS/400 table called T1. Also, COL1 is the local name that references this table's first column, C1. Change the local name for C1 to NEWCOL.
ALTER NICKNAME NICK1
ALTER COLUMN COL1
LOCAL NAME NEWCOL
Example 2: The nickname EMPLOYEE references a DB2 Universal Database for OS/390 table called EMP. Also, SALARY is the local name that references EMP_SAL, one of this table's columns. The column's data type, FLOAT, maps to the local data type, DOUBLE. Change the mapping so that FLOAT maps to DECIMAL (10, 5).
ALTER NICKNAME EMPLOYEE
ALTER COLUMN SALARY
LOCAL TYPE DECIMAL(10,5)
Example 3: Indicate that in an Oracle table, a column with the data type of VARCHAR doesn't have trailing blanks. The nickname for the table is NICK2, and the local name for the column is COL1.
ALTER NICKNAME NICK2
ALTER COLUMN COL1
OPTIONS ( ADD VARCHAR_NO_TRAILING_BLANKS 'Y' )