<< Click to Display Table of Contents >>
Index expression should be valid VO expressions, but these expressions are rarely valid SQL expressions. We therefore need to translate the index expression to its SQL counterpart.
The Vo2ADO RDD has a built-in index expression parser that parses your index expression. What it does is the following:
•First it parses the index expression and tries to locate the field names, function, operators and constants that you have used in your expression.
•For every field name it checks if the field name is valid for the ADO workarea. If you have used a name that doesn't exist an error will be generated.
•For every function in the VO key expression, the RDD calls back into the program's Vo2SQLFunction Callback method, allowing you to replace the function with the equivalent for your server/provider. The function names will have the following layout: UPPER(%1%) or STR(%1%,%2%, %3%) etc.
•The RDD also calls back to find the string concatenator ('+' sign). Some providers use another operator such as '||'
•After this a corresponding ADO Index expression is built by putting the index key elements back in place.
•The ADO index key expression is then used to build
•an OrderBy clause to open the data
•a Where clause when you are Seeking in the workarea
•Where clauses when you are setting Scopes
•If your index expression is a simple expression (without functions) the ADO RDD will also build an index on the server.
•When building where clauses the Vo2ADO RDD uses the SUBSTR() function if you are seeking on partial strings, or setting scopes on partial key values