Page 1 of 1
Error in stagevariable
Posted: Thu Nov 06, 2008 3:44 am
by basu.ds
Hi
I have written on stagevariable but it is giving me wrong result can any help me on this
mystagevariable if trans.empno=mast.empno then 1 else 0
both columns are varchar columns
trans.empno=00000802 (value coming from hash file)
mast.empno=802 (value coming from oracle stage)
but data stage shows both are same i am wondering how?
Thanks in advance
Re: Error in stagevariable
Posted: Thu Mar 19, 2009 1:55 am
by Pagadrai
basu.ds wrote:Hi
I have written on stagevariable but it is giving me wrong result can any help me on this
mystagevariable if trans.empno=mast.empno then 1 else 0
both columns are varchar columns
trans.empno=00000802 (value coming from hash file)
mast.empno=802 (value coming from oracle stage)
but data stage shows both are same i am wondering how?
Thanks in advance
Hi
Hope ur issue is resolved by now
Anyway, i think the problesm here is with datatypes.
Posted: Thu Mar 19, 2009 2:09 am
by ray.wurlod
There is no problem - they are the same.
In server jobs there are no data types. So a comparison tests each operand to determine whether or not they are numeric. If they are, a numeric comparison is performed - if not, a string comparison is performed.
To force a string (or numeric) comparison use the Compare() function, or force each operand to be a string by concatenating the same non-numeric string to each.
Posted: Thu Mar 19, 2009 8:03 am
by chulett
And please learn that there's no need to explicitly set the output for a Boolean. All you need is "trans.empno=mast.empno" for the derivation, that "if-then-else" construct (while it does 'work') is completely unnecessary.