USP_DATAFORMTEMPLATE_VIEW_BBNCCONSTITBUSINESSDATA
The load procedure used by the view dataform template "NetCommunity Constituent Primary Business 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. |
@NAME | nvarchar(154) | INOUT | NAME |
@POSITION | nvarchar(100) | INOUT | POSITION |
@INDUSTRY | nvarchar(100) | INOUT | INDUSTRY |
@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_BBNCCONSTITBUSINESSDATA
(
@ID uniqueidentifier,
@DATALOADED bit = 0 output,
@NAME nvarchar(154) = null output,
@POSITION nvarchar(100) = null output,
@INDUSTRY nvarchar(100) = null 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
@BBNCID = [SEQUENCEID],
@DATALOADED = 1
from
dbo.CONSTITUENT
where
[ID] = @ID;
declare @T table(NAME nvarchar(154),
POSITION nvarchar(100),
INDUSTRY nvarchar(100),
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,
REGION nvarchar(200)
);
insert into @T
(
NAME,
POSITION,
INDUSTRY,
COUNTRYLONG,
COUNTRYSHORT,
ADDRESSBLOCK,
CITY,
STATE,
POSTCODE,
FORMATTEDADDRESS,
COUNTRYADDRESSFORMATID,
REGION
)
exec dbo.USP_BBNC_CONSTITPRIMARYBUSINESSDATA @BBNCID;
select top 1
@NAME = [NAME],
@POSITION = [POSITION],
@INDUSTRY = [INDUSTRY],
@COUNTRYLONG = [COUNTRYLONG],
@COUNTRYSHORT = [COUNTRYSHORT],
@ADDRESSBLOCK = [ADDRESSBLOCK],
@CITY = [CITY],
@STATE = [STATE],
@POSTCODE = [POSTCODE]
from @T;
return 0;