Thread: Exception with aggregate

Exception with aggregate

From
Joseph Shraibman
Date:

When I have a sql query like " select count(field) as countname from
tablename " I get:


Wed May 31 19:56:22 EDT 2000:ExecGroup-2:out:No class found for unknown.
Wed May 31 19:56:22 EDT 2000:ExecGroup-2:out:No class found for unknown.
Wed May 31 19:56:22 EDT 2000:ExecGroup-2:out:   at
org.postgresql.Connection.getObject(Connection.java:621)
Wed May 31 19:56:22 EDT 2000:ExecGroup-2:out:   at
org.postgresql.jdbc2.ResultSet.getObject(ResultSet.java:740)


If I have just " select count(field) from tablename " I have no problem.


Re: Exception with aggregate

From
Joseph Shraibman
Date:
Joseph Shraibman wrote:
> 
> When I have a sql query like " select count(field) as countname from
> tablename " I get:
> 
> Wed May 31 19:56:22 EDT 2000:ExecGroup-2:out:No class found for unknown.
> Wed May 31 19:56:22 EDT 2000:ExecGroup-2:out:No class found for unknown.
> Wed May 31 19:56:22 EDT 2000:ExecGroup-2:out:   at
> org.postgresql.Connection.getObject(Connection.java:621)
> Wed May 31 19:56:22 EDT 2000:ExecGroup-2:out:   at
> org.postgresql.jdbc2.ResultSet.getObject(ResultSet.java:740)
> 
> If I have just " select count(field) from tablename " I have no problem.

My mistake.  The part that was causing the problem was this:
case when a.rules is null or a.rules = '' then 'not set' else 'set' end
as text

I fixed it by changing it to this:
"case when a.rules is null or a.rules = '' then 'not set'::text else
'set'::text end as text "