|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Handling Select with NULLs |
« View previous topic :: View next topic » |
Author |
Message
|
AmitNy |
Posted: Fri Aug 09, 2002 7:02 am Post subject: Handling Select with NULLs |
|
|
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 |
|
 |
sgopal |
Posted: Fri Aug 09, 2002 9:30 am Post subject: |
|
|
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 |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|