Check constraint against another table
686466Feb 20 2009 — edited Feb 20 2009new student here, trying to learn oracle. I am trying to create a check constraint where an insured value column will verify that it is >= to a price column in another table. The code I have used is:
alter table "SHIPMENTITEM" add
constraint CHK_INSURANCE
check (insuredvalue >= purchase(priceUSD));
The error i keep getting is ORA-00904: "PRICEUSD": invalid identifier, I have checked and the column names and data types are the same, any help would be appreciated.