db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From TXVanguard <brett.den...@lmco.com>
Subject Getting around NullPointerException problem
Date Mon, 09 Jul 2012 21:57:02 GMT

(Note: I have another post that uses the INSERT statement below as an
example, but this post concerns a different problem.)

When I run the query below, I get a java.lang.NullPointerException.  The
exception goes away if I change the "EMN.ASM IS NULL" to "EMN.ASM = 0" (or
anything else that does not compare EMN.ASM to NULL). Is there a way to
rewrite this statement to get around this Derby problem?  Thanks.

INSERT INTO Table1(ASM, SNID, DNID, SC)
SELECT ASM, SNID, DNID, Count(SIID)
FROM (
    SELECT DISTINCT R.ASM, S.NID AS SNID, S.CID AS SCID, S.IN AS SIID, D.NID
AS DNID
    FROM
        (Table2 AS D INNER JOIN (Table2 AS S INNER JOIN Table3 AS R ON
(S.IN=R.SIN) AND (S.CID=R.SCID)) ON (D.IN=R.DIN2) AND (D.CID=R.DCID))
        LEFT JOIN
        ( SELECT DISTINCT ASM FROM Table4 WHERE EX = True) AS EMN ON R.ASM =
EMN.ASM
    WHERE (((S.NID<40 OR S.NID>42) AND (D.NID<40 OR D.NID>42)) OR
(R.ASM<10000 OR R.ASM>=40000)) AND EMN.ASM IS NULL
    ) AS T
GROUP BY ASM, SNID, DNID 
-- 
View this message in context: http://old.nabble.com/Getting-around-NullPointerException-problem-tp34136822p34136822.html
Sent from the Apache Derby Users mailing list archive at Nabble.com.


Mime
View raw message