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 -> Questions about INSERT with a subquery SELECT

Questions about INSERT with a subquery SELECT

From: moonfull <moonfull_at_hotmail.com>
Date: 7 Jun 2002 07:13:09 -0700
Message-ID: <ec2e8e7.0206070613.67487c8e@posting.google.com>


Hi everyone,

My question is when i do an INSERT query having a subquery SELECT and one of inserted rows founds duplicate in the inserted table. Will Oracle just stop the query and return SQLCODE as duplicate record? or it will add in the new records and just bypass the duplicates?

Example:
INSERT INTO TAB1
   SELECT COL1,

          COL2,
          'N',
          COL3
     FROM  TAB2

    WHERE COL1 = 'A' The COL1 and COL2 are PK of TAB1. I use this query to avoid using the cursor to fetch and do INSERT for each record in my program.

Any reply will be appreciated.
Thanks,
Tran. Received on Fri Jun 07 2002 - 09:13:09 CDT

Original text of this message

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