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 -> INSERT by subquery behavior

INSERT by subquery behavior

From: John C. Sullivan <public_at_johncsullivan.com>
Date: 29 Jan 2004 08:28:41 -0800
Message-ID: <6dd31bb0.0401290828.2b552443@posting.google.com>


If you use an INSERT INTO <table1> SELECT * FROM <other table2 with same fields>, what is the behavior for the following situations:

  1. Some (but not all) of the selected records in <table2> have duplicates in <table1>? Does the entire statement fail or only for rows with duplicates in <table1>?
  2. Can I still do this statement if the indexes and column *constraints* are different in <table2>? The columns themselves have the same size and datatypes but there would likely be additional indexes but fewer constraints on <table2>
  3. Can the MERGE statement be used with a query to update multiple rows and would this eliminate the issues above?
Received on Thu Jan 29 2004 - 10:28:41 CST

Original text of this message

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