Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2011
    Posts
    12

    Unanswered: 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?

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    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.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Mar 2007
    Posts
    623
    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).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •