You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-dev@db.apache.org by Armin Waibel <ar...@apache.org> on 2004/07/24 15:55:43 UTC
CVS head: Error for QueryTest#testOrderByJoined() against MaxDB
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
Re: CVS head: Error for QueryTest#testOrderByJoined() against MaxDB
Posted by Jakob Braeuchi <jb...@gmx.ch>.
hi antonio,
unfortunately sapdb/maxdb cannot order by a column that's not part of the
select-clause, so i went back to the old solution of adding orderBy xolumns to
the select-clause.
this is imo a platform-specific "feature" and should be moved there later.
jakob
Antonio Gallardo schrieb:
> Jakob Braeuchi dijo:
>
>>hi antonio,
>>
>>the orderBy fields are always added to the select for all platforms (as it
>>was
>>before). the groupBy fields are no longer added to the select.
>
>
> Why as it was before? Is there a reason to add a new value that waste memory?
>
> Best Regards,
>
> Antonio Gallardo
>
>
> ---------------------------------------------------------------------
> 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
Re: CVS head: Error for QueryTest#testOrderByJoined() against MaxDB
Posted by Antonio Gallardo <ag...@agssa.net>.
Jakob Braeuchi dijo:
> hi antonio,
>
> the orderBy fields are always added to the select for all platforms (as it
> was
> before). the groupBy fields are no longer added to the select.
Why as it was before? Is there a reason to add a new value that waste memory?
Best Regards,
Antonio Gallardo
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org
Re: CVS head: Error for QueryTest#testOrderByJoined() against MaxDB
Posted by Jakob Braeuchi <jb...@gmx.ch>.
hi antonio,
the orderBy fields are always added to the select for all platforms (as it was
before). the groupBy fields are no longer added to the select.
jakob
Antonio Gallardo schrieb:
> Armin Waibel dijo:
>
>>Jakob Braeuchi wrote:
>>
>>>hi armin,
>>>
>>>i fixed it.
>>>orderBy columns are again always added to the select-clause (may be this
>>>should be platform dependent, as only sapdb needs it ?).
>>>
>>
>>Thanks for fixing! Agree with you, this stuff should be moved to
>>Platform classes.
>
> Jakob:
>
> Did you revert the change proposed by Carlos? We discussed this before he
> answered and we think if a DB platform needs the field in the SELECT then
> it must be added by platform instead of add it on every query. I think it
> is important from a memory optimization POV?
>
> WDYT?
>
> Best Regards,
>
> Antonio Gallardo
>
>
> ---------------------------------------------------------------------
> 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
Re: CVS head: Error for QueryTest#testOrderByJoined() against MaxDB
Posted by Antonio Gallardo <ag...@agssa.net>.
Armin Waibel dijo:
> Jakob Braeuchi wrote:
>> hi armin,
>>
>> i fixed it.
>> orderBy columns are again always added to the select-clause (may be this
>> should be platform dependent, as only sapdb needs it ?).
>>
>
> Thanks for fixing! Agree with you, this stuff should be moved to
> Platform classes.
Jakob:
Did you revert the change proposed by Carlos? We discussed this before he
answered and we think if a DB platform needs the field in the SELECT then
it must be added by platform instead of add it on every query. I think it
is important from a memory optimization POV?
WDYT?
Best Regards,
Antonio Gallardo
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org
Re: CVS head: Error for QueryTest#testOrderByJoined() against MaxDB
Posted by Armin Waibel <ar...@apache.org>.
Jakob Braeuchi wrote:
> hi armin,
>
> i fixed it.
> orderBy columns are again always added to the select-clause (may be this
> should be platform dependent, as only sapdb needs it ?).
>
Thanks for fixing! Agree with you, this stuff should be moved to
Platform classes.
regards,
Armin
> i also fixed another problem when building the count-query. the orderBy
> cols of the query need to be added as joinAttributes to the count-query,
> otherwise no join is done and the count returns a wrong value. it's
> amazing who long this bug remained undiscovered.
>
> jakob
>
> Jakob Braeuchi schrieb:
>
>> 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
>>
>>
>
> ---------------------------------------------------------------------
> 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
Re: CVS head: Error for QueryTest#testOrderByJoined() against MaxDB
Posted by Jakob Braeuchi <jb...@gmx.ch>.
hi armin,
i fixed it.
orderBy columns are again always added to the select-clause (may be this should
be platform dependent, as only sapdb needs it ?).
i also fixed another problem when building the count-query. the orderBy cols of
the query need to be added as joinAttributes to the count-query, otherwise no
join is done and the count returns a wrong value. it's amazing who long this bug
remained undiscovered.
jakob
Jakob Braeuchi schrieb:
> 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
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org
Re: CVS head: Error for QueryTest#testOrderByJoined() against MaxDB
Posted by Jakob Braeuchi <jb...@gmx.ch>.
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