db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jakob Braeuchi <jbraeu...@gmx.ch>
Subject Re: CVS head: Error for QueryTest#testOrderByJoined() against MaxDB
Date Sat, 24 Jul 2004 18:29:33 GMT
hi armin,

and i thought that sql was a standard :(

the problem is that sapdb cannot order by a column that is not included in the 
SELECT-clause, this is feature is even supported by ms-access !

SELECT DISTINCT A0.TITLE,A0.DESCRIPTION,A0.ID FROM PROJECT A0,PERSON_PROJECT 
A1,PERSON A2 WHERE A1.PERSON_ID=A2.ID AND A0.ID=A1.PROJECT_ID ORDER BY A2.LASTNAME

the order-column has to be added to the SELECT-clause then it works:

SELECT DISTINCT A0.TITLE,A0.DESCRIPTION,A0.ID,A2.LASTNAME FROM PROJECT 
A0,PERSON_PROJECT A1,PERSON A2 WHERE A1.PERSON_ID=A2.ID AND A0.ID=A1.PROJECT_ID 
ORDER BY A2.LASTNAME

this means that i have to undo some of the latest changes :(

jakob

Armin Waibel schrieb:

> Hi,
> 
> against MaxDB/SapDB QueryTest#testOrderByJoined() fails with
> 
> com.sap.dbtech.jdbc.exceptions.DatabaseException: [-8013] (at 152): 
> Order column must be output column
> 
> I don't have a clue what this means.
> Jakob, it's your turn ;-)
> 
> regards,
> Armin
> 
> 
> There was 1 error:
> 1) 
> testOrderByJoined(org.apache.ojb.broker.QueryTest)org.apache.ojb.broker.PersistenceBrokerException:

> org.apache.ojb.broker.PersistenceBrokerSQLException: 
> com.sap.dbtech.jdbc.exceptions.DatabaseException: [-8013] (at 152): 
> Order column must be output column
>     at 
> org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(QueryReferenceBroker.java:241)

> 
>     at 
> org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(QueryReferenceBroker.java:253)

> 
>     at 
> org.apache.ojb.broker.core.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBrokerImpl.java:1218)

> 
>     at 
> org.apache.ojb.broker.core.DelegatingPersistenceBroker.getCollectionByQuery(DelegatingPersistenceBroker.java:338)

> 
>     at 
> org.apache.ojb.broker.core.DelegatingPersistenceBroker.getCollectionByQuery(DelegatingPersistenceBroker.java:338)

> 
>     at 
> org.apache.ojb.broker.QueryTest.testOrderByJoined(QueryTest.java:186)
>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
> 
>     at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

> 
>     at org.apache.ojb.broker.QueryTest.main(QueryTest.java:37)
>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
> 
>     at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

> 
>     at com.intellij.rt.execution.application.AppMain.main(Unknown Source)
> Caused by: org.apache.ojb.broker.PersistenceBrokerSQLException: 
> com.sap.dbtech.jdbc.exceptions.DatabaseException: [-8013] (at 152): 
> Order column must be output column
>     at 
> org.apache.ojb.broker.accesslayer.StatementsForClassImpl.getPreparedStmt(StatementsForClassImpl.java:172)

> 
>     at 
> org.apache.ojb.broker.accesslayer.StatementManager.getPreparedStatement(StatementManager.java:637)

> 
>     at 
> org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeQuery(JdbcAccessImpl.java:277)

> 
>     at 
> org.apache.ojb.broker.accesslayer.RsQueryObject.performQuery(RsQueryObject.java:74) 
> 
>     at 
> org.apache.ojb.broker.accesslayer.RsIterator.<init>(RsIterator.java:183)
>     at 
> org.apache.ojb.broker.core.RsIteratorFactoryImpl.createRsIterator(RsIteratorFactoryImpl.java:58)

> 
>     at 
> org.apache.ojb.broker.core.PersistenceBrokerImpl.getRsIteratorFromQuery(PersistenceBrokerImpl.java:1810)

> 
>     at 
> org.apache.ojb.broker.core.PersistenceBrokerImpl.getIteratorFromQuery(PersistenceBrokerImpl.java:1334)

> 
>     at 
> org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(QueryReferenceBroker.java:111)

> 
>     at 
> org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(QueryReferenceBroker.java:233)

> 
>     ... 26 more
> Caused by: com.sap.dbtech.jdbc.exceptions.DatabaseException: [-8013] (at 
> 152): Order column must be output column
>     at 
> com.sap.dbtech.jdbc.packet.ReplyPacket.createException(ReplyPacket.java:71)
>     at 
> com.sap.dbtech.jdbc.ConnectionSapDB.throwSQLError(ConnectionSapDB.java:796)
>     at 
> com.sap.dbtech.jdbc.ConnectionSapDB.execute(ConnectionSapDB.java:461)
>     at 
> com.sap.dbtech.jdbc.CallableStatementSapDB.sendCommand(CallableStatementSapDB.java:1611)

> 
>     at com.sap.dbtech.jdbc.StatementSapDB.sendSQL(StatementSapDB.java:725)
>     at 
> com.sap.dbtech.jdbc.CallableStatementSapDB.doParse(CallableStatementSapDB.java:228) 
> 
>     at 
> com.sap.dbtech.jdbc.CallableStatementSapDB.constructor(CallableStatementSapDB.java:179)

> 
>     at 
> com.sap.dbtech.jdbc.CallableStatementSapDB.<init>(CallableStatementSapDB.java:98)

> 
>     at 
> com.sap.dbtech.jdbc.ConnectionSapDB.prepareStatement(ConnectionSapDB.java:705) 
> 
>     at 
> org.apache.ojb.broker.accesslayer.StatementsForClassImpl.prepareStatement(StatementsForClassImpl.java:258)

> 
>     at 
> org.apache.ojb.broker.accesslayer.StatementsForClassImpl.prepareStatement(StatementsForClassImpl.java:223)

> 
>     at 
> org.apache.ojb.broker.accesslayer.StatementsForClassImpl.getPreparedStmt(StatementsForClassImpl.java:167)

> 
>     ... 35 more
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-dev-help@db.apache.org
> 
> 

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


Mime
View raw message