
-- program entry:

INSERT INTO program (program_code, program_name) VALUES (
	'163231353',
	'The Cell'
);

-- program clip entry:
-- the first INSERT using a subquery will work...

INSERT INTO clip (program_id, clip_name) VALUES (
(SELECT program_id FROM program WHERE program_code = '163231353'),
'The Cell');


-- program entry:

INSERT INTO program (program_code, program_name) VALUES (
	'9531443001',
	'Canada: A Diverse Culture'
);

-- program clip entry:
-- this will fail...

INSERT INTO clip (program_id, clip_name) VALUES (
(SELECT program_id FROM program WHERE program_code = '9531443001'),
'Canada: A Diverse Culture');



-- this will work...

INSERT INTO clip (program_id, clip_name) VALUES (
1708,
'Canada: A Diverse Culture');


-- this will not insert a row as expected because of the RULE...

INSERT INTO clip (program_id, clip_name) VALUES (
1708,
'Foo');