Pular para o conteúdo

Fóruns SQL e PL/SQL Como criar Matriz (array) em PL SQL? Como criar Matriz (array) em PL SQL?

#94439
Avatar photoLeonardo Litz
Participante

    Humm

    No Oracle voce deve criar um type com as colunas que voce deseja e depois criar um outro type que seja uma tabela sobre este primeiro type.

    Assim:


    create or replace package teste_typ
    is

    type typ_teste is record (col_1 varchar2(40),
    col_2 varchar2(30),
    col_3 number);

    type typ_tb_teste is table of typ_teste;

    end teste_typ;
    /

    create or replace package body teste_typ
    is
    procedure teste
    is
    v_teste typ_tb_teste;
    begin

    select *
    into bulk collect into v_teste
    from table;

    end teste;
    end teste_typ;

    E por ai vai….

    Qualquer duvida poste ai…

    Valeu Leonardo Litz