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 » Handling Select with NULLs

Post new topic  Reply to topic
 Handling Select with NULLs « View previous topic :: View next topic » 
Author Message
AmitNy
PostPosted: Fri Aug 09, 2002 7:02 am    Post subject: Handling Select with NULLs Reply with quote

Newbie

Joined: 27 Jul 2002
Posts: 5

Hi Friends,

I am having some probelsm using Select statement.

Here my SQL.

SELECT CAST(T.TARGET_APPLICATION_TYPE AS CHAR),CAST(T.TARGET_LEVEL1 AS CHAR),CAST(T.TARGET_LEVEL2 AS CHAR),CAST(T.TARGET_LEVEL3 AS CHAR),
CAST(T.TARGET_DATA_TYPE_LOCATION AS CHAR),CAST(T.TARGET_QUEUE_MANAGER AS CHAR),CAST(T.TARGET_QUEUE AS CHAR),CAST(T.TRANSFORMATION_FLOW AS CHAR),CAST(T.TARGET_DATA_TYPE_NAME AS CHAR),CAST(T.TARGET_COUNTRY AS CHAR),CAST(T.TARGET_LANGUAGE AS CHAR) FROM Database.MQSIBRK.XMCI_ROUTING_2 as T
WHERE T.INTERFACE_ID = trim("InputBody"."Generic"."Header"."MessageInformation"."InterfaceID") and
T.SOURCE_LEVEL1 = "InputBody"."Generic"."Header"."SourceSystem"."SourceLevel1"

In Table SOURCE_LEVEL1 column has NULL Values and I am passing InputBody"."Generic"."Header"."SourceSystem"."SourceLevel1 as NULL

BUT ITS not returning any records.

and if I try the same case
Table SOURCE_LEVEL1 with value 4
InputBody"."Generic"."Header"."SourceSystem"."SourceLevel1 as 4

It works.


So Please help me how can I select NULL values.

Thanks
Back to top
View user's profile Send private message
sgopal
PostPosted: Fri Aug 09, 2002 9:30 am    Post subject: Reply with quote

Acolyte

Joined: 30 Jul 2002
Posts: 63

I dont think this as WMQI problem.
NULL can not be equated!!
Your where clause for NULL values should be:

Code:

WHERE T.INTERFACE_ID = trim("InputBody"."Generic"."Header"."MessageInformation"."InterfaceID") and
(T.SOURCE_LEVEL1  IS  NULL or
T.SOURCE_LEVEL1 = "InputBody"."Generic"."Header"."SourceSystem"."SourceLevel1" )
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 » Handling Select with NULLs
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.