USP_DATAFORMTEMPLATE_EDITLOAD_STUDENTBIO

The load procedure used by the edit dataform template "Student Biographical Edit 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.
@LASTNAME nvarchar(100) INOUT Last name
@FIRSTNAME nvarchar(50) INOUT First name
@MIDDLENAME nvarchar(50) INOUT Middle name
@NICKNAME nvarchar(50) INOUT Nickname
@SUFFIXCODEID uniqueidentifier INOUT Suffix
@GENDERCODE tinyint INOUT Gender
@BIRTHDATE UDT_FUZZYDATE INOUT Birth date
@AGE int INOUT Age
@PICTURE varbinary INOUT Image
@PICTURETHUMBNAIL varbinary INOUT Image thumbnail
@PICTURECHANGED bit INOUT Picture changed
@WEBADDRESS UDT_WEBADDRESS INOUT Website
@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.
@TITLECODEID uniqueidentifier INOUT Title
@ISDECEASED bit INOUT

Definition

Copy

                CREATE procedure dbo.USP_DATAFORMTEMPLATE_EDITLOAD_STUDENTBIO(
                    @ID uniqueidentifier,
                    @DATALOADED bit = 0 output,
                    @LASTNAME nvarchar(100) = null output,
                    @FIRSTNAME nvarchar(50) = null output,
                    @MIDDLENAME nvarchar(50) = null output,
                    @NICKNAME nvarchar(50) = null output,
                    @SUFFIXCODEID uniqueidentifier = null output,
                    @GENDERCODE tinyint = null output,
                    @BIRTHDATE dbo.UDT_FUZZYDATE = null output,
                    @AGE int = null output,
                    @PICTURE varbinary(max) = null output,
                    @PICTURETHUMBNAIL varbinary(max) = null output,
                    @PICTURECHANGED bit = null output,
                    @WEBADDRESS dbo.UDT_WEBADDRESS = null output,
                    @TSLONG bigint = 0 output,
                    @TITLECODEID uniqueidentifier = null output,
                    @ISDECEASED bit = null output
                ) as
                    set nocount on;

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

                    select
                        @DATALOADED = 1,
                        @ID = [CONSTITUENT].ID,
                        @LASTNAME = CONSTITUENT.KEYNAME,
                        @FIRSTNAME = CONSTITUENT.FIRSTNAME,
                        @MIDDLENAME = CONSTITUENT.MIDDLENAME,
                        @NICKNAME = CONSTITUENT.NICKNAME,
                        @SUFFIXCODEID = CONSTITUENT.SUFFIXCODEID,
                        @TITLECODEID = CONSTITUENT.TITLECODEID,
                        @GENDERCODE = CONSTITUENT.GENDERCODE,
                        @BIRTHDATE = CONSTITUENT.BIRTHDATE,
                        @AGE = case when DECEASEDCONSTITUENT.ID is null then CONSTITUENT.AGE else null end,
                        @PICTURETHUMBNAIL = CONSTITUENT.PICTURETHUMBNAIL,
                        @WEBADDRESS = CONSTITUENT.WEBADDRESS,
                        @TSLONG = [CONSTITUENT].TSLONG,
                        @ISDECEASED = case when DECEASEDCONSTITUENT.ID is null then 0 else 1 end

                    from
                        dbo.CONSTITUENT
                        inner join dbo.STUDENT on CONSTITUENT.ID = STUDENT.ID
                        left join dbo.DECEASEDCONSTITUENT on CONSTITUENT.ID = DECEASEDCONSTITUENT.ID
                    where
                        [CONSTITUENT].ID = @ID ;


                      --,@STUDENTID nvarchar(50) = null output
                      --,@STUDENTID= STUDENTID
                    return 0;