sp73341_external_client_lookup is the Oracle replacement for the older SQL Server external-client lookup. It returns the matched contractors email address from SYSTEM_USER_CONTRACTOR when both mail ID and last name match.
If the cursor fetch finds no row, the function explicitly returns null.
BR-VP-035 External-client email lookup requires trimmed case-insensitive matches on mail ID and last name¶
Field
Value
Statement
The function selects an email address only from SYSTEM_USER_CONTRACTOR rows whose trimmed LAST_NAME and SYSTEM_USER_ID both match the trimmed uppercase input values.
Trigger
sp73341_external_client_lookup executes.
Enforcement
The cursor query filters with upper(trim(last_name)) = upper(trim(in_last_name)) and upper(trim(system_user_id)) = upper(trim(in_mailid)).
Outcome
Only contractor rows matching both supplied identity values qualify.
FUNCTIONsp73341_external_client_lookup/********************************************************* Procedure Title : sp73341_external_client_lookup* Name : sp73341_external_client_lookup* Prepared By : valrey* Date Created : 08/29/2013* This is an oracle replacement of sp_external_client_lookup. The source is now going to be* system_user_contractor vs. net_registrant.*/(in_mailidinvarchar2,in_last_nameinvarchar2)returnvarchar2isv_email_addressvarchar2(60);cursorsu_contractor_curisselecttrim(email_address)fromsystem_user_contractorwhereupper(trim(last_name))=upper(trim(in_last_name))andupper(trim(system_user_id))=upper(trim(in_mailid));beginopensu_contractor_cur;fetchsu_contractor_curintov_email_address;ifsu_contractor_cur%notfoundthenv_email_address:=null;endif;closesu_contractor_cur;returnv_email_address;endsp73341_external_client_lookup;