insert in nested table
601428May 1 2008 — edited May 1 2008CREATE TABLE borrower
(
NAME VARCHAR2(15 BYTE),
tools tools_nt,
total_debt NUMBER(7)
)
NESTED TABLE tools STORE AS tools_nt_tab
========================================
If i enter only the borrower NAME in first insert and then try to insert into the corresponding nested table tools with next insert i get the error.
ERROR:- ORA-22908: reference to NULL table value
INSERT INTO borrower
(NAME)
VALUES (in_bname);
INSERT INTO TABLE (SELECT tools
FROM borrower
WHERE NAME = in_bname)
VALUES (tool_ty (in_tname, in_cost));
========================================
This works fine.
INSERT INTO borrower
(NAME, tools
)
VALUES (in_bname, tools_nt (tool_ty (NULL, NULL))
);
INSERT INTO TABLE (SELECT tools
FROM borrower
WHERE NAME = in_bname)
VALUES (tool_ty (in_tname, in_cost));
But problem with this is that it always has a null row in the nested table.
==================================================
Regards
Arpit