Using XQuery in SQL Server
I've been writing a custom data list using the SDK toolkit. The data list should return all instances where an ad-hoc or smart query instance are used in a BBIS list and do not contain a specific selection in the parameters / output parameters. I am using XQuery to query the xml fields in the database and this worked perfectly for the QUERYDEFINITIONXML field in ADHOCQUERY, but I've had problems with SMARTQUERYSPEC in SMARTQUERYCATALOG. The problems have arisen because some of the characters have been replaced by their entity reference. This is not true of all xml fields, but it is enough to prevent me being able to use XQuery as far as I can tell.
I've added a screenshot below to show what the specs are like. Support couldn't tell me why the entity references were there in place of the markup delimiters, but I'm hoping one of you might have had some experience of this and can provide some insight / help.
I've added a screenshot below to show what the specs are like. Support couldn't tell me why the entity references were there in place of the markup delimiters, but I'm hoping one of you might have had some experience of this and can provide some insight / help.
0
Comments
-
I don't know why its like this in Smart Query but it was consistent and I was able to get around it using converts and was still able to use XQuery.
declare @SPECXML xml;
select @SPECXML = SMARTQUERYSPEC from SMARTQUERYCATALOG where ID = '<guid>';
declare @AdHocQuerySaveSmartQueryRequest xml;
select @AdHocQuerySaveSmartQueryRequest = convert(xml, @SPECXML.value('declare namespace d1p1 = "bb_appfx_commontypes"; (//d1p1:MetaTags)[1]', 'nvarchar(max)'), 1);
AdHocQuerySaveSmartQueryRequest1 -
Thanks Todd! That was exactly the sort of solution I was looking for
0
Categories
- All Categories
- 6 Blackbaud Community Help
- 209 bbcon®
- 1.4K Blackbaud Altru®
- 395 Blackbaud Award Management™ and Blackbaud Stewardship Management™
- 1.1K Blackbaud CRM™ and Blackbaud Internet Solutions™
- 15 donorCentrics®
- 359 Blackbaud eTapestry®
- 2.5K Blackbaud Financial Edge NXT®
- 646 Blackbaud Grantmaking™
- 563 Blackbaud Education Management Solutions for Higher Education
- 3.2K Blackbaud Education Management Solutions for K-12 Schools
- 934 Blackbaud Luminate Online® and Blackbaud TeamRaiser®
- 84 JustGiving® from Blackbaud®
- 6.4K Blackbaud Raiser's Edge NXT®
- 3.7K SKY Developer
- 243 ResearchPoint™
- 118 Blackbaud Tuition Management™
- 165 Organizational Best Practices
- 238 The Tap (Just for Fun)
- 33 Blackbaud Community Challenges
- 28 PowerUp Challenges
- 3 (Open) Raiser's Edge NXT PowerUp Challenge: Product Update Briefing
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Standard Reports+
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Email Marketing
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Gift Management
- 4 (Closed) Raiser's Edge NXT PowerUp Challenge: Event Management
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Home Page
- 4 (Closed) Raiser's Edge NXT PowerUp Challenge: Standard Reports
- 4 (Closed) Raiser's Edge NXT PowerUp Challenge: Query
- 779 Community News
- 2.9K Jobs Board
- 53 Blackbaud SKY® Reporting Announcements
- 47 Blackbaud CRM Higher Ed Product Advisory Group (HE PAG)
- 19 Blackbaud CRM Product Advisory Group (BBCRM PAG)