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 » Extracting Nullable Fields from the Database

Post new topic  Reply to topic
 Extracting Nullable Fields from the Database « View previous topic :: View next topic » 
Author Message
MAN1SH
PostPosted: Tue Jul 19, 2011 2:05 am    Post subject: Extracting Nullable Fields from the Database Reply with quote

Newbie

Joined: 03 May 2011
Posts: 8

Hi,
I am extracting the nullable fields from the database and then mapping it to the target Message Set.
if the field has Null value then the element to which i am mapping that field is not getting generated.
I just wanted to know if we can use COALESCE in the query if it is returning multiple columns,
if yes can anyone please tell me the syntax of it.
Back to top
View user's profile Send private message
mqsiuser
PostPosted: Tue Jul 19, 2011 2:29 am    Post subject: Reply with quote

Yatiri

Joined: 15 Apr 2008
Posts: 637
Location: Germany

Make your SELECT on the DB...

Then later you map the data into your message structure:

1. If you map NULL then the field will not get generated (except --> look at "3." below)

2. If you do "OutputRoot.myStructure.myField = COALESCE( dbValue, '');" then an empty element gets generated "<myField ></myField >

3. Define a Schema (an xsd-file) and define the element as nillable. Use the Schema when parsing out the message. nillable means "<myField/>".
e.g. <xsd:element name="myField" type="xsd:string" nillable="true"/>

I am not sure if "OutputRoot.myStructure.myField" needs to be set to "NULL" or to the empty string ('') to make the out-parsing (with the xsd) generate a NIL-element ("<myField/>"), so please try this out.

Using coalesce within the select itself... hmmm
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Tue Jul 19, 2011 12:42 pm    Post subject: Reply with quote

Grand High Poobah

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

Depends which parser you are using...

With the MRM parser using SET myfield VALUE = NULL;
and the correct policy for null fields on the message set will generate the xsi:nil="true" attribute for your null field.

With the other parsers you will have to create the attribute AFAIK.

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
mqsiuser
PostPosted: Tue Jul 19, 2011 11:33 pm    Post subject: Reply with quote

Yatiri

Joined: 15 Apr 2008
Posts: 637
Location: Germany

Hello,

you posted into the forum "WebSphere MQ Workflow & Business Process Choreographer", but your question sounds like a Broker question. The forum for Broker is "WebSphere Message Broker Support". Do you use Message Broker?

In Broker COALESCE within the ESQL SELECT is not possible.

Thought... you can use PASSTHRU(" --- native (e.g. ORACLE) Select-Statement --- "). Likely you can do more there (depends on the SQL-statements that the DB supports).
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Jul 20, 2011 4:02 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

mqsiuser wrote:
you posted into the forum "WebSphere MQ Workflow & Business Process Choreographer", but your question sounds like a Broker question.


Moved on the assumption this is about broker
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
MAN1SH
PostPosted: Fri Jul 22, 2011 10:00 pm    Post subject: Reply with quote

Newbie

Joined: 03 May 2011
Posts: 8

Thank you all for ur response
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 » Extracting Nullable Fields from the Database
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.