Page 1 of 1
how to generate the 16 digit number in the datastage
Posted: Thu May 13, 2010 3:54 am
by pavankatra
i want to populate the 16 digit incremental number for one column.
column datatype is varchar
how to generate the 16 digit number in the datastage
anyone please help me.
Thanks in advance
Posted: Thu May 13, 2010 4:19 am
by priyadarshikunal
if its OK to have left padded 0's then use surrogate key stage and convert the output to Number(16) datatype and then map it to varchar as required.
Posted: Thu May 13, 2010 4:31 am
by ray.wurlod
To expand, generate regular integers, then transform them to strings with a function such as
Code: Select all
Right(Str("0",16):InLink.MyInteger, 16)
For improved performance, initialize a stage variable, say sv16zeroes, to Str("0", 16), and use the stage variable rather than the function call in the derivation expression. That way the Str() function is only evaluated once. You could use "0000000000000000" instead.
Posted: Thu May 13, 2010 4:52 am
by pavankatra
ray.wurlod wrote:To expand, generate regular integers, then transform them to strings with a function such as
Code: Select all
Right(Str("0",16):InLink.MyInteger, 16)
For improved performa ...
thanks for your reply
let me check.