CHANGE DATA TYPE

Function

This command is used to change the data type from INT to BIGINT or decimal precision from lower to higher.

Syntax

ALTER TABLE [db_name.]table_name CHANGE col_name col_name changed_column_type;

Parameter Description

Table 1 CHANGE DATA TYPE parameters

Parameter

Description

db_name

Name of the database. If this parameter is left unspecified, the current database is selected.

table_name

Name of the table.

col_name

Name of columns in a table. Column names contain letters, digits, and underscores (_).

changed_column_type

The change in the data type.

Usage Guidelines

Examples

System Response

By running DESCRIBE command, the changed data type for the modified column is displayed.