USP_DATAFORMTEMPLATE_VIEW_PDACCOUNTSEGMENTMAP2
The load procedure used by the view dataform template "Account Segment Map Expression View Form 2"
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. |
@SEGMENTMAPPINGTYPE | nvarchar(11) | INOUT | SEGMENTMAPPINGTYPE |
@DESCRIPTION | nvarchar(60) | INOUT | Description |
@PDACCOUNTSYSTEMID | uniqueidentifier | INOUT | System ID |
@SYSTEMNAME | nvarchar(50) | INOUT | SYSTEMNAME |
@ISCONSTANTVALUE | bit | INOUT | ISCONSTANTVALUE |
@SEGMENTTYPE | tinyint | INOUT | SEGMENTTYPE |
Definition
Copy
CREATE procedure dbo.USP_DATAFORMTEMPLATE_VIEW_PDACCOUNTSEGMENTMAP2
(
@ID uniqueidentifier,
@DATALOADED bit = 0 output,
@SEGMENTMAPPINGTYPE nvarchar(11) = null output,
@DESCRIPTION nvarchar(60) = null output,
@PDACCOUNTSYSTEMID uniqueidentifier = null output,
@SYSTEMNAME nvarchar(50) = null output
,@ISCONSTANTVALUE bit = null output
,@SEGMENTTYPE tinyint = null output
)
as
set nocount on;
-- be sure to set this, in case the select returns no rows
set @DATALOADED = 0;
-- populate the output parameters, which correspond to fields on the form. Note that
-- we set @DATALOADED = 1 to indicate that the load was successful. Otherwise, the system
-- will display a "no data loaded" message.
select
@DATALOADED = 1,
@SEGMENTMAPPINGTYPE = (
case PDACCOUNTTABLESAVAILABLEFORSEGMENTID
when '2C64A221-99F9-46F3-B35B-F3E34A3AA484' then 'EVENT'
when '428D6D21-4482-44E5-A293-6AB5BA085662' then 'APPEAL'
when '4C4A084F-597C-4CDE-BFB6-F1730397A01A' then 'PURPOSE'
when '2B1E041E-8FA3-4301-A5DB-E6531E9C3CED' then 'DESIGNATION'
else 'OTHER' end),
@DESCRIPTION = [Description],
@PDACCOUNTSYSTEMID = PDACCOUNTSYSTEMID
,@ISCONSTANTVALUE=ISCONSTANTVALUE
,@SEGMENTTYPE = SEGMENTTYPE
FROM PDACCOUNTSTRUCTURE
WHERE ID = @ID
Select @SYSTEMNAME=NAME from PDACCOUNTSYSTEM where ID = @PDACCOUNTSYSTEMID
return 0;