Insert Into Table using a cursor in 11g
I'm new to cursors FYI. All I want to do is truncate a temp table then insert into it. I want to convert this procedure to use a cursor: I'm not sure if I want a bulk insert or if I need some kind of loop.
PROCEDURE FIX_PUBLISHED ()
AS
BEGIN
DBMS_UTILITY.EXEC_DDL_STATEMENT ('TRUNCATE TABLE TMP_FIX_PUBLISHED;');
INSERT INTO TMP_FIX_PUBLISHED
SELECT DISTINCT CL.LISTED_TN, GAPL.PUBLISHEDNUMBER
FROM item,
tbprodni,
tbnationalsectionxref,
tbproduct,
cust_listing cl,
tbudac,
CUSTOMERINFO.CMS_GAP_PROGRAM gapp,
CUSTOMERINFO.CMS_GAP_PROGRAM_ITEM gapi,
CUSTOMERINFO.CMS_GAP_STATUS_TRACKING gaps,
0