cp_external_client_lookup looks up an external-client registrant row from EIS_PROD.dbo.Net_Registrant. The retrieved body filters on trimmed ID and last-name equality, excludes inactive and test users, and returns the most recently updated match.
The procedure returns TOP 1 from Net_Registrant after trimmed ID and last-name matching, restricted to active non-test rows and ordered by latest update date.
BR-VP-041 External-client lookup returns the latest active non-test registrant that matches the supplied ID and last name¶
Field
Value
Statement
The external-client lookup returns only rows whose trimmed ID_NUM and USER_LAST_NAM match the input values, whose ACTIVE_FL = 'Y', whose TEST_USER_FL = 'N', and whose UPDATE_DATE is greatest.
Trigger
cp_external_client_lookup executes.
Enforcement
The query filters on trimmed ID and last-name equality, active and non-test flags, orders by reg.UPDATE_DATE DESC, and selects TOP 1 *.
Outcome
Callers receive the most recently updated active production registrant row for the supplied identity values.
Source
SQL Server retrieval JSON: C:\Users\chrfre\AppData\Local\Temp\oracle-sources\cp_external_client_lookup.json
CreateProceduredbo.cp_external_client_lookup-- LIST PARAMETERS@idNumchar(100),@clientLastNamechar(255)AS/*--------------------------------------------------------------------------------Procedure Name: cp_external_client_lookupDate Written: 01/08/2007Author: Jerry Todd (JERTOD)Installation: SAIF CorporationSource File: cp_external_client_lookup.sql Description: This procedure looks up an external client's mailid based on the client's user number PARMS: client ID number and client Last NameModifications:--------------------------------------------------------------------------------*/setnocountonSETTRANSACTIONISOLATIONLEVELREADUNCOMMITTED;selecttop1*fromEIS_PROD.dbo.Net_Registrantregwherertrim(reg.ID_NUM)=rtrim(@idNum)andrtrim(reg.USER_LAST_NAM)=rtrim(@clientLastName)andreg.ACTIVE_FL='Y'ANDreg.TEST_USER_FL='N'orderbyreg.UPDATE_DATEdesc/* END THE PROCEDURE */Return