Change a Column's Data Type

Casts a specified column in the table to a given data type.

Overview

This procedure allows you to change the data type of a specific column within a table. This is useful when the original data type is incompatible with the operations you want to perform.

Input Concepts

Concept
Type
Description
Default
Required

table

table

The table containing the column to be cast.

No default

Yes

type

string

The target data type to cast the column to.

No default

Yes

Output Concepts

Concept
Description

table

The table with the column cast to the specified type.

Examples

1. Cast an Integer Column to a Float

create an integer table
cast the table's "Amt" column to "float"

Last updated

Was this helpful?