Splits a compound query into two queries when you need to run a slightly different query
because of fundamental incompatibilities.
Namespace: CleanCode.DataAssembly: CleanCode (in CleanCode.dll) Version: 1.2.3.0 (1.2.03)
public void SplitQuery(
string compoundQuery,
out string trueQuery,
out string falseQuery
)
public void SplitQuery(
string compoundQuery,
out string trueQuery,
out string falseQuery
)
Public Sub SplitQuery ( _
compoundQuery As String, _
<OutAttribute> ByRef trueQuery As String, _
<OutAttribute> ByRef falseQuery As String _
)
public:
void SplitQuery(
String^ compoundQuery,
[OutAttribute] String^% trueQuery,
[OutAttribute] String^% falseQuery
)
Parameters
- compoundQuery
- Type: System String
Instrumented query to be split
- trueQuery
- Type: System String
Returned query instance on true condition.
- falseQuery
- Type: System String
Returned query instance on false condition.
A typical example of this is if a new table is introduced in a later version, queries
that reference that table will not be compilable in earlier versions. So this function
acts as a macro pre-processor to split out the query into its two valid incantations.
The query must be specially constructed, containing
<IF>...<ELSE>...<END>
constructs, each on a separate line. So they do not interfere with the query, each should
be preceded with the comment indicator "--". Further, within the ELSE clause each line
must be commented out with a comment indicator followed by a double-asterisk ("--**").
That allows the compound query to run without alteration, and is thus functionally
equivalent to the returned
trueQuery. Multiple instances of IF...ELSE...END may
appear in the query.