If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Oracle > How do you copy information into another table with constraint?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-11-11, 19:18
Plural Plural is offline
Registered User
 
Join Date: Oct 2011
Posts: 12
How do you copy information into another table with constraint?

I have the following table:
Patient(patientNumb, SS, name, dateOfBirth, address, dateAdmitted, clinic)

I'd like to insert all the values into another table called PatientB using:
Code:
INSERT INTO PatientB SELECT * FROM Patient
but the problem is the integrity constraint on patientNumb and clinic...is there a way that I can insert all those and updating the value at the same time or bypass it?
Reply With Quote
  #2 (permalink)  
Old 12-11-11, 20:17
anacedent anacedent is offline
Registered User
 
Join Date: Aug 2003
Location: Where the Surf Meets the Turf @Del Mar, CA
Posts: 6,416
CONSTRAINT exist to maintain data integrity.
Do what is required to maintain data integrity.
__________________
You can lead some folks to knowledge, but you can not make them think.
The average person thinks he's above average!
For most folks, they don't know, what they don't know.
Reply With Quote
  #3 (permalink)  
Old 12-11-11, 23:18
flyboy flyboy is offline
Registered User
 
Join Date: Mar 2007
Posts: 546
Quote:
Originally Posted by Plural View Post
is there a way that I can insert all those and updating the value at the same time or bypass it?
To be honest, I do not understand this question at all.

My first thought was error logging - it is described e.g. in this article: http://www.oracle-base.com/articles/...ging_10gR2.php
Also it can cover MERGE statement (also called upsert) - it is described e.g. here: http://www.oracle-base.com/articles/...cements10g.php

If none of this covers your requirements, you should precise your question, preferably represented with a test case (CREATE TABLE + INSERT statements for sample data, expected result with description of steps leading to it).
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On