cancel
Showing results for 
Search instead for 
Did you mean: 

Null Value Handling

Former Member
0 Kudos

Hi I have a senario in which the sender is a proxy and the reciving is a JDBC Stored procedure.

I would like to know if the values are empty from the proxy the stored procedure should interpret this value as a Null Value.

I am able to send the data which is not empty, but when i sent no value then it throws an error saying illegalArgument. exception.

could any body give a suggestion to have i can represent the empty value without representing it as an empty tag.

Accepted Solutions (0)

Answers (6)

Answers (6)

Former Member
0 Kudos

Thnks

Former Member
0 Kudos

Thnks

Former Member
0 Kudos

Hi Aditya ,

The best way to handel such null values without creating a tag is

Map such values from source to target in the following way.

sourcemapwithdefault-trim----length -greaterthanZEROcreateif ---target.

here mapwithdefault has one space.

you replace createif depending upon the requirement.

Regards,

Deepak

Former Member
0 Kudos

In the ID, your JDBC communication channel has a configurable option regarding what to do with empty strings.

So far as your stored procedure accepts nulls and functions properly when you test within your database, then the stored procedure 'does' work with nulls.

As such, you can enable this setting to send nulls when it detects an empty string.

sincerely,

--NM

Former Member
0 Kudos

Hi ,

nodefunction map with default is very usefull in such cases.

The best way to handel null values from source to target is

sourcemapwithdefault-trim-length-greaterthen 0-createif-target.

Here,

Mapwithdefault = single space..

here you can replace createif with your logic.

that takes cares of null values in the beginning itself ..and our context is not disturbed.

Regards,

deepak

sridharreddy_kondam
Active Contributor
0 Kudos

Hi Aditya,

Try this ...

Use If condition...

if the field is not null then send the the field value... else if the field is null (mena empty) then send empty(constant empty field)... by mapping to the target field...

this will work...

Regards,

sridhar

justin_santhanam
Active Contributor
0 Kudos

Aditya,

In Mapping from source to target check if the source is <b>blank</b> then map constant <b>null</b> to target. Try this and let us know.

Best regards,

raj.