Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Insert data into varray

Re: Insert data into varray

From: DA Morgan <damorgan_at_x.washington.edu>
Date: Thu, 28 Apr 2005 21:47:32 -0700
Message-ID: <1114749818.217784@yasure>


Marcin 'dethar' Jurasz wrote:

> Hi! Into my database (its part below), i'm trying to insert values.
>
> CREATE TYPE t_vphonenos AS VARRAY(3) OF VARCHAR2(15);
>
> CREATE OR REPLACE TYPE t_customer AS OBJECT (
> id number(4),
> name_1 varchar2(20),
> name_2 varchar2(20),
> surname varchar2(20),
> nip varchar2(13),
> regon varchar2(15),
> pesel varchar2(11),
> phone_nos t_vphonenos
> );
> /
>
> CREATE TABLE tab_customers OF t_customer (
> id PRIMARY KEY
> )
> OBJECT ID PRIMARY KEY
> /
>
> this works fine:
>
> INSERT INTO tab_customers VALUES(t_customer
> (1, 'Grzegorz', 'Adam', 'Jarzebski', '567nip', '678regon', '568pesel',
> t_adress('Osinska', '23', '24', 'Tuwima', '32-424', 'Towowka'),
> t_vphonenos('+48 565 565 565')));
>
> but now i'd like to insert ("add") some data into t_vphonenos (i've
> inserted one row already ;)). i've tried something like this, but it
> didn't work:
>
> INSERT INTO tab_customers (phone_nos) VALUES (
> t_vphonenos (
> ('123123123'),
> ('345345345')
> )
> );
> What i'm doing wrong? I've tried also:
>
> INSERT INTO TABLE (SELECT phone_nos FROM tab_customers WHERE id = 1)
> VALUES (t_vphonenos('123123','1231233'));
>
> Still doesn't work. Someone would help me?
>
> Thanks

Examples of how to do this can be found at: http://www.psoug.org
click on Morgan's Library
click on nested tables

-- 
Daniel A. Morgan
University of Washington
damorgan_at_x.washington.edu
(replace 'x' with 'u' to respond)
Received on Thu Apr 28 2005 - 23:47:32 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US