CREATE OR REPLACE TYPE emp_obj AS OBJECT (
EMPNO NUMBER(4,0)
,ENAME VARCHAR2(20 BYTE)
,JOB VARCHAR2(10 BYTE)
,MGR NUMBER(4,0)
,HIREDATE DATE
,SAL NUMBER(6,2)
,COMM NUMBER(6,2)
,DEPTNO NUMBER(4,0));
Type created.
CREATE OR REPLACE TYPE emp_type AS TABLE OF emp_obj;
Type created.
CREATE OR REPLACE PACKAGE xxylp_emp_pkg
AS
PROCEDURE insert_rec (p_emp_typ IN emp_type);
END xxylp_emp_obj_pkg;
Errors: PACKAGE XXYLP_EMP_PKG Line/Col: 4/5 PLS-00113: END identifier 'XXYLP_EMP_OBJ_PKG' must match 'XXYLP_EMP_PKG' at line 1, column 9More Details: https://docs.oracle.com/error-help/db/ora-24344
CREATE OR REPLACE PACKAGE xxylp_emp_pkg
AS
PROCEDURE insert_rec (p_emp_typ IN emp_type);
END xxylp_emp_pkg;
Package created.
CREATE OR REPLACE PACKAGE BODY xxylp_emp_pkg
AS
PROCEDURE insert_rec (p_emp_typ IN emp_type)
AS
BEGIN
FORALL idx IN p_emp_typ.FIRST .. p_emp_typ.LAST
INSERT INTO emp_bck VALUES p_emp_typ(emp_obj(idx));
dbms_output.put_line('Insert Count: '||SQL%ROWCOUNT);
END insert_rec;
END xxylp_emp_pkg;
Errors: PACKAGE BODY XXYLP_EMP_PKG Line/Col: 7/7 PL/SQL: SQL Statement ignored Line/Col: 7/19 PL/SQL: ORA-00942: table or view does not existMore Details: https://docs.oracle.com/error-help/db/ora-24344
CREATE TABLE emp
(EMPNO NUMBER(4,0)
,ENAME VARCHAR2(20 BYTE)
,JOB VARCHAR2(10 BYTE)
,MGR NUMBER(4,0)
,HIREDATE DATE
,SAL NUMBER(6,2)
,COMM NUMBER(6,2)
,DEPTNO NUMBER(4,0))
Table created.
CREATE OR REPLACE PACKAGE BODY xxylp_emp_pkg
AS
PROCEDURE insert_rec (p_emp_typ IN emp_type)
AS
BEGIN
FORALL idx IN p_emp_typ.FIRST .. p_emp_typ.LAST
INSERT INTO emp
VALUES p_emp_typ(emp_obj(idx));
dbms_output.put_line('Insert Count: '||SQL%ROWCOUNT);
END insert_rec;
END xxylp_emp_pkg;
Errors: PACKAGE BODY XXYLP_EMP_PKG Line/Col: 7/7 PL/SQL: SQL Statement ignored Line/Col: 8/19 PL/SQL: ORA-00904: : invalid identifier Line/Col: 8/37 PLS-00430: FORALL iteration variable IDX is not allowed in this contextMore Details: https://docs.oracle.com/error-help/db/ora-24344