![Přidat otázku mezi oblíbené Přidat otázku mezi oblíbené](https://static.poradna.net/images/post/action/favorite.png)
Oracle
Mám aplikaci v javě, obsahující DB dotazy. Aplikace bohužel musí fungovat na různých DB (MS SQL, ACCESS, Oracle, MySQL...) a dotazy by tedy měly být napsané univerzálně tak, aby fungovaly když ne všude, tak alespoň ve výše uvedených DB. Následující dotaz mi však v Oracle nefunguje :
SELECT GU2C.CPID AS CPID,
E.CPID AS ECPID,
E.EID AS EID,
E.TOTALSTUDYTIME AS STUDY_LENGTH,
E.ABSOLVED AS STATUS,
E.ENDLEARN AS ABSOLVATION_DATE,
TR.TID AS TID,
TR.ATTEMPT AS ATTEMPT,
TR.SCORE AS RESULT,
TR.MINSCORE AS MINSCORE,
TR.MAXSCORE AS MAXSCORE,
TR.CREATED AS DATE_WHEN_ABSOLVATED_TEST,
E.TIME_IN_COURSE AS TIME_IN_COURSE,
E.LAST_OPENED AS LAST_OPENED,
E.PRINTCOUNT AS PRINTCOUNT,
E.LASTPRINT AS LASTPRINT,
GU2C.VALIDFROM AS VALIDFROM,
GU2C.VALIDTO AS VALIDTO
FROM (((GU2C LEFT JOIN ENROLLMENTS AS E ON
(E.CPID = GU2C.CPID AND E.USRID = ?)) LEFT JOIN
TESTRESULTS AS TR ON (E.CPID = TR.CPID AND E.USRID = TR.USRID)) LEFT JOIN
NOMINATION AS N ON (N.CPID = GU2C.CPID AND N.USRID = ?)) LEFT JOIN
TERMS AS TM ON (N.TERMID = TM.TERMID)
WHERE (GU2C.USRID = 2) AND (GU2C.CPID IN (4, 3))
Oracle vypíše:...FROM (((GU2C ...
*
ERROR na řádku 17:
ORA-00928: missing SELECT keyword
Když mu tam to vytoužené SELECT dopíšu, tak začne řvát o kousíček dál:...FROM (((SELECT GU2C LEFT JOIN...
*
ERROR na řádku 17:
ORA-00923: FROM keyword not found where expected
Poraďte prosím co s tím ![:.(](/images/smiley/cry.gif)