Error(7,1): PLS-00103: Encountered the symbol "CREATE". I tried to put / before create but then error was Error(6,1): PLS-00103: Encountered the symbol "/" .
I am new to PL/SQL programming, could you please help on this.
CREATE OR REPLACE PACKAGE EMP_BULK_INSERT AS
PROCEDURE Bulk_Insert;
END EMP_BULK_INSERT;
/* package body */
CREATE OR REPLACE PACKAGE BODY EMP_BULK_INSERT AS
PROCEDURE Bulk_Insert
AS
/* select all records from source table */
CURSOR kt_test_cur IS
SELECT empid
, empband
, empname
, workexp
, salary
from kt_test;
/* create nested table type and variable that will hold BIG_TABLE's records */
TYPE kt_test_ntt IS TABLE OF kt_test_cur%ROWTYPE;
l_kt_test kt_test_ntt;
BEGIN
/* open pointer to SELECT statement */
OPEN kt_test_cur;
/* collect data in the collection */
FETCH kt_test_cur BULK COLLECT INTO l_kt_test;
/* close the pointer */
CLOSE kt_test_cur;
/* print size of the collection */
DBMS_OUTPUT.PUT_LINE('Nested table holds: ' || TO_CHAR(l_kt_test.COUNT) || ' records.');
/* write data down to target table */
FORALL indx IN l_kt_test.FIRST..l_kt_test.LAST
INSERT INTO kt1_test(empid,empband,empname,workexp,salary)
VALUES (l_kt_test(indx).empid,l_kt_test(indx).empband,l_kt_test(indx).empname,l_kt_test(indx).workexp,l_kt_test(indx).salary);
DBMS_OUTPUT.PUT_LINE('Number of rows inserted ' || SQL%ROWCOUNT || ' rows');
COMMIT;
END Bulk_Insert;
END EMP_BULK_INSERT;