USP_DATAFORMTEMPLATE_VIEW_BBNCCONSTITBUSINESSPHONEDATA
The load procedure used by the view dataform template "NetCommunity Constituent Business Phone Data 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. |
@PHONES | xml | INOUT | PHONES |
Definition
Copy
CREATE procedure dbo.USP_DATAFORMTEMPLATE_VIEW_BBNCCONSTITBUSINESSPHONEDATA
(
@ID uniqueidentifier,
@DATALOADED bit = 0 output,
@PHONES xml = null output
)
as
set nocount on;
set @DATALOADED = 0;
declare @BBNCID int;
select @BBNCID = [SEQUENCEID] from dbo.CONSTITUENT where [ID] = @ID;
declare @T table(PHONETYPE nvarchar(100),
NUMBER nvarchar(100)
);
insert into @T
(
PHONETYPE,
NUMBER
)
exec dbo.USP_BBNC_PRIMARYBUSINESSPHONES @BBNCID;
select
@DATALOADED = 1,
@PHONES =
(
select
[PHONETYPE],
[NUMBER]
from
@T
for
xml raw('ITEM'),type,elements,root('PHONES'),BINARY BASE64
);
return 0;