Hello friends!
I'm starting a study to practice some Oracle features, one of them is Type Object. The data volume that work is considerable (B.I.), so that the process is agile, I chose to use Type Object provided by Banco Oracle.
Below is an example:
-- Criação do objeto (estrutura de dados)
Create Type OBJ_Teste
(Id number,
nome varchar2(50)
);
-- Criação da tabela de dados
Create Type TBL_Teste is table of OBJ_Teste;
As I use This object [/b]:
Declare
xDataSet TBL_Teste := TBL_Teste();
vNome Varchar2(50);
Begin
-- Populando o objeto
for x in (select /*+ Parallel */id, nome from tabela_blablabla)
loop
xDataSet.Extend; -- incrementa um elemento no objeto
xDataSet(xDataSet.Count) := OBJ_Teste(x.Id, x.Nome); -- Popula o DataSet baseado na estrutura do objeto
end loop;
-- Lendo o objeto (na memoria)
select a.nome into vNome from [b]TABLE[/b](xDataSet) a where a.id = 45 -- Ou outro ID qualquer;
dbms_output.put_line('Nome: '||vNome);
end;
Where to pick up? This makes the object very slow (even in memory).
The question :: Idea: [color=# 0000bf] There is some way to create an index as if it were on a table, to access a Element based on the content of the element so that this search is faster.? [/color]
Note: Objective is to create a Quick search action , Object Type [/ u] of Oracle.