USP_DATAFORMTEMPLATE_EDITLOAD_EDUCATIONDEMOGRAPHIC

The load procedure used by the edit dataform template "Education Demographic Edit Data Form"

Parameters

Parameter Parameter Type Mode Description
@ID uniqueidentifier IN The input ID parameter used to load the fields defined on the form.
@DATALOADED bit INOUT Output parameter indicating whether or not data was actually loaded.
@RELIGIONCODEID uniqueidentifier INOUT Religion
@BIRTHPLACE nvarchar(50) INOUT Birthplace
@DENOMINATIONCODEID uniqueidentifier INOUT Denomination
@CHURCHAFFILIATIONCODEID uniqueidentifier INOUT Church affiliation
@ISHISPANICLATINO bit INOUT Is Hispanic/Latino
@DEMOGRAPHICETHNICITIES xml INOUT Ethnicities
@TSLONG bigint INOUT Output parameter indicating the TSLONG value of the record being edited. This is used to manage multi-user concurrency issues when multiple users access the same record.

Definition

Copy


CREATE procedure dbo.USP_DATAFORMTEMPLATE_EDITLOAD_EDUCATIONDEMOGRAPHIC(
    @ID uniqueidentifier,
    @DATALOADED bit = 0 output,
    @RELIGIONCODEID uniqueidentifier = null output,
    @BIRTHPLACE nvarchar(50) = null output,
    @DENOMINATIONCODEID uniqueidentifier = null output,
    @CHURCHAFFILIATIONCODEID uniqueidentifier = null output,
    @ISHISPANICLATINO bit = null output,
    @DEMOGRAPHICETHNICITIES xml = null output,
    @TSLONG bigint = 0 output
) as
    set nocount on;

    set @DATALOADED = 0;
    set @TSLONG = 0;

    select
        @DATALOADED = 1,
        @ID = C.ID,
        @RELIGIONCODEID = D.RELIGIONCODEID,
        @BIRTHPLACE = D.BIRTHPLACE,
        @DENOMINATIONCODEID = D.DENOMINATIONCODEID,
        @CHURCHAFFILIATIONCODEID = D.CHURCHAFFILIATIONCODEID,
        @ISHISPANICLATINO = D.ISHISPANICLATINO,
        @DEMOGRAPHICETHNICITIES = dbo.UFN_CONSTITUENT_GETETHNICITIES_TOITEMLISTXML(@ID),
        @TSLONG = D.TSLONG
    from dbo.CONSTITUENT C
        left outer join dbo.DEMOGRAPHIC D with (nolock) on D.ID = C.ID
    where 
        C.ID = @ID

    return 0;