1
How to 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 sei , but in case the SQL in fact would be too heavy so I wanted to try to use the table in memory, the documentation of Oracle is full but bad of small examples , if someone knows a simple way I appreciate any help.
The example itself I do not think is important, but rather doubt , how to read an "array" as a table in an SQL in a block or PLSQL object ?
in reality what I wanted was to load a "Bulk" and then make a Join of a table with this "Bulk" reading it as if it were a table.
– Motta