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 -> Inserting records from two different sources

Inserting records from two different sources

From: Lamar Youngers <lamaryoungers_at_yahoo.com>
Date: Mon, 27 Aug 2007 16:29:05 -0000
Message-ID: <fauu4h+82f3@eGroups.com>


I am attempting to INSERT records from two identical tables in two different schemas into one table using a single SQL statement, Could one do this by using DECODE in the INSERT statement?

EX:

Given tables a, b_at_a, b_at_b, and c, can something like this be done?

INSERT INTO c VALUES

       (DECODE (a.table_schema,

'a',b.column1_at_a,
'b',b.column1_at_b),
DECODE (a.table_schema,
'a',b.column2_at_a,
'b',b.column2_at_b),
... );

etc. Received on Mon Aug 27 2007 - 11:29:05 CDT

Original text of this message

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