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 » Mandatory fields

Post new topic  Reply to topic
 Mandatory fields « View previous topic :: View next topic » 
Author Message
mbtech
PostPosted: Tue May 28, 2013 7:20 pm    Post subject: Mandatory fields Reply with quote

Apprentice

Joined: 18 Jul 2012
Posts: 36

i have a scenario where i have mandatory fields in input i have to validate them to be not having blanks null values and special characters
Code:
If Input.XMLNSC.Field1 IS NOT NULL OR Input.XMLNSC.Field1 <> ' '
THEN THROW USER EXCEPTION 1111 VALUES (' MAnadtory field cannot have null balank or special characters');

NULL and Blanks values are fine may i know how to handle special characters
Back to top
View user's profile Send private message
kash3338
PostPosted: Tue May 28, 2013 7:51 pm    Post subject: Re: Mandatory fields Reply with quote

Shaman

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

mbtech wrote:
NULL and Blanks values are fine may i know how to handle special characters


For NULL and BLANK values, you can make use of the Message Set to do it for you. Why do you want to code for that?

As for special characters, what kind of special characters are you expecting in your message? Do you need to throw error for any special character or certain specific characters alone? Please be more specific in your requirement.
Back to top
View user's profile Send private message Send e-mail
rekarm01
PostPosted: Tue May 28, 2013 8:43 pm    Post subject: Re: Mandatory fields Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 1415

mbtech wrote:
Code:
THROW USER EXCEPTION 1111 ...

For the THROW statement, the broker reserves a range of numbers from 2949 to 2999 for user exceptions. It's usually a better practice to just use numbers within that range.

mbtech wrote:
may i know how to handle special characters

One way to handle special characters is to use the TRANSLATE() function to delete non-special characters, and then check for what's left.
Back to top
View user's profile Send private message
Tech1621
PostPosted: Wed May 29, 2013 1:32 am    Post subject: Re: Mandatory fields Reply with quote

Novice

Joined: 29 May 2013
Posts: 23

mbtech wrote:
i have a scenario where i have mandatory fields in input i have to validate them to be not having blanks null values and special characters
Code:
If Input.XMLNSC.Field1 IS NOT NULL OR Input.XMLNSC.Field1 <> ' '
THEN THROW USER EXCEPTION 1111 VALUES (' MAnadtory field cannot have null balank or special characters');

NULL and Blanks values are fine may i know how to handle special characters


I suggest using Message set for excluding the possibility of special characters and in it just restrict the type.
_________________
Anything is easy if you believe in yourself..
Back to top
View user's profile Send private message
mbtech
PostPosted: Wed May 29, 2013 10:06 pm    Post subject: Identifing blank fields at message set levl Reply with quote

Apprentice

Joined: 18 Jul 2012
Posts: 36

What are the settings to be done at the message set level to throw an error when a field is blank?
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 » Mandatory fields
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.