Problem of IR with COUNT (*) (AS apxws_row_cnt)

Hello world

I use the same question raised in the IR problem with COUNT (*) () AS apxws_row_cnt discussion Forum, by Marco 1975. I'm developing on APEX 5.0.0.0.31 and using the Oracle 12 c DB. An IR translates 4648 occurrences only 100 records. The SQL is okay, but the OVER() COUNT (*) AS apxws_row_cnt done something witcthery on my report.  Anyone has any idea how to solve this problem in 5 APEX?

My query:

SELECT PK_EMPLOYEE,

DATE_HIRE,

DATE_QUIT,

DBMS_LOB. GetLength ("foto") "FOTO"

NAME,

CPF

OF TB_EMPLOYEE

I found, helped by 3rd party experts - CITS Brasília - workaround using nested selects to avoid the Cartesian product of my request on IR. This is a Cartesian product of column FOTO ("PHOTO") against a column of master FK from another TABLE.

In any case there is the solution, I'm sorry for the Portuguese terms, but I understand that it will be quite understandable:

SELECT DISTINCT NULL as apxws_row_pk, "PK_EMPREGADO", "CPF", "NAME", "FOTO", "DATA_CONTRATACAO", "DATA_DISPENSA", count (*) (as apxws_row_cnt)

FROM (SELECT * FROM ())

SELECT

b."PK_EMPREGADO."

----------------------------------------------------------

--> Cartesian product: PHOTOS N versus Post - Posto Trabalho work 01

-"FK_POSTOS_TRABALHO"

-------------------------------------------------------------

-nvl (L1. ("" "' DISPLAY_VALUE ', b." FK_POSTOS_TRABALHO ") as"FK_POSTOS_TRABALHO,"

------------------------------------------------------------

«"" "" "" b."FCP", b."NOME", b. "FOTO", b. ' DATA_CONTRATACAO ', b. "DATA_DISPENSA»

FROM (SELECT * FROM (select distinct emp.) PK_EMPREGADO, emp. FK_POSTOS_TRABALHO, emp. FCP, emp. DATA_CONTRATACAO, emp. DATA_DISPENSA, emp. NOME, dbms_lob.getlength (emp. FOTO) "FOTO".

              OF TB_EMPREGADO emp

RIGHT JOIN TB_POSTOS_TRABALHO_HOM pt ON (pt. PK_POSTOS_TRABALHO = emp. FK_POSTOS_TRABALHO)

TB_EXECUTORES of RIGHT JOIN ex WE: APP_USER IS NOT NULL and: APP_USER = e.g. MATRICULA AND pt. FK_CONTRATADA = e.g. FK_CONTRATADA WHERE emp.cpf IS NOT NULL

) ) b,

(SELECT NUM_CONTRATO |) ' - ' || DESCRIPTION as display_value, FK_POSTOS_TRABALHO as return_value

OF terceirizado. TB_CONTRATADA cont, terceirizado. Post TB_POSTOS_TRABALHO_HOM, terceirizado. Tipo TB_TIPO_HOM, terceirizado. TB_EMPREGADO emp

WHERE to post. TYPE = type. PK_TIPO and cont. PK_CONTRATADA = post. FK_CONTRATADA and emp. FK_POSTOS_TRABALHO = post. PK_POSTOS_TRABALHO

L1 OF THE ORDER OF 1)))

I hope that Oracle will provide a coherent solution for COUNT (*) () AS apxws_row_cnt question.

Tags: Database

Similar Questions

Maybe you are looking for