[ http://issues.apache.org/jira/browse/OJB-9?page=all ]
Jakob Braeuchi resolved OJB-9:
------------------------------
Fix Version: 1.1 CVS
Resolution: Fixed
> Missing table qualifier in count sql preceding distinct QueryByCriteria
> -----------------------------------------------------------------------
>
> Key: OJB-9
> URL: http://issues.apache.org/jira/browse/OJB-9
> Project: OJB
> Type: Bug
> Components: PB-API
> Versions: 1.0.x CVS
> Environment: SAPDB 7.5
> Win XP
> OJB 1.0.1
> Reporter: S. Schlösser
> Fix For: 1.1 CVS
>
> Hi,
> When doing an sql with with distinct=true such as:
> Query:QueryByCriteria from class
> de.intermediate.components.generated.projekt.ProjektValue where
> [fk_hauptProjekt < 1, [subProjekte.workorders.fk_statusList <> 105], mandant
> = 001, deleted = false]
> org.apache.ojb.broker.PersistenceBrokerSQLException:
> com.sap.dbtech.jdbc.exceptions.DatabaseException: [-5014] (at 23): Missing
> definite column name:MANDANT
> com.sap.dbtech.jdbc.exceptions.DatabaseException: [-5014] (at 23): Missing
> definite column name:MANDANT
> [-5014] (at 23): Missing definite column name:MANDANT
> OJB does the following count SQL statement:
> SELECT count(distinct mandant || ID) FROM projekt A0,projekt A1,workorder A2
> WHERE A1.mandant=A2.mandant(+) AND A1.ID=A2.fk_projekt(+) AND
> A0.mandant=A1.mandant(+) AND A0.ID=A1.fk_hauptProjekt(+) AND ((((
> A0.fk_hauptProjekt < ?) AND (A2.fk_statuslist <> ?)) AND A0.mandant = ?) AND
> A0.DELETED = ?)
> This obviously fails since the usual A?.* table specifier is missing from the
> select clause.
> I post this as a bug since it is OJB which issues the offending count
> statement. What I am trying to do is to retrieve all projects which have
> subprojects which have workorders with a certain status. Since each project
> may have mutliple subprojects and workorders I issue the distinct to retrieve
> each project at most once.
> Yours
> S.Schlösser
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]