USP_DATAFORMTEMPLATE_VIEW_MKTSEGMENTATIONSEED

The load procedure used by the view dataform template "Marketing Effort Seeds View 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.
@SEEDS xml INOUT Seeds
@SEGMENTATIONACTIVE bit INOUT Active
@SEGMENTATIONSITEID uniqueidentifier INOUT Marketing effort site id
@DEFAULTCOUNTRYID uniqueidentifier INOUT

Definition

Copy


CREATE procedure dbo.[USP_DATAFORMTEMPLATE_VIEW_MKTSEGMENTATIONSEED]
(
  @ID uniqueidentifier,  
  @DATALOADED bit = 0 output,
  @SEEDS xml = null output,
  @SEGMENTATIONACTIVE bit = null output,
  @SEGMENTATIONSITEID uniqueidentifier = null output,
  @DEFAULTCOUNTRYID uniqueidentifier = null output
)
as
  /* @ID is the Mailing ID */

  set nocount on;

  set @DATALOADED = 0;

  select 
    @DATALOADED = 1,
    @SEGMENTATIONACTIVE = [ACTIVE],
    @SEGMENTATIONSITEID = [SITEID]
  from dbo.[MKTSEGMENTATION]
  where [ID] = @ID;

  if @DATALOADED = 1 and @SEGMENTATIONACTIVE = 0
    begin
      --Check if the mailing is currently being activated...

      declare @R int;
      exec @R = dbo.[USP_MKTSEGMENTATION_CHECKACTIVATION] @ID;
      if @R <> 0
        begin
          set @DATALOADED = 0;
          return 1;
        end
    end

  exec @SEEDS = dbo.[UFN_MKTSEGMENTATIONSEED_GETSEEDS_2_TOITEMLISTXML] @ID, null, 1, null, 1;

  set @DEFAULTCOUNTRYID = dbo.[UFN_COUNTRY_GETDEFAULT]();

  return 0;