Run time insert using bulk update ,giving an internal error?

Posted by Vineet on Stack Overflow See other posts from Stack Overflow or by Vineet
Published on 2010-05-06T15:33:02Z Indexed on 2010/05/06 15:38 UTC
Read the original article Hit count: 205

Filed under:

Hi , I am trying to make a run time table named dynamic and inserting data into it from index by table using bulk update,but when i am trying to execute it this error is coming:

ERROR at line 1: ORA-06550: line 0, column 0: PLS-00801: internal error [74301

]

declare

     type index_tbl_type IS table of
        number
     index by binary_integer;
     num_tbl index_tbl_type;
     TYPE ref_cur IS REF CURSOR;
     cur_emp ref_cur;
    begin
         execute immediate 'create table dynamic (v_num number)';--Creating a run time tabl

         FOR i in 1..10000 LOOP
              execute immediate 'insert into dynamic values('||i||')';--run time insert
         END LOOP;
        OPEN cur_emp FOR 'select * from dynamic';--opening ref cursor
            FETCH cur_emp bulk collect into num_tbl;--bulk inserting in index by table
        close  cur_emp;

        FORALL i in num_tbl.FIRST..num_tbl.LAST --Bulk update
             execute immediate 'insert into dynamic values('||num_tbl(i)||')';
    end;

© Stack Overflow or respective owner

Related posts about plsql