Page 1 of 1

problem while making the columns in a transformer nullable

Posted: Sun Sep 14, 2008 9:42 pm
by suneyes
Hi,
I am giving the o/p of XML input stage to a transformer i/p.and the transformer is connected to a seq file stage.

when I step all the colums in all the stages NOT NULL I am getting 2000 rows out of each stage.which is expected result.

But requirement is that we need to have as many colums nullable fields.

When I made all the columns in all the stages as NULLABLE I am Getting the same 2000 rows out of XML INPUT stage.But the transformer is giving only 200 rows as output.When I see the output file I see nothing in it.

I am unable to find the reason behind it.

can any one provide some pointers which helps me in getting out of this

Posted: Sun Sep 14, 2008 10:05 pm
by laknar
do u have any contstraints in Transfermer Stage.

Posted: Sun Sep 14, 2008 10:59 pm
by ray.wurlod
Please strive for a professional standard of written English on DSXchange. This includes not using SMS-style abbreviations (DSXchange is not a mobile telephony device) and paying attention to spelling. This request is made to help those participants whose first language is not English.

Posted: Sun Sep 14, 2008 11:43 pm
by suneyes
laknar wrote:do u have any contstraints in Transfermer Stage.
I have used IF THEN statement in a couple of places in the transformer

If DSLink5.name='input1' Then DSLink5.value ELSE '' --column1
If DSLink5.name='input2' Then DSLink5.value Else '' --column2

I am redirecting the same column (DSLink5.value ) to two different columns in the output link based on a column DSLink5.name.
This is the oly place I am using transformation.
I am propagating the rest of the fields to the output link without any transformation.

Posted: Sun Sep 14, 2008 11:46 pm
by suneyes
ray.wurlod wrote:Please strive for a professional standard of written English on DSXchange. This includes not using SMS-style abbreviations (DSXchange is not a mobile telephony device) and paying attention to spelling. This request is made to help those participants whose first language is not English.



sorry about the SMS language.I will keep it in mind.

Posted: Mon Sep 15, 2008 12:56 am
by ray.wurlod
If you want to have nullable columns then you need to handle this condition explicitly in Transformer stage expressions.

Code: Select all

If IsNull(DSLink5.name) Or IsNull(DSLink5.value) Then SetNull() Else If DSLink5.name="input1" Then DSLink5.value ELSE ""

Posted: Mon Sep 15, 2008 1:49 am
by suneyes
ray.wurlod wrote:If you want to have nullable columns then you need to handle this condition explicitly in Transformer stage expressions.

Code: Select all

If IsNull(DSLink5.name) Or IsNull(DSLink5.value) Then Se ...[/quote]


found a better solution for my problem ray.
we have an option to convert nulls to spaces in xml input stage.
I just checked it and everything is working fine for me without incorporating any logic in the transformer.