I have 2 tables: TVSHOW and ACTOR. I want to reject records if the inserted actor in TVSHOW does not exist in the ACTOR table using DB2.
db2 "ALTER TABLE TVSHOW ADD CONSTRAINT check_actor CHECK (actor in (select id from ACTOR))"
I keep running into, During SQL processing it returned: SQL0546N The check constraint "check_actor" is invalid.
How can I fix this?