UFN_CONSTITUENTMATCHSCORERESULT
Return
| Return Type |
|---|
| tinyint |
Parameters
| Parameter | Parameter Type | Mode | Description |
|---|---|---|---|
| @FIELDCODE | tinyint | IN | |
| @SCORE | tinyint | IN |
Definition
Copy
create function dbo.UFN_CONSTITUENTMATCHSCORERESULT (
@FIELDCODE tinyint,
@SCORE tinyint
)
returns tinyint
begin
declare @RESULT tinyint
select @RESULT = RESULTCODE
from dbo.CONSTITUENTMATCHSCORERESULT
where FIELDCODE = @FIELDCODE
and @SCORE between MINSCORE and MAXSCORE
-- Score below the thresholds in the table is not a match
if @RESULT is null
set @RESULT = 3
return @RESULT
end