Need help with convert Byte(6) to smallint

The Teradata Database channel includes discussions around advanced Teradata features such as high-performance parallel database technology, the optimizer, mixed workload management solutions, and other related technologies.

Need help with convert Byte(6) to smallint

Hi Team,


Hope you are doing good. Happy to share my query on blog.

I have a requirement where we are migrating Red Brick to Teradata.As part of this,we are working on RedBrick meta data tables. For instance, we have a meta data table in Red Brick named RBW_COLUMNS similar to Teradata DBC.columns and RBW_COLUMNS contains a column named TID, which is a unique table ID for each tablle with a SmalInt data type.

Now, I am trying to find out a equivalent column in Teradata and found that TableID in dbc.TVfilelds which is a Byte(6) data type.

Please help me out in converting  Byte(6) to SmallInt in teradata ASAP.




Teradata Employee

Re: Need help with convert Byte(6) to smallint

You can't fit a 4-byte value (the 2 subtable bytes are zero in TVFields) into a 2-byte SMALLINT.


Instead, step back and think about how this metadata is going to be used.

For example, maybe you need a new table that establishes a mapping between (old) Red Brick TID and Teradata DatabaseName/TableName?