NullPointerException [50000-71] when reading from view

8 views
Skip to first unread message

Philipp Kursawe

unread,
Nov 4, 2009, 12:10:51 PM11/4/09
to H2 Database
Hello,

I am running into the the NPE mentioned above:
Internal Exception: org.h2.jdbc.JdbcSQLException: Allgemeiner Fehler:
java.lang.NullPointerException
General error: java.lang.NullPointerException [50000-71]
Error Code: 50000
Call: SELECT order_no, SHORTFALLS, SHORTFALLS_PERCENT, DONE_PERCENT
FROM pbv_order_details WHERE (order_no = ?)
bind => [12]

while the view is defined like this:
CREATE VIEW pbv_order_details (order_no, done_percent,
shortfalls_percent, shortfalls) AS
select
o.order_no as order_no,
100 * (select count(*) from pbv_order_items where
order_no=o.order_no and state!=1) / count(*) as done_percent,
100 * (select count(*) from pbv_order_items where
order_no=o.order_no and state=6) / count(*) as shortfalls_percent,
(select count(*) from pbv_order_items where
order_no=o.order_no and state=6) as shortfalls
from
pbv_order_items p, pbv_orders o where p.order_no =
o.order_no
group by o.order_no

I wonder why the select can even cause a NPE in the first place?

Thomas Mueller

unread,
Nov 7, 2009, 11:20:29 AM11/7/09
to h2-da...@googlegroups.com
Hi,

You are using version 1.0.71 (the version is part of the the error
code which is [*-71]). Could you try with a more recent version of H2?

Regards,
Thomas

Philipp Kursawe

unread,
Nov 9, 2009, 7:59:34 AM11/9/09
to H2 Database
Sure Thomas, will do!

On Nov 7, 5:20 pm, Thomas Mueller <thomas.tom.muel...@gmail.com>
wrote:
> Hi,
>
> You are using version 1.0.71 (the version is part of the the error
> code which is [*-71]). Could you try with a more recent version of H2?
>
> Regards,
> Thomas
>
Reply all
Reply to author
Forward
0 new messages