ORA-04043 에러가 자꾸 나네요..ㅜㅜ
왜그러는 것일까요..? 고수님들이 좀 봐주세요..
아래소스는 데이터를 5000건씩 Procedure로 넘겨서 저장하기만 하는 부분을 구현할려고 합니다.
넘어가긴하는데 넘어간 상태에서 in_id객체를 찾을수 없다고 나오네요..
Delphi 부분 ----------------
O_ID := VarArrayCreate([0,OUT_CNT],varVariant);
O_IP := VarArrayCreate([0,OUT_CNT],varVariant);
O_CODE := VarArrayCreate([0,OUT_CNT],varVariant);
O_DESC := VarArrayCreate([0,OUT_CNT],varVariant);
O_SESS := VarArrayCreate([0,OUT_CNT],varVariant);
... 데이터 초기화.
SP.StoredProcName :='iSystemPack.ins_Test(in_max, in_id, in_ip, in_code, in_desc, in_sess)';
SP.Params.Clear;
SP.Params.CreateParam(ftInteger,'in_max',ptInput).Value := OUT_CNT;
SP.Params.CreateParam(ftArray,'in_id',ptInput).Value := O_ID;
SP.Params.CreateParam(ftArray,'in_ip',ptInput).Value := O_IP;
SP.Params.CreateParam(ftArray,'in_code',ptInput).Value := O_CODE;
SP.Params.CreateParam(ftArray,'in_desc',ptInput).Value := O_DESC;
SP.Params.CreateParam(ftArray,'in_sess',ptInput).Value := O_SESS;
SP.Prepare;
SP.ExecProc;
Procedure 부분 --------------------
CREATE OR REPLACE PACKAGE Isystempack
IS
-- declaration of type
TYPE id_rec IS TABLE OF NUMBER INDEX BY BINARY_INTEGER;
TYPE ip_rec IS TABLE OF VARCHAR2(15) INDEX BY BINARY_INTEGER;
TYPE code_rec IS TABLE OF NUMBER INDEX BY BINARY_INTEGER;
TYPE desc_rec IS TABLE OF VARCHAR2(50) INDEX BY BINARY_INTEGER;
TYPE session_rec IS TABLE OF NUMBER INDEX BY BINARY_INTEGER;
--declaration of Procedure
PROCEDURE ins_Test(in_max IN INTEGER, in_id IN id_rec, in_ip IN ip_rec, in_code IN code_rec, in_desc IN desc_rec, in_sess IN session_rec);
END Isystempack;
/
CREATE OR REPLACE PACKAGE BODY Isystempack AS
PROCEDURE ins_Test(in_max IN INTEGER, in_id IN id_rec, in_ip IN ip_rec, in_code IN code_rec, in_desc IN desc_rec, in_sess IN session_rec) IS
BEGIN
FORALL i IN 1..in_max
INSERT INTO TEST_TEST ( testid, testip, testcode, testtime, testsession)
VALUES ( in_id(i), in_ip(i), in_code(i), in_desc(i), in_sess(i) );
COMMIT;
END ins_Test;
END Isystempack;
/