Hello everyone,
I'm trying to execute some spatial SQL queries and I've come up with a problem: If I enter the following query, the spatial operation (in this case SDO_INSIDE) is executed perfectly and data is returned:
SELECT SUM(fact.quant) as SUM_quant, instalacao.name as Name
FROM fact, instalacao, layer_region, emissao
WHERE fact.instalacao_id = instalacao.instalacao_id AND fact.emissao_id = emissao.emissao_id AND SDO_INSIDE (instalacao.glocal, layer_region.geom)='TRUE'
GROUP BY instalacao.instalacao_id, instalacao.name
ORDER BY instalacao.instalacao_id
However, if I introduce another GROUP BY element, like this (Where 'emissao' does not have any spatial information, and is not used in the spatial operation) :
SELECT SUM(fact.quant) as SUM_quant, instalacao.name as Name
FROM fact, instalacao, layer_region, emissao
WHERE fact.instalacao_id = instalacao.instalacao_id AND fact.emissao_id = emissao.emissao_id AND SDO_INSIDE (instalacao.glocal, layer_region.geom)='TRUE'
GROUP BY instalacao.instalacao_id, instalacao.name, emissao.poluente
ORDER BY instalacao.instalacao_id
the database apparently gets "stuck" in a loop, and when I cancel it I get the following error:
ORA-13268: error obtaining dimension from USER_SDO_GEOM_METADATA
ORA-06512: at "MDSYS.MD", line 1723
ORA-06512: at "MDSYS.MDERR", line 8
...
I can't understand what I'm doing wrong as the "emissao" table is not used in any spatial operation.
Any ideas please?
Thanks in advance,
~Ruben