Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > Database Server Software > Oracle > Help with nested tables

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-29-03, 18:42
windur windur is offline
Registered User
 
Join Date: Nov 2003
Posts: 1
Question Help with nested tables

Well, I`m kinda new to this whole oracle thing, so the answer to my question is hopefully obvious to most of you.

I`ve created some types and tables, and everything worked out allright until I was gonna insert data into my table. The nested table within it doesn`t seem to act as a nested table since I can only choose one value.

Here is the code and I`m really stuck on this so I hope someone will respond.


CREATE OR REPLACE TYPE fagfelt_multi as object(
fagfelt VARCHAR2(30));

CREATE OR REPLACE TYPE fagfelt_nested_multi as table of fagfelt_multi;


CREATE OR REPLACE TYPE boktyp1 AS OBJECT(
isbn VARCHAR2(13),
tittel VARCHAR2(40),
fagfelt fagfelt_nested_multi,
har VARCHAR2(3),
forlagsnavn ref forlagstyp,
forfatter ref persontype1
)NOT FINAL;

CREATE TABLE boktab of boktyp1
NESTED TABLE fagfelt STORE AS fagfelt_multi_ntbl(
(PRIMARY KEY(nested_table_id,fagfelt))
ORGANIZATION INDEX COMPRESS)RETURN AS LOCATOR;

ALTER TABLE boktab
ADD CONSTRAINT pkbok PRIMARY KEY (isbn);


INSERT INTO boktab
SELECT
'1234561','Matte 103',
fagfelt_nested_multi(fagfelt_multi('matte','sol')) ,'ja',
REF (G),
REF (E)
FROM forlagstab G, persontab E
WHERE E.navn=personntyp('Geir', 'Nilsen')
AND G.navn='cappelen';

I can get it to work, but only with one value in fagfelt_nested_multi(fagfelt_multi, which sorta works against the purpose since its supposed to be multivalued.

In advance thanks ^

Edit: realized after posting that it`s saturday night, so did what I should of done in the first place, searched the topic, and realized the sollution was close.

fagfelt_nested_multi(fagfelt_multi('matte')fagfelt _multi('sol)),'ja',

Thanks for your previous threads!

Last edited by windur : 11-29-03 at 19:08.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On