If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Is there corresponding null statement in DB2 like oracle?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-29-06, 03:15
zhouhaiming zhouhaiming is offline
Registered User
 
Join Date: Jan 2003
Posts: 74
Is there corresponding null statement in DB2 like oracle?

The following is oracle code:
IF V_JDYWDM='LHCKGL' THEN
...
...
ELSEIF V_JDYWDM='XSCKGL' THEN
NULL;
ELSEIF V_JDYWDM='YWYKGL' THEN
NULL;
ELSEIF V_JDYWDM='YHGL' THEN
SELECT MAX(SPDM00) INTO SPDM FROM
(SELECT SPDM00,SUM(SL0000) FROM
(SELECT SPDM00,DECODE(SIGN(SL0000),-1,0,SL0000) SL0000 FROM LSTYWDQZBKC0_JK1 WHERE YWGSDM=V_LYGSDM
AND SPDM00 IN (SELECT SPDM00 FROM XSTYHFP2 WHERE GSDW00=V_LYGSDM AND DHAO00=V_LYDHAO AND SL0000<0)
UNION ALL SELECT SPDM00,SL0000 FROM XSTYHFP2 WHERE GSDW00=V_LYGSDM AND DHAO00=V_LYDHAO AND SL0000<0)
GROUP BY SPDM00 HAVING SUM(SL0000)<0);
IF SPDM IS NOT NULL THEN
SELECT MAX(SPMC00) INTO SPMC FROM WMVSPXX0 WHERE SPDM00=SPDM;
FLAG:=1;
TEXT:=V_LYGSDM||'-'||V_LYGSMC||'-'||SPDM||'-'||SPMC;
RETURN;
END IF;
END IF;

IS there like null statement in DB2? null mean do nothing
Reply With Quote
  #2 (permalink)  
Old 09-29-06, 06:57
rahul_s80 rahul_s80 is offline
Registered User
 
Join Date: Jul 2006
Location: Pune , India
Posts: 433
try

then
set xyz=null

i think that should work
Reply With Quote
  #3 (permalink)  
Old 09-29-06, 07:06
guyprzytula guyprzytula is offline
Registered User
 
Join Date: Jun 2006
Posts: 471
ora

the null in oracle language as statement means no operation (not the value null)
I don't see any statement that could do the same
just not coding the condition would do, but this implies code change..
__________________
Best Regards, Guy Przytula
DB2 UDB LUW certified V6/7/8
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On