[xwiki-users] SQL vs HQL cross join ()
Hi, I'm trying to get the values of two fields from xwikiattahment table with this HQL query: select att.filename,att.date from xwiki.xwikiattachment att, xwiki.xwikidoc doc where doc.fullName='Event.IIXornadaIDIS' and att.filename like '%abstract%' and att.date > '2012-03-01' and att.docId=doc.id order by att.filename; The query fails. When used to get only one field, it works fine. For instance... select att.date from xwiki.xwikiattachment att, xwiki.xwikidoc doc where doc.fullName='Event.IIXornadaIDIS' and att.filename like '%abstract%' and att.date > '2012-03-01' and att.docId=doc.id order by att.filename; or select att.filename from xwiki.xwikiattachment att, xwiki.xwikidoc doc where doc.fullName='Event.IIXornadaIDIS' and att.filename like '%abstract%' and att.date > '2012-03-01' and att.docId=doc.id order by att.filename; and, the SQL equivalent to the in troubles query works also fine. This way... select att.XWA_FILENAME,att.XWA_DATE from xwiki.xwikiattachment att, xwiki.xwikidoc doc where doc.XWD_FULLNAME='Event.IIXornadaIDIS' and att.XWA_FILENAME like '%abstract%' and att.XWA_DATE > '2012-03-01' and att.XWA_DOC_ID=doc.XWD_ID order by att.XWA_FILENAME; Please, where am I wrong when trying select att.filename,att.date from xwiki.xwikiattachment att,...? I'm running XWiki Enterprise 2.4.30451. Thanks for your help! Ricardo -- Ricardo Rodríguez Research Management and Promotion Technician Health Research Institute of Santiago de Compostela (IDIS) http://www.idisantiago.es Nota: A información contida nesta mensaxe e os seus posibles documentos adxuntos é privada e confidencial e está dirixida únicamente ó seu destinatario/a. Se vostede non é o/a destinatario/a orixinal desta mensaxe, por favor elimínea. A distribución ou copia desta mensaxe non está autorizada. Nota: La información contenida en este mensaje y sus posibles documentos adjuntos es privada y confidencial y está dirigida únicamente a su destinatario/a. Si usted no es el/la destinatario/a original de este mensaje, por favor elimínelo. La distribución o copia de este mensaje no está autorizada. See more languages: http://www.sergas.es/aviso_confidencialidad.htm
Hi, I haven't looked in your mail in details but maybe it's related to http://jira.xwiki.org/jira/browse/XWIKI-7542 -Vincent On Mar 1, 2012, at 9:52 PM, <[email protected]> <[email protected]> wrote:
Hi,
I'm trying to get the values of two fields from xwikiattahment table with this HQL query:
select att.filename,att.date from xwiki.xwikiattachment att, xwiki.xwikidoc doc where doc.fullName='Event.IIXornadaIDIS' and att.filename like '%abstract%' and att.date > '2012-03-01' and att.docId=doc.id order by att.filename;
The query fails. When used to get only one field, it works fine. For instance...
select att.date from xwiki.xwikiattachment att, xwiki.xwikidoc doc where doc.fullName='Event.IIXornadaIDIS' and att.filename like '%abstract%' and att.date > '2012-03-01' and att.docId=doc.id order by att.filename;
or
select att.filename from xwiki.xwikiattachment att, xwiki.xwikidoc doc where doc.fullName='Event.IIXornadaIDIS' and att.filename like '%abstract%' and att.date > '2012-03-01' and att.docId=doc.id order by att.filename;
and, the SQL equivalent to the in troubles query works also fine. This way...
select att.XWA_FILENAME,att.XWA_DATE from xwiki.xwikiattachment att, xwiki.xwikidoc doc where doc.XWD_FULLNAME='Event.IIXornadaIDIS' and att.XWA_FILENAME like '%abstract%' and att.XWA_DATE > '2012-03-01' and att.XWA_DOC_ID=doc.XWD_ID order by att.XWA_FILENAME;
Please, where am I wrong when trying select att.filename,att.date from xwiki.xwikiattachment att,...?
I'm running XWiki Enterprise 2.4.30451.
Thanks for your help!
Ricardo
-- Ricardo Rodríguez Research Management and Promotion Technician Health Research Institute of Santiago de Compostela (IDIS) http://www.idisantiago.es
Nota: A información contida nesta mensaxe e os seus posibles documentos adxuntos é privada e confidencial e está dirixida únicamente ó seu destinatario/a. Se vostede non é o/a destinatario/a orixinal desta mensaxe, por favor elimínea. A distribución ou copia desta mensaxe non está autorizada.
Nota: La información contenida en este mensaje y sus posibles documentos adjuntos es privada y confidencial y está dirigida únicamente a su destinatario/a. Si usted no es el/la destinatario/a original de este mensaje, por favor elimínelo. La distribución o copia de este mensaje no está autorizada.
See more languages: http://www.sergas.es/aviso_confidencialidad.htm
Hi! ________________________________________ From: [email protected] [[email protected]] On Behalf Of Vincent Massol [[email protected]] Sent: 01 March 2012 22:10 To: XWiki Users Subject: Re: [xwiki-users] SQL vs HQL cross join ()
Hi,
I haven't looked in your mail in details but maybe it's related to http://jira.xwiki.org/jira/browse/XWIKI-7542
It sounds like a similar issue although we are using MySQL and HQL here. I'll install a snapshot ASAP and test the query, then I'll provide more information in the pieces used here it it keeps failing. Thanks, Vincent! Ricardo
-Vincent
On Mar 1, 2012, at 9:52 PM, <[email protected]> <[email protected]> wrote:
Hi,
I'm trying to get the values of two fields from xwikiattahment table with this HQL query:
select att.filename,att.date from xwiki.xwikiattachment att, xwiki.xwikidoc doc where doc.fullName='Event.IIXornadaIDIS' and att.filename like '%abstract%' and att.date > '2012-03-01' and att.docId=doc.id order by att.filename;
The query fails. When used to get only one field, it works fine. For instance...
select att.date from xwiki.xwikiattachment att, xwiki.xwikidoc doc where doc.fullName='Event.IIXornadaIDIS' and att.filename like '%abstract%' and att.date > '2012-03-01' and att.docId=doc.id order by att.filename;
or
select att.filename from xwiki.xwikiattachment att, xwiki.xwikidoc doc where doc.fullName='Event.IIXornadaIDIS' and att.filename like '%abstract%' and att.date > '2012-03-01' and att.docId=doc.id order by att.filename;
and, the SQL equivalent to the in troubles query works also fine. This way...
select att.XWA_FILENAME,att.XWA_DATE from xwiki.xwikiattachment att, xwiki.xwikidoc doc where doc.XWD_FULLNAME='Event.IIXornadaIDIS' and att.XWA_FILENAME like '%abstract%' and att.XWA_DATE > '2012-03-01' and att.XWA_DOC_ID=doc.XWD_ID order by att.XWA_FILENAME;
Please, where am I wrong when trying select att.filename,att.date from xwiki.xwikiattachment att,...?
I'm running XWiki Enterprise 2.4.30451.
Thanks for your help!
Ricardo
-- Ricardo Rodríguez Research Management and Promotion Technician Health Research Institute of Santiago de Compostela (IDIS) http://www.idisantiago.es
Nota: A información contida nesta mensaxe e os seus posibles documentos adxuntos é privada e confidencial e está dirixida únicamente ó seu destinatario/a. Se vostede non é o/a destinatario/a orixinal desta mensaxe, por favor elimínea. A distribución ou copia desta mensaxe non está autorizada.
Nota: La información contenida en este mensaje y sus posibles documentos adjuntos es privada y confidencial y está dirigida únicamente a su destinatario/a. Si usted no es el/la destinatario/a original de este mensaje, por favor elimínelo. La distribución o copia de este mensaje no está autorizada.
See more languages: http://www.sergas.es/aviso_confidencialidad.htm
_______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users Nota: A información contida nesta mensaxe e os seus posibles documentos adxuntos é privada e confidencial e está dirixida únicamente ó seu destinatario/a. Se vostede non é o/a destinatario/a orixinal desta mensaxe, por favor elimínea. A distribución ou copia desta mensaxe non está autorizada. Nota: La información contenida en este mensaje y sus posibles documentos adjuntos es privada y confidencial y está dirigida únicamente a su destinatario/a. Si usted no es el/la destinatario/a original de este mensaje, por favor elimínelo. La distribución o copia de este mensaje no está autorizada. See more languages: http://www.sergas.es/aviso_confidencialidad.htm
participants (2)
-
Ricardo.Julio.Rodriguez.Fernandez@sergas.es -
Vincent Massol