USP_DATAFORMTEMPLATE_EDITLOAD_ACADEMICCATALOGDEPARTMENT
The load procedure used by the edit dataform template "Academic Catalog Department 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. |
@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. |
@PARENT | nvarchar(150) | INOUT | Parent |
@USERID | nvarchar(50) | INOUT | ID |
@NAME | nvarchar(150) | INOUT | Name |
@DATEFROM | UDT_FUZZYDATE | INOUT | Date from |
@MAKEHISTORICAL | bit | INOUT | Move to catalog history |
@TYPE_CODE | tinyint | INOUT | Type code |
@HISTORY | xml | INOUT | Catalog history |
@ISHISTORICAL | bit | INOUT | Historical |
@PARENT_TYPE_CODE | tinyint | INOUT | Type code |
Definition
Copy
CREATE procedure dbo.USP_DATAFORMTEMPLATE_EDITLOAD_ACADEMICCATALOGDEPARTMENT
(
@ID uniqueidentifier,
@DATALOADED bit = 0 output,
@TSLONG bigint = 0 output,
@PARENT nvarchar(150) = null output,
@USERID nvarchar(50) = null output,
@NAME nvarchar(150) = null output,
@DATEFROM dbo.UDT_FUZZYDATE = null output,
@MAKEHISTORICAL bit = null output,
@TYPE_CODE tinyint = null output,
@HISTORY xml = null output,
@ISHISTORICAL bit = null output,
@PARENT_TYPE_CODE tinyint = null output
)
as
set nocount on;
set @DATALOADED = 0;
set @TSLONG = 0;
select
@DATALOADED = 1,
@TSLONG = DEPARTMENT.TSLONG,
@USERID = DEPARTMENT.USERID,
@NAME = DEPARTMENT.NAME,
@DATEFROM = DEPARTMENT.DATEFROM,
@PARENT = coalesce(COLLEGE.NAME, DIVISION.NAME),
@TYPE_CODE = 5, --Department
@ISHISTORICAL = DEPARTMENT.ISHISTORICAL,
@PARENT_TYPE_CODE = case when DEPARTMENT.ACADEMICCATALOGCOLLEGEID is null then 4 else 3 end
from
dbo.ACADEMICCATALOGDEPARTMENT as DEPARTMENT
left join dbo.ACADEMICCATALOGCOLLEGE as COLLEGE
on DEPARTMENT.ACADEMICCATALOGCOLLEGEID = COLLEGE.ID
left join dbo.ACADEMICCATALOGDIVISION as DIVISION
on DEPARTMENT.ACADEMICCATALOGDIVISIONID = DIVISION.ID
where
DEPARTMENT.ID = @ID;
set @HISTORY = dbo.UFN_ACADEMICCATALOG_GETHISTORY_TOITEMLISTXML(5, @ID)
return 0;