Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2003
    Posts
    74

    Unanswered: 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

  2. #2
    Join Date
    Jul 2006
    Location
    Pune , India
    Posts
    433
    try

    then
    set xyz=null

    i think that should work

  3. #3
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •