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.

inserting with INSERT INTO THE / nested tables

user600378Jun 27 2008 — edited Jun 27 2008
Hello

I kindly ask for help on the following issue - I have 2 tables as follows :

create or replace type t_skill(...)
create table skills of t_skill;
create or replace type tt_skills as table of REF t_skill;
create or replace type t_humanoid(
(...),
humanoid_skills tt_skills
);
create table humanoids of t_humanoid(
(...)
) nested table humanoid_skills store as humanoid_skills_storage;
alter table humanoid_skills_storage add( scope for(t_skill) is skills);

So, the entries of the second table have a nested table of references to the first table.
The first table is already filled. Now, I create an entry in the second table, but leave the nested table in the particular row of creation empty. Now, when there is an entry, I want to add something to it's nested table field like :

insert into the(select x.humanoid_skills from humanoids x where x.id_field = 1)
select ref(z) from skills z where z.name like 'RUNNING';

but get an error ORA-22908 about trying to access a null value in a table.
I used google and perhaps found a sollution ( http://oratip.com/ORA-22908.html ), I'm just not sure how to 'apply the answer' - could somebody explain that to me step by step ?

Thanks in advance.

Comments

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

Post Details

Locked on Jul 25 2008
Added on Jun 27 2008
0 comments
267 views