Altering a local type for a data source object

You use the ALTER NICKNAME statement instead of the CREATE TYPE MAPPING statement to change a local data type.

Before you begin

The authorization ID issuing the statement must include at least one of the following privileges:
  • SYSADM or DBADM authority
  • ALTER privilege on the nickname specified in the statement
  • CONTROL privilege on the nickname specified in the statement
  • ALTERIN privilege on the schema, if the schema name of the nickname exists
  • Definer of the nickname as recorded in the DEFINER column of the catalog view for the nickname.

About this task

When you create a nickname, the data types that are associated with the data source object are stored in the federated database. For some data sources, the wrapper specifies the data types for you. For other data sources, you must specify the data types when you create the nickname.

You can specify a local type for a column of a specific data source object.

Important: Changing the local data type can result in errors or loss of information if you change the local data type for a column to a type that differs greatly from its remote type.

Restrictions

See Restrictions on altering nicknames.

Procedure

To change the local data type from command line prompt, issue the ALTER NICKNAME statement from the command line.
For example:
ALTER NICKNAME nickname ALTER COLUMN column_name 
   LOCAL TYPE data_type

To treat the contents of a local column that has a character data type as bit (binary) data, use the FOR BIT DATA clause in the ALTER NICKNAME statement. When you use this clause to change the local data type of a column, code page conversions are not performed when data is exchanged with other systems. Comparisons are done in binary, irrespective of the remote database collating sequence.