Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

insert in nested table

601428May 1 2008 — edited May 1 2008
CREATE 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

Comments

Processing
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on May 29 2008
Added on May 1 2008
3 comments
583 views