Question

I've got a problem with my Query. Theres a table "TEAM" with a Row "PHOTO" from Type BLOB

My Query looks like:

  select distinct gruppe 
  from Gruppe gruppe 
     left outer join fetch gruppe.teams teams 
     inner join teams.turniere as turnier 
   where turnier.id = " + this.getTurnierId() + " order by gruppe.gruppenIndex"

the problem is that oracle returns an error:

ORA-00932: inconsistent datatypes: expected - got BLOB

I've figured out that oracle is not able to use a distinct while there is a BLOB inside a table.. Any suggestions? :-)

Regards, Kev

Was it helpful?

Solution

I suppose that a single turniere can be shared between many teams.

select gruppe
from Gruppe gruppe
where gruppe.id in (
    select distinct gruppe.id
    from Gruppe gruppe 
    left outer join fetch gruppe.teams teams 
    inner join teams.turniere as turnier 
    where turnier.id = :id
) order by gruppe.gruppenIndex

P.S. Indexed or named parameters will have better performance with Oracle than values hardcoded in the query string. See https://stackoverflow.com/questions/12896752/oracle-perfomance-jdbc-oracle-thin-driver-use-parameters-or-not.

OTHER TIPS

Try to write a SQL query to get it fixed . Basically we can write SQL Quires in Hibernate..

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top