How do I load an Array or Bulk into a PLSQL and then read this as a table.
Example
DECLARE
VA_ARRAY ....DEFINIÇÃO DO ARRAY
VN_QTD NUMBER;
BEGIN
-- TABELA01 É UMA TABELA FÍSICA EXISTENTE NO BANCO
SELECT * BULK COLLECT INTO VA_ARRAY FROM TABELA01;
--AQUI QUERY FAZER UM JOIN DE OUTRA TABELA COM O ARRAY GERADO
-- TABELA02 É UMA OUTRA TABELA FÍSICA EXISTENTE NO BANCO
SELECT COUNT(*) INTO VN_QTD
FROM TABELA02 , (VA_ARRAY) COMO TABELA
WHERE TABELA02.COLUNA01 = (VA_ARRAY).CAMPO ...;
END;
I could use a subselect I know, but in case the SQL would indeed be very heavy so I wanted to try to use the table in memory, the Oracle documentation is full but bad of small examples, if anyone knows a simple way I appreciate any help .
The example itself does not seem to be important, but the question is, how to read an array as a table in a SQL in a PLSQL block or object?