I’m hoping I can get some help. I am trying to call on a foreign key for this INSERT. I’m new and my other resources aren’t responding to this question yet. Below is the subquery that I believe is causing me issues as well as the entire INSET statement.
(SELECT contact_lab_id
FROM contact_lab
WHERE first_name = ‘John’)
INSERT INTO address_lab
( address_lab_id
, contact_lab_id
, address_type
, city
, state_province
, postal_code
, created_by
, creation_date
, last_updated_by
, last_update_date)
VALUES
( address_lab_s1.nextval
, (SELECT contact_lab_id
FROM contact_lab
WHERE first_name = ‘John’)
, (SELECT common_lookup_lab_id
From common_lookup_lab
Where common_lookup_context = ‘MULTIPLE_LAB’
And common_lookup_type = ‘HOME’)
, ‘Draper’
, ‘Utah’
, ‘84020’
, 1001
, SYSDATE
, 1001
, SYSDATE);