Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change data type in tera Data 1

Status
Not open for further replies.

DFW1999

Programmer
Nov 11, 2002
31
0
0
US
Hello,

I have a populated table in Tera Data V2R5 with a column Mark_Value as (Decimal 18,0)(Total cols in the table are 12). There are more then one million rows in this table. I want to change data type of col Mark_Value as follows:

Current data type: Mark_Value Decimal (18,0)

want to change data type to:

Mark_Value Char(18)

Is there any way in teradata to change this col from Decimal to Char and Vice versa without dropping this col from the table.

Thanks
DFW1999
 
if u want to change the column definition then you can do it by using
alter table tablename
modify column coldef

or if u want to convert the data before loading in to another table using CAST.
 
The safest and cleanest way to make this change is by creating a new table where Mark_Value is CHAR(18), then insert/select the contents of the original table into the new table (Ins into New_Table sel * from Old_Table).

If space is an issue and the original table is FALLBACK, you can alter the original table to NO FALLBACK and create the new table as NO FALLBACK before moving the data. After verifying the data in the new table, drop the original table and rename the new table to the original name. Alter the table to add fallback if necessary and you are done.

popocar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top