SQL::Query::ValueExpression Object

Description

Internal use only. The SQL::Query::ValueExpression object describes a value expression used in a SELECT statement. A value expression returns a data value. Value expressions are used in the select list, the WHERE clause and as input to logical and value expressions and as function arguments. The expression 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.

Notes

  1. 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.

  2. 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

ColumnReferences ReferenceList of SQL::Query:: ColumnReference

Read Only. An array of all column references in the query (including nested occurrences). Behaves the same way as .SelectTableReferences.

ArithmeticOperatorSQL::Query:: ArithmeticOperator

Read Write. See the enumeration

OperandList Object of variables in any of the following types: SQL::Query:: ValueExpression, SQL::Query:: ColumnReference, SQL::Query, Literals, Character, Numeric, Date, Time, Logical

Read Write. The arguments for the 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.

ParseTree Character

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() method on any variable holding this list when any changes are made

TokenTypeNameCharacter

Read Only. "ValueExpression".

XMLCharacter

Read Write. Creates XML from the tree or recreates the tree from the XML.

Methods

::Parse()

Accepts an optional text string and parses it. If the parse is successful, the elements of the SQL statement will be available immediately as Properties of the object.

::Reset()

Reinitializes the object as if it had just been declared.

See Also