USP_DATAFORMTEMPLATE_VIEW_BBNCCONSTITADDRESSDATA
The load procedure used by the view dataform template "NetCommunity Constituent Preferred Address 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. |
@COUNTRYLONG | nvarchar(100) | INOUT | COUNTRYLONG |
@COUNTRYSHORT | nvarchar(5) | INOUT | COUNTRYSHORT |
@ADDRESSBLOCK | nvarchar(150) | INOUT | ADDRESSBLOCK |
@CITY | nvarchar(50) | INOUT | CITY |
@STATE | nvarchar(100) | INOUT | STATE |
@POSTCODE | nvarchar(12) | INOUT | POSTCODE |
Definition
Copy
CREATE procedure dbo.USP_DATAFORMTEMPLATE_VIEW_BBNCCONSTITADDRESSDATA
(
@ID uniqueidentifier,
@DATALOADED bit = 0 output,
@COUNTRYLONG nvarchar(100) = null output,
@COUNTRYSHORT nvarchar(5) = null output,
@ADDRESSBLOCK nvarchar(150) = null output,
@CITY nvarchar(50) = null output,
@STATE nvarchar(100) = null output,
@POSTCODE nvarchar(12) = null output
)
as
set nocount on;
set @DATALOADED = 0;
declare @BBNCID int;
select
@DATALOADED = 1,
@BBNCID = [SEQUENCEID]
from
dbo.CONSTITUENT
where
[ID] = @ID;
declare @T table(COUNTRYLONG nvarchar(100),
COUNTRYSHORT nvarchar(5),
ADDRESSBLOCK nvarchar(150),
CITY nvarchar(50),
STATE nvarchar(100), --TMV 4/17/2007 CR272644-041207 For UK and New Zealand states we get the full description so the data type size needs to match
POSTCODE nvarchar(12),
FORMATTEDADDRESS nvarchar(300),
COUNTRYADDRESSFORMATID uniqueidentifier,
TYPECODE uniqueidentifier
);
insert into @T
(
COUNTRYLONG,
COUNTRYSHORT,
ADDRESSBLOCK,
CITY,
STATE,
POSTCODE,
FORMATTEDADDRESS,
COUNTRYADDRESSFORMATID,
TYPECODE
)
exec dbo.USP_BBNC_CONSTITPRIMARYADDRESSDATA @BBNCID;
select top 1
@COUNTRYLONG = [COUNTRYLONG],
@COUNTRYSHORT = [COUNTRYSHORT],
@ADDRESSBLOCK = [ADDRESSBLOCK],
@CITY = [CITY],
@STATE = [STATE],
@POSTCODE = [POSTCODE]
from @T;
return 0;