All Forums Database
niveniran 1 post Joined 04/09
26 Apr 2009
DIGITS

We are converting DB2 to Teraddata.... in that need to convert one function ...DB2 >>> COLUMN1 is INT- (4) ...is it is stored as 112123If i use DIGITS function as select DIGITS(COLUMN1) .....output will be 000100120123Like this teradata is having any function ????

Fred 1096 posts Joined 08/04
26 Apr 2009

Use CAST(CAST(COLUMN1 AS FORMAT '9(p)') AS CHAR(p))Where p is the number of digits in the result.By the way, lengths used by DB2 are:SMALLINT - 5INTEGER - 9BIGINT - 19For DECIMAL(p,s) where s <> 0, DB2 omits the decimal point; so you'd need FORMAT '9(p-s)V9(s)'

You must sign in to leave a comment.