-
Pl/sql procedure compilation error
CREATE OR REPLACE PACKAGE BODY BLOAD AS
procedure BLAOD ( v_contract_oid IN NUMBER
) IS
--
-- This is a test procedure which gets timings for bulk inserts
-- for quote renewal.
--
v_contract_detail_nt nt_contract_detail;
--
-- Define the contract detail cursor
--
CURSOR c1_contract_detail IS
SELECT * FROM CONTRACT_DETAIL
WHERE CONTRACT_OID = v_contract_oid
ORDER BY LINE_NUM;
l_start_time NUMBER;
l_end_time NUMBER;
v_quote_oid NUMBER := 10000000;
BEGIN
OPEN c1_contract_detail;
--
-- Bulk fetch into contract detail Nested Table
--
select TO_CHAR(SYSDATE, 'SSSSS')
into l_start_time
from dual;
--
-- Get
FETCH c1_contract_detail BULK COLLECT
INTO v_contract_detail_nt;
CLOSE c1_contract_detail;
--
-- Bulk Insert from the nested table into QUOTE DETAIL TABLE
--
FORALL l_i IN 1..v_contract_detail_nt.COUNT
INSERT INTO Q_DETAIL ( COL1, COL2, COL3, COL4)
VALUES ( detail_record (
COL1(l_i), COL2(l_i), COL3(l_i),
COL4(l_i) ));
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line('===================');
dbms_output.put('Exception Number: ');
dbms_output.put_line(sqlcode);
raise;
END bload;
END bload;
--------------- end of procedure
Warning: Package Body created with compilation errors.
SQL> show errors
Errors for PACKAGE BODY BLOAD:
8/30 PLS-00201: identifier 'NT_CONTRACT_DETAIL' must be declared
8/30 PL/SQL: Item ignored
66/3 PL/SQL: SQL Statement ignored
67/8 PLS-00320: the declaration of the type of this expression is
incomplete or malformed
72/14 PL/SQL: Statement ignored
72/20 PLS-00320: the declaration of the type of this expression is
incomplete or malformed
It founds clear that NT_CONTRACT_DETAIL is missing.
I would like to know is there any possible to define the NT_CONTRACT_DETAIL object or type.
It seems to be using VARRAY or Nested Table feature, But I can’t get clear.
Can u guess what Nt_contract_detail?
Can You Pl. help out how to define the same to shot the error.
I need these procedure. pl let me know
thanks in advance.
-
NT_CONTRACT_DETAIL seems to a 2 dimensional array (select all the column and rows of the table CONTRACT_DETAIL)
try with this definition :
Type NT_CONTRACT_DETAIL is table of CONTRACT_DETAIL%rowtype;
There are three kinds of lies: Lies, damned lies, and benchmarks...
Unix is user friendly. It's just very particular about who it's friends are.
Oracle DBA
-
Typo?
CREATE OR REPLACE PACKAGE BODY BLOAD AS
procedure BLAOD ( v_contract_oid IN NUMBER
END bload;
END bload;
Typo?
Rob
--
-
Hi ,
i tried the statement 'Type NT_CONTRACT_DETAIL is table of CONTRACT_DETAIL%rowtype';
but now i got error as below and also not in insert statement values clause 'detail_record' used. i am unable to understand. pl. let me know
65/3 PL/SQL: SQL Statement ignored
66/8 PLS-00597: expression 'V_CONTRACT_DETAIL_NT' in the INTO list is
of wrong type
71/14 PL/SQL: Statement ignored
72/7 PL/SQL: SQL Statement ignored
72/7 PLS-00435: DML statement without BULK In-BIND cannot be used
inside FORALL
95/13 PLS-00201: identifier 'DETAIL_RECORD' must be declared
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|