ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » How do I set default value to NULL

Post new topic  Reply to topic
 How do I set default value to NULL « View previous topic :: View next topic » 
Author Message
ydeonia
PostPosted: Wed Jan 30, 2013 8:05 pm    Post subject: How do I set default value to NULL Reply with quote

Acolyte

Joined: 29 Oct 2012
Posts: 74

Hi

I am using MRM parser and getting some values in NULL sometimes. I want to set the default value to NULL if I get them. I have made the changes to message set as 0 and checked the nillable . but its not working . I am getting 0 as the default value even I get the blank in input message.

In code
IF inref."ABSO_COL1_I" IS NULL OR inref."ABSO_COL1_I" = '0'THEN
SET outref."ABSO_COL1_O" = NULL ;
ElSE SET outref."ABSO_COL1_O" = inref."ABSO_COL1_I" ;
END IF;

But when I don't set default 0 in message set it throws exception and otherwise it takes 0 . Please help in this .
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Jan 30, 2013 8:22 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Code:
SET ref = NULL;

This will in fact remove the tag...

Code:
SET ref VALUE = NULL;

This keeps the tag (needs to be nillable) and sets it's value to null
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
ydeonia
PostPosted: Wed Jan 30, 2013 8:45 pm    Post subject: Reply with quote

Acolyte

Joined: 29 Oct 2012
Posts: 74

fjb_saper wrote:
Code:
SET ref = NULL;

This will in fact remove the tag...

Code:
SET ref VALUE = NULL;

This keeps the tag (needs to be nillable) and sets it's value to null


Thanks for the reply but infact I want to remove it if its NULL . any other suggestion
Back to top
View user's profile Send private message
kash3338
PostPosted: Wed Jan 30, 2013 10:13 pm    Post subject: Re: How do I set default value to NULL Reply with quote

Shaman

Joined: 08 Feb 2009
Posts: 709
Location: Chennai, India

ydeonia wrote:

But when I don't set default 0 in message set it throws exception and otherwise it takes 0 . Please help in this .


You can have this code in ESQL,
Code:

IF inref."ABSO_COL1_I" IS NOT NULL AND inref."ABSO_COL1_I" <> '0'THEN
      SET outref."ABSO_COL1_O"  = inref."ABSO_COL1_I" ;
END IF;


And in the Message Set for this int element, just check the 'Nillable' property.
Back to top
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Thu Jan 31, 2013 4:53 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

The default value is used to populate a logical value if the field is not specified in the physical message.

You appear to be wanting to not populate any value at all if the field is not specified in the physical message.

You need to determine if it is allowable that the field is not at all specified in the physical message - that is, if the field is *required*.

If the field is optional, then you don't need to do anything to make sure that you don't get a value if there isn't a value.

At a higher level, in any message transformation, if you do not want a field to appear in the output message, then simply *don't* set it.
Back to top
View user's profile Send private message
ydeonia
PostPosted: Wed Feb 06, 2013 7:24 pm    Post subject: Reply with quote

Acolyte

Joined: 29 Oct 2012
Posts: 74

mqjeff wrote:
The default value is used to populate a logical value if the field is not specified in the physical message.

You appear to be wanting to not populate any value at all if the field is not specified in the physical message.

You need to determine if it is allowable that the field is not at all specified in the physical message - that is, if the field is *required*.

If the field is optional, then you don't need to do anything to make sure that you don't get a value if there isn't a value.

At a higher level, in any message transformation, if you do not want a field to appear in the output message, then simply *don't* set it.


Thanks I made the fields optional and it worked ! Thank you
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » How do I set default value to NULL
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.