Page 1 of 1

Data type conversion

Posted: Thu May 21, 2009 1:22 pm
by mydsworld
What is the function to convert a STRING type to Integer in server job or in BASUC Transformer.

Posted: Thu May 21, 2009 1:57 pm
by asorrell
Server is sort of a strange beast - it defines it by usage. Use a string as a number, and (if the string contains a valid number) it will do the conversion automatically.

Posted: Thu May 21, 2009 2:01 pm
by mydsworld
Actually am trying to convert timestamp to Integer, so am having the following as string :
Trim(Oconv(Date(),"D-YMD[4,2,2]"),"-","a") : Trim(Oconv(Time(),"MTS"),":","a")

eg 20090521162367

I need to convert it to Integer or Bigint

Please advise.

Posted: Thu May 21, 2009 2:35 pm
by chulett
There's no explicit conversion needed in Server, just strip the delimiters before you move it to the target field. One easy way to do that is to use the DIGITS transform.

Posted: Thu May 21, 2009 4:37 pm
by ray.wurlod
Moderator: please move to Server forum