inserting into nested tables [message #370664] |
Tue, 18 January 2000 04:31 |
Sunitha
Messages: 16 Registered: January 2000
|
Junior Member |
|
|
Can you pls explain how we can insert data into a table having multiple nested tables. A nested table may have another nested table as a column in it is the scenario.
|
|
|
|
Re: inserting into nested tables [message #370679 is a reply to message #370664] |
Tue, 18 January 2000 23:51 |
Sunitha
Messages: 16 Registered: January 2000
|
Junior Member |
|
|
create type test as object
(
testid number(6),
testname varchar2(10)
)
create type testtype is table of test
CREATE or replace TYPE secondnest AS OBJECT
( secondid number(2),
nesttest test
)
create type secondtype is table of secondnest
create table testtable
(
tableno number(3),
address secondtype
)
nested table address store as second_table
With ref. to the example, we want to insert into test table. We could not achieve with your reply. Pls help
|
|
|
|
Re: inserting into nested tables [message #370682 is a reply to message #370664] |
Wed, 19 January 2000 00:20 |
Sunitha
Messages: 16 Registered: January 2000
|
Junior Member |
|
|
Thanks. This is fine. Can you help us on how to insert another row into the test type table for the same values of testtable and secondtype table.
insert into testtable
values(123,secondtype(secondnest(1,test(124,'test1')))).
What I mean to ask is for a unique 123 testtable record with a unique secondtype 1, we should be able to add more than one record in test
|
|
|
Re: inserting into nested tables [message #370683 is a reply to message #370664] |
Wed, 19 January 2000 01:22 |
Nanduri V Rao
Messages: 13 Registered: January 2000
|
Junior Member |
|
|
While the first level of nesting is a nested table the second is not. What you have used there is the object that you created in the very first command. COnvert it into a nested table and then you should be able to insert more rows using 'THE' command
|
|
|
|