Constraint in Transformer not working Please help!!

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
harsh_cs31
Participant
Posts: 9
Joined: Fri Jul 17, 2009 11:42 am

Constraint in Transformer not working Please help!!

Post 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.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
harsh_cs31
Participant
Posts: 9
Joined: Fri Jul 17, 2009 11:42 am

Post 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.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Fair enough, had to ask. I wonder about trailing characters still... does String_Column[1,1]='A' work ok?
-craig

"You can never have too many knives" -- Logan Nine Fingers
jseclen
Participant
Posts: 133
Joined: Wed Mar 05, 2003 4:19 pm
Location: Lima - Peru. Sudamerica
Contact:

Re: Constraint in Transformer not working Please help!!

Post 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)
Saludos,

Miguel Seclén
Lima - Peru
harsh_cs31
Participant
Posts: 9
Joined: Fri Jul 17, 2009 11:42 am

Post 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!
Post Reply