SQL::Query::LogicalExpression Object
Description
Internal use only. The SQL::Query::LogicalExpression object describes a logical expression used in a SELECT statement. A logical expression returns a logical (boolean) result. Logical expressions are used in the WHERE clause and as input to value expressions and function arguments. The SQL::Query::LogicalExpression object is simple, but any operand may be an expression itself, meaning that a tree of operator and their respective operands can nest down many levels.
The parser checks for parentheses and uses them to build the proper tree, but does not currently remember where the original script included them. as a result, the routines that generate SQL generally wrap parentheses in the output to guarantee correctness.
The parser checks many cases for the correct number and type of operands. If you build the tree in Xbasic, you are responsible for validating the syntax tree.
Properties
- ColumnReferencesReferenceList of SQL::Query:: ColumnReference
Read Only. An array of all column references in the query (including nested occurrences). Behaves the same way as .SelectTableReferences.
- LogicalOperatorSQL::Query::LogicalOperator
Read Write. See Enumerated Type Values.
- OperandList Object of one of the following object types: SQL::Query:: ValueExpression, SQL::Query:: LogicalExpression, SQL::Query:: ColumnReference, SQL::Query
Read Write. The operands for the respective operator.
- ErrorColumnNumeric
Read Only. The column number of the last error reported by the parser.
- ErrorTextCharacter
Read Only. The text of the last parser error reported.
- FunctionReferencesReferenceList of SQL::Query:: ValueExpression
Read Only. An array of all function calls. Behaves the same way as .SelectTableReferences.
- ObjectDefinitionsCharacter
Read Only. For internal debugging. Returns a string description of the mapping between the ANTLR grammar and the Xbasic objects.
- ParseTreeCharacter
Read Only. For internal debugging. A string description of the underlying parse tree.
- SQLStatementCharacter
Read Write. A variable that can be assigned a syntax string without parsing it. If no value is passed to the Parse() method, this value is used.
- SelectTableReferencesReferenceList of SQL::Query:: SelectTableReference
Read Only. An array of all table references in the query (including those nested inside of sub-selects and joins). This array is created when the property is requested, but can become out of date. Use the Resynch() function on any variable holding this list when any changes are made.
- TokenTypeNameCharacter
Read Only. "LogicalExpression".
- XMLCharacter
Read Write. Creates XML from the tree or recreates the tree from the XML.
Methods
- ::Parse()
Parses the SQL statement passed (or the value previously set into the .SQLStatement property).
- ::Reset()
Resets the query as if it had just been created.
See Also