db-ojb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dougall Squair <Dougall.Squ...@metcash.com>
Subject [Bug] RC6 seems to be producing invalid SQL for Oracle when using ReportQuerys
Date Mon, 05 Apr 2004 01:28:41 GMT

Hi ,  

When I call 

	PersistenceBroker.getReportQueryIteratorByQuery(Query query)

The following SQL is being generated which is causing Oracle to throw a
SQLException.  It 
appears that OJB is including the PK column when counting the number of
rows.

i.e. the SQL generated is select count(*), table.pk from table 

which obviously causing a SQLException to be thrown 




2004-04-05 11:18:46,170 DEBUG (org.apache) SQL:SELECT
A0.mc_terms_agreement_id,A
0.mc_vendor_id,A0.status,A0.start_date,A1.vendor_name FROM mc_term_agreement
A0,
mc_vendor A1 WHERE A0.mc_vendor_id=A1.mc_vendor_id AND (A0.status <> ?)
ORDER BY
 1
2004-04-05 11:18:46,185 DEBUG (org.apache) SQL:SELECT
count(*),A0.mc_terms_agree
ment_id as ojb_col_1 FROM mc_term_agreement A0,mc_vendor A1 WHERE
A0.mc_vendor_i
d=A1.mc_vendor_id AND (A0.status <> ?) ORDER BY 2
2004-04-05 11:18:46,201 ERROR (org.apache) SQLException during the execution
of
the query (for a com.metcash.merchandising.model.agreement.Agreement):
ORA-00937
: not a single-group group function

java.sql.SQLException: ORA-00937: not a single-group group function

        at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
        at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
        at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:579)







---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Mime
View raw message