Dynamic queries validation

By Diogo Cordeiro on 27 Aug 2011
Sometimes one really needs to create dynamic queries, and then there you go : Partial (or even complete) Queries migrate from advanced query widgets to assigns...Urray professional bug finders : take your challenge.

I throw to the thin, odd summer air, two possible solutions for this :

1 - Live with what you have and build above it solution

Check inside assigns (either all assigns, or recursive checks into advanced query input parameters assigns) for query parts, just like you were validating advanced queries....

2 - Apply the build to change, and add a new feature to Service Studio

As you have special keyletters/words detected inside Advanced query, there could be some kind of letters that would indicate : Beginning of condion , End of condition; Begin of conditional code, end of conditional code.

Something Like this

Inputs : @Condition1

Select a.* from a 

?Begin @Condition1?
inner join b on b.Id = a.bId
?End Condition1?

J.29 Aug 2011
Unless logging is improved this would be a nice alternative
Kilian Hekhuis31 Aug 2011

The only downside I see to this is that we'd have a programming language inside a programming language. I have many cases of these dynamic queries being built by switches, not just ifs, and the conditions may very well contain function calls instead of just some checks whether filter parameters are filled. This could quickly grow out of hand.