Page 1 of 1

Constraint in Transformer not working Please help!!

Posted: Thu Sep 17, 2009 10:21 am
by harsh_cs31
I have an ODBC source through which I put the records into a transformer.
There are two outputs to the transformer. In one constraint I put String_column = "A" and in the other String_Column <> "A".
The above does not seem to work.

When I just put one output and say String_Column <> "A" all the records go in this file and if I put String_Column = "A" no records go in.

Iam using SQL Server 2005 and have already checked in the values in the db and so THERE ARE values like "A" and some others like "AA" etc.

Posted: Thu Sep 17, 2009 10:27 am
by chulett
What data type is this field? A CHAR field, for example, would have trailing spaces so you'd have to add them to the criteria or trim them in the constraint.

Posted: Thu Sep 17, 2009 10:44 am
by harsh_cs31
it is a varchar(8) type field and also the query:
select count(1) from myTable where String_Column='A'
is working fine so I dont think this is the issue.

Posted: Thu Sep 17, 2009 10:49 am
by chulett
Fair enough, had to ask. I wonder about trailing characters still... does String_Column[1,1]='A' work ok?

Re: Constraint in Transformer not working Please help!!

Posted: Thu Sep 17, 2009 10:50 am
by jseclen
Hi harsh_cs31, :D

Is NLS installed in your server?

When you import the metadata, what utilily do you used? odbc table definitions?

If your field are Char you must apply Trim before the compare, in Varchar doesnt' needed.

Please check the column Extend in the field definitions and blank the value,
because when the Unicode value are assigned the string comparations dont work correctly.

Send us the results. 8)

Posted: Thu Sep 17, 2009 11:10 am
by harsh_cs31
hey, Thanks for the replies, using TRIM worked for me though I still dont understand why a varchar 8 type needed it in my case.

Anyways, thanks a lot!