UFN_SPROPPCHILD_VALID_GENDERCODE_FOR_GROUP
Validates the gender code on the child sponsorship opportunity with the specified sponsorship group.
Return
Return Type |
---|
bit |
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@ID | uniqueidentifier | IN | |
@GENDERCODE | tinyint | IN |
Definition
Copy
create function dbo.UFN_SPROPPCHILD_VALID_GENDERCODE_FOR_GROUP
(
@ID uniqueidentifier,
@GENDERCODE tinyint
)
returns bit
with execute as caller
as begin
declare @GCODE tinyint;
select
@GCODE = SG.GENDERCODE
from
SPONSORSHIPOPPORTUNITY SO
inner join SPONSORSHIPOPPORTUNITYGROUP SG on SO.SPONSORSHIPOPPORTUNITYGROUPID = SG.ID
where
SO.ID = @ID;
/* 0 = Any on group or the gender code on child = gender code on group. */
if @GCODE = 0 or @GENDERCODE = @GCODE
return 1;
return 0;
end