107: l_dummy varchar2(1);
108: --
109: cursor c1 is
110: select null
111: from pqh_templates a
112: where a.template_id = p_template_id;
113: --
114: Begin
115: --
123: and nvl(p_template_id,hr_api.g_number)
124: <> nvl(pqh_ttm_shd.g_old_rec.template_id,hr_api.g_number)
125: or not l_api_updating) then
126: --
127: -- check if template_id value exists in pqh_templates table
128: --
129: open c1;
130: --
131: fetch c1 into l_dummy;
132: if c1%notfound then
133: --
134: close c1;
135: --
136: -- raise error as FK does not relate to PK in pqh_templates
137: -- table.
138: --
139: pqh_ttm_shd.constraint_error('PQH_TRANSACTION_TEMPLATE_FK2');
140: --