Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SCIPT HELP!!

Status
Not open for further replies.

mkey

Programmer
Oct 3, 2001
288
CA
Hi All,
I need help on my script.

SELECT A.TYPE, B.S_TYPE FROM table_one A, table_two B
WHERE A.ID = B.ID
AND A.type <> B.S_TYPE;
The above query works and its retuns some values.

Now I want to perform an update:

UPDATE table_one A SET A.TYPE = (SELECT B.S_TYPE FROM table_two B
WHERE A.id = B.id
AND A.TYPE <> B.S_TYPE);

When I ran this update script and I'm getting an error:
ORA-02290: check constraint
I tried disabling the constraint. Still it doesn't work.
Any thoughts?
Thanks
mkey
 

Verify the purpose of the check constraint, check also if you need to update this check constraint by expanding your check criteria, because it looks like you have TYPEs in table_two that are not allowed by the check constraints.

After you have verified, you can drop / create the check constraint.

ALTER TABLE table1
DROP CONSTRAINT constraint1;

ALTER TABLE table1
ADD CONSTRAINT constraint1 CHECK (condition here);


Robbie

&quot;The rule is, not to besiege walled cities if it can possibly be avoided&quot; -- Art of War
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top