Page 1 of 1

CAN WE PASS INTEGER COLUMN TO DECIMAL COLUMN IN TRANSFORMATI

Posted: Sun Sep 25, 2005 8:45 pm
by panic
WHILE TRANSFORMATIONS IN THE TRANSFORMER STAGE CAN WE PASS INTEGERED COLUMN TO DECIMAL COLUMN.

Posted: Sun Sep 25, 2005 8:58 pm
by kduke
Panic

DO NOT TYPE IN ALL CAPS. If you do not respect our wishes then leave the web site. I think your attitude is rude. Craig politely asked you not to post in CAPS. You asked questions posting urgent in the topic. We do not make any money answering your questions. When you are rude then it is no longer fun. You will continue to get fewer and fewer answers.

Please try to show some good judgement and be polite and do what is asked or suggested. You will get better answers.

Posted: Sun Sep 25, 2005 9:21 pm
by rleishman
Hear, hear.

Posted: Sun Sep 25, 2005 10:40 pm
by ray.wurlod
What exactly do you mean be an "integered" column?

Integer data types can automatically be promoted to decimal, provided the decimal data type has sufficient precision. For example, the largest legal (four byte) integer has ten digits; therefore, to be able to guarantee that the decimal column can accommodate any possible integer, it needs to have precision of at least 10+x, where x is the scale value. In this case you can guarantee that there will be accurate transfer.

On the other hand, if you have more a priori knowledge about the possible range of values that you may be processing, then a smaller precision may be possible. But if your knowledge turns out to be incorrect, then you risk loss of information in your data flow.

error: column mismatch

Posted: Mon Sep 26, 2005 11:38 am
by panic
if column name (varchar) datatype then column name (integer) datatype
else integer (datatype).

i wrote in the transformer stage

If lo.custid Matches ("1970" Or "1971") Then in_data.value Else 0



is it the correct way or not.i have doubt on the quotation marks.
if not suggestions plzz.
thanks

Posted: Mon Sep 26, 2005 2:20 pm
by kcbland
Server jobs are very gentle with mismatched data types.

Your expression is invalid:
If lo.custid Matches ("1970" Or "1971") Then in_data.value Else 0
can be:
If lo.custid = "1970" Or lo.custid = "1971" Then in_data.value Else 0
or
If lo.custid = 1970 Or lo.custid = 1971 Then in_data.value Else 0
The difference is that the quotes mean a text equivalency while no quotes tries a numerical equivalency. If the first valid example, 1970.00 will NOT be the same as 1970 whereas in the second example it will. Do the appropriate datatype syntax, else enforce rounding (See OCONV(link.column, "MD??") where ?? performs the appropriate decimal shift and rounding).

Posted: Mon Sep 26, 2005 2:21 pm
by kcbland
kcbland wrote:Server jobs are very gentle with mismatched data types.

Your expression is invalid:
If lo.custid Matches ("1970" Or "1971") Then in_data.value Else 0
can be:
If lo.custid = "1970" Or lo.custid = "1971" Then in_data.value Else 0
or
If lo.custid = 1970 Or lo.custid = 1971 Then in_data.value Else 0
The difference is that the quotes mean a text equivalency while no quotes tries a numerical equivalency. If the first valid example, 1970.00 will NOT be the same as 1970 whereas in the second example it will. Do the appropriate datatype syntax, else enforce rounding (See OCONV(link.column, "MD??") where ?? performs the appropriate decimal shift and rounding).

And by the way, please stop shouting as well. I agree with Kim 100%.