IMPORTANT:
this is not a Support Forum! Experienced users might answer from time to time questions posted here. If you need a professional and reliable answer, or if you want to report a bug, please contact Altova Support instead.

Excluding empth string from DB Options · View
jtcarm
Posted: Wednesday, November 18, 2009 3:15:01 PM
Rank: Newbie

Joined: 11/18/2009
Posts: 2
Location: Texas
Hi,

I've used XML SPY awhile and just discovered Mapforce in Altnova mission kit and am loving it, awesome tool for mapping from DB to schema. The only problem I'm having is figuring out some of the conditional mappings and transformations.

I have a varchar field which some genius decided to populate with an empty string on inserts instead of leaving it null. The schema element this maps to is optional. So if the value is spaces, I want to treat it like null and not include the output element rather than create the element with an empty string value. What's the best/easiest way to do this?

Thanks!
jtcarm
Posted: Wednesday, November 18, 2009 3:35:59 PM
Rank: Newbie

Joined: 11/18/2009
Posts: 2
Location: Texas
OK, answered my own question:

Insert:
empty string constant
normalize-space function
equal function
filter

connect:
db column to normalize string
normalize result and constant to equal
equal result to filter bool
db column to filter node
filter on-false to schema element

suspect I will need a UDF for this as there will be lots of empty strings to strip.

YMMV
Users browsing this topic
guest

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Use of the Altova User Forum(s) is governed by the Altova Terms of Use.