Skip to Content
avatar image
Former Member

How to write UDF?

Hi all,

I want to write the UDF for this requirement.....if i dont get data from source side then i have to pass default value, if i get the value from source side not need to send default value.............how to write this UDF

regards,

kumar

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Aug 25, 2007 at 05:11 PM

    Hi Phani,

    well this thing you can do without using UDF, while doing source and target field mapping you can use standard function If without else you can check the value of the source field if it is blank(use a constant with space to compare the value of source field) then you can use your another value otherwise you can assign your original value.

    well i think if you can do this in graphical mapping then there is no need for writing UDF for this. Always write UDF when the condition is very much complex and which cant be done using any other way.

    Regards

    Sumit Bhutani

    Add comment
    10|10000 characters needed characters exceeded

  • Aug 25, 2007 at 05:32 PM

    Phani,

    You don't need UDF for this.

    Use <b>MapwithDefault</b> option. If the node is present then the value will take from the node, if its not there then it will default the value to the target.

    -Raj.

    Add comment
    10|10000 characters needed characters exceeded

  • Aug 30, 2007 at 08:01 PM

    And need to keep min occurence of the target field as 1 and use mapwithdefault function as Raj said.

    Add comment
    10|10000 characters needed characters exceeded