cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bruno René Santos <brunor...@holos.pt>
Subject Re: Limits & Joins on Oracle
Date Thu, 02 Jun 2011 13:04:27 GMT
Hi Andrus,

Here goes the code (pretty simple):

public List<?> loadItems(int startIndex, int count) {
         query.setFetchLimit(count);
         query.setFetchOffset(startIndex);
         return results = 
HolosApplication.getApp().getDatabase().performQuery(query);
     }

I have spoken with colleague of mine about this and he told that this is 
really problem on Oracle because the select * and select tid.* from the 
outer selects forget the table prefixes that are inserted on each field. 
He said the only way to solve this would be to put aliases on each 
field. Is that possible without having to use a SQLTemplate? And in a 
more generic way?

Thanx
Bruno

Em 02-06-2011 13:36, Andrus Adamchik escreveu:
> Ah sorry, it is probably related to Cayenne (the rownum wrapper)... my bad... Could you
post a Cayenne code that you are using to initiate this query?
>
> Andrus
>
> On Jun 2, 2011, at 3:34 PM, Andrus Adamchik wrote:
>
>> This is clearly an Oracle SQL syntax error, nothing to do with Cayenne. I don't have
a handy Oracle install to try it out. But maybe somebody else here with more recent Oracle
experience can spot the issue? Otherwise you may try the Oracle forums.
>>
>> Andrus
>>
>>
>> On Jun 2, 2011, at 3:19 PM, Bruno René Santos wrote:
>>> Here it goes again... Please can anybody help?
>>>
>>> Thanx
>>> Bruno
>>>
>>> Em 31-05-2011 15:43, Bruno René Santos escreveu:
>>>> Hello all,
>>>>
>>>>
>>>> I am having a problem with the setFetchLimit on Oracle. When I use
>>>> joined tables that have fields with the same name i get the error:
>>>>
>>>> Error code 918, SQL state 42000: ORA-00918: column ambiguously defined
>>>>
>>>> with a query similar to the next one:
>>>>
>>>> select * from ( select tid.*, ROWNUM rnum from (
>>>> SELECT .... LEFT JOIN
>>>> ENTIDADE t1 ON (t0.ENTIDADE_ID_ENTIDADE = t1.ID_ENTIDADE) WHERE
>>>> t0.FISC_ID_FISCALIZACAO = 6103 ORDER BY t0.DT_AVERIG)
>>>> tid where ROWNUM<=15) where rnum>   0
>>>>
>>>> Any way around this?
>>>>
>>>> Thanx
>>>> Bruno
>>>>
>>>>
>>>
>>> -- 
>>> Bruno René Santos | brunorene@holos.pt<mailto:brunorene@holos.pt>   |
>>> Gestor de Projectos | Analista | Programador | Investigador
>>>
>>> Holos - Soluções Avançadas em Tecnologias de Informação S.A.
>>> Parque de Ciência e Tecnologia de Almada/Setúbal . Edifício Madan Parque
>>> Rua dos Inventores . Quinta da Torre . 2825 - 182 Caparica . Portugal
>>> Phone: +351 210 438 686 . Fax: +351 210 438 687 . Web: www.holos.pt
>>>
>>>
>>> This email and any files transmitted with it are confidential and
>>> intended solely for the use of the individual or entity to whom they are
>>> addressed. If you are not the intended recipient or the person
>>> responsible for delivering the email to the intended recipient, be
>>> advised that you have received this email in error and that any use,
>>> dissemination, forwarding, printing, or copying of this email is
>>> strictly prohibited. If you have received this email in error please
>>> notify Bruno René Santos by telephone on +351 210 438 686
>>>
>>>
>>>
>>>
>>
>
>


-- 
Bruno René Santos | brunorene@holos.pt <mailto:brunorene@holos.pt> | 
Gestor de Projectos | Analista | Programador | Investigador

Holos - Soluções Avançadas em Tecnologias de Informação S.A.
Parque de Ciência e Tecnologia de Almada/Setúbal . Edifício Madan Parque
Rua dos Inventores . Quinta da Torre . 2825 - 182 Caparica . Portugal
Phone: +351 210 438 686 . Fax: +351 210 438 687 . Web: www.holos.pt


This email and any files transmitted with it are confidential and 
intended solely for the use of the individual or entity to whom they are 
addressed. If you are not the intended recipient or the person 
responsible for delivering the email to the intended recipient, be 
advised that you have received this email in error and that any use, 
dissemination, forwarding, printing, or copying of this email is 
strictly prohibited. If you have received this email in error please 
notify Bruno René Santos by telephone on +351 210 438 686


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message