Page 1 of 1

Parallel Routine Datatypes

Posted: Thu Mar 31, 2011 5:28 pm
by dougcl
Hi folks, when building an external routine to run in a transformer, the transformer is dealing with these datatypes:
VarChar
Double
Timestamp
Date
Time
Decimal
etc.

And the routine is dealing with these:
char*
float
long
short
etc.

How do I know what to map to what? What works and what doesn't? Is there anything out there that covers this?

Thanks,
Doug

Posted: Thu Mar 31, 2011 7:59 pm
by ray.wurlod
From memory the Programmer's Guide shows mapping between C-style and SQL-style data types. In general they're pretty obvious, though the latter form a subset of the former.

Posted: Fri Apr 01, 2011 3:32 am
by dougcl
Thanks Ray. I discovered today, for example, that I can return a char* from my routine into a Double in the transformer. No idea if this is a problem. Also, I am sending a Timestamp into a char*. I think this one is actually correct. So maybe some are obvious :?

Posted: Fri Apr 01, 2011 4:56 am
by zulfi123786
dates, numbers, strings, timestamps can be passed to and fro using char* .
Numeric values of datastage can be handled using appropriate data types like int----int, decimal-----float etc.

The only issue i faced was with char(datastage)------char(routine) mapping where the data receive from the routine output was not as expected.