如 select id from t_test; 我如何将结果集赋值给 数组变量 

解决方案 »

  1.   


    declare
        TYPE VARCHAR2_ARRAY IS TABLE OF VARCHAR2(100) INDEX BY BINARY_INTEGER;
        array_list          VARCHAR2_ARRAY;
        cursor c_cur is select ename from emp;
    begin
        for c in c_cur
        loop
            array_list(c_cur%rowcount) := c.ename;
        end loop;
        
        for i in 1..array_list.count
        loop
            dbms_output.put_line(array_list(i));
        end loop;
    end;
    /-----------------------------
    SMITH
    ALLEN
    WARD
    JONES
    MARTIN
    BLAKE
    CLARK
    SCOTT
    KING
    TURNER
    ADAMS
    JAMES
    FORD
    MILLERPL/SQL procedure successfully completed
      

  2.   

    谢谢了  精辟日 。 我想结贴  TMD  没有这么多分了。等我在赚赚吧    不好意思呀,