One to Many DataLinks in Feature Description
Is there an easy way to display multiple records from a DataLink in the Feature Description of a layer? I can only get the first record returned, how do I get the others?
0
-
Not that I have found. One method however is to make use of contenation of multple results in SQL . ie rather than using a datalink that returns n records, use a datalink that returns 1 record made from n records.
for example the follow SELECT gets the property rates history as one record.
-- --------------------
SELECT ValNum,dbo.fn_GIS_ConcatRatesHistory(ValNum) AS RatesHistory, SUE FROM dbo.tbl_GIS_Sue_Valuation
WHERE (CancelDate IS NULL)
-- --------------------
CREATE FUNCTION [dbo].[fn_GIS_ConcatRatesCvHistory](@ValNum varchar(20))
RETURNS VARCHAR(8000)
AS
BEGIN
DECLARE @CvValues VARCHAR(8000)
SELECT @CvValues = COALESCE( @CvValues + char(13), '') +
' ' + isnull(convert(nvarchar(4),Asm_Yr) + ': $' + convert(nvarchar(20),CV) ,'') + ' '
FROM (select RT_ASM_ID1 + '*' + RT_ASM_ID2 + '*' + RT_ASM_ID3 + '*' + isnull(RT_ASM_ID4,'') as ValNum
,RT_ASM_CAPVAL as CV
,RT_ASM_ID6 as Asm_Yr
from RT_ASSESSMENT) as derivedTbl
where ValNum = @ValNum
order by ValNum,Asm_Yr desc
RETURN @CvValues
END
-- --------------------
Possibly not the most robust or most perfect solution but it works.
Try a web search for information about methods for concatenating records.
Regards
Ralph Price0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
1 Kommentar