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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Insert with multiple subqueries question - Oracle9i

Re: Insert with multiple subqueries question - Oracle9i

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Thu, 14 Apr 2005 18:43:19 +0200
Message-ID: <ja7t5190651b244li438j5s3kdm2oi0fff@4ax.com>


On 14 Apr 2005 09:38:00 -0700, brent.depuy_at_gmail.com wrote:

>
>
>I am having an issue trying to insert into a table, but i'm not sure of
>the syntax or if it is even possible. I'm inserting into Table1, which
>has a composite PK of 3 values, all of these PK's are FK's to other
>tables shown below:
>
>Table1: Table2: Table3:
> value1 PK value1 PK value3 PK
> value2 PK value2 PK
> value3 PK
> value4
> value5
>
>Is it possible to do something like this:
>
>INSERT INTO Table1(value1,value2,value3) ((SELECT value1,value2 FROM
>table2),(SELECT value3 from Table3));
>
>Again i'm not sure if this is the correct syntax or if this is
>possible, if someone could enlighten me on if this is possible and if
>they know a way to accomplish this, that'd be wonderful.
>
>Thanks in advance,
> Brent

The answer to this is version dependent as most answers are. You would best look up the syntax in the sql reference manual for your version at http://tahiti.oracle.com and come back when it is unclear.

--
Sybrand Bakker, Senior Oracle DBA
Received on Thu Apr 14 2005 - 11:43:19 CDT

Original text of this message

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