POUWIEL|COM

JeroenPouwiel

Pretty basic procedure

For the life of me, I can never seem to remember this stuff…

CREATE OR REPLACE PROCEDURE   PROCEDURE_NAME IS
  TYPE frst_clmnTab IS TABLE OF table_name.first_clmn%TYPE;
  frst_clmn  frst_clmnTab ;
  CURSOR c1 IS
    SELECT 'INSERT INTO TABLE_OWNER.TABLE_NAME_OTHER VALUES (''' || first_clmn || ''')' as "PUT"
      FROM TABLE_NAME;
BEGIN
--
-- Here is where you process the elements in the collections
--
  FOR frst_clmn IN c1
    LOOP
          execute immediate frst_clmn.put;
    END LOOP;
--
COMMIT;
--
END;
/

Comments are closed.

Categories