SELECT colunm1,
column2,
column3,
NVL((SELECT tab1.sigla
FROM schema.tabela1 tab1,
schema.tabela2 tab2
WHERE SUBSTR(tab1.campoLayout, 1, 8) = tab2.nome_se
AND TRIM(SUBSTR(tab1.campoLayout, 10, 3)) = tab2.a
AND TRIM(SUBSTR(tab1.campoLayout, 13, 3)) = tab2.e
AND TRIM(SUBSTR(tab1.campoLayout, 16, 8)) = tab2.i
AND TRIM(SUBSTR(tab1.campoLayout, 25, 1)) = tab2.o
AND tab2.codigo = column3),
column3) FOCO,
NVL(DECODE(tab1.colunm1, 11, 11.9, 13, 13.8, 34, 34.5, 69, 69.0, 138, 138.0), 0) column4,
ROUND(POWER(3, 1 / 2) * tab1.column1*(95 / 100) * tab2.column3 / 1000, 2) resultado
FROM schema.tabela2
......
......
......
......
Bom, após dar uma respirada depois da query mais ou menos acima fiz vários testes e os resultados estão um SUCESSO - como esperado.
Fui no reports, criei uma query, coloquei a query acima e fui surpreendido pela mensagem abaixo:
REP-0496: Internal Error - Unable to parse the query.
Cause: The SQL statement that you have entered cannot be parsed because it contains an error.
Action: Review the SQL statement that you entered and ensure that you are using the correct syntax. For more information, see the ORACLE7 Server SQL Language Reference Manual.
Por favor, me ajudem.