Top Method Summary
Options Name Purpose
AddQueryWhere (character, character, character) Inserts a new expression to query's prepare string for a specified buffer.
CHARACTER BuildQueryString (handle) Builds the QueryString for the Query
LOGICAL CanAddRefTables (character, integer, character) Evaluates if pcRefTables can be added to piTableLevel entry in a pcTables ordered query
CHARACTER CheckIndex (handle) Returns the Index information of the query used for a buffer
ClearQuery () Clears the internal state to allow parsing another query string
Debug () Displays debug-information
CHARACTER EscapeKnownFunction (character) Escapes the brackets around known ABL functions in the query string
ExpandDateEqualityExpressions (handle) Expands date equality expressions on datetime or datetime-tz fields into range expressions (>= date AND < date + 1)
CHARACTER GetEvaluation (integer) Returns the fully assembled query expression for an evaluation entry
CHARACTER GetEvaluationTables (integer, character) Returns the list of tables referenced by expressions in an evaluation entry
CHARACTER GetTableEvaluation (integer, integer, character) Performs the Query evaluation for a table
CHARACTER InsertExpression (character, character, character) Inserts an expression into ONE buffer's where-clause.
CHARACTER InsertString (character, character, integer, integer) Workaround for temporary core bug
LOGICAL InsertToQuery (handle) Insert the QueryString into the query
CHARACTER NewQuerySort (character, character) /*- Purpose : Insert sort criteria (BY phrase) in a QueryString. Notes: @param pcQuery Query String to add sort to (current sort will be replaced) @param pcSort New sort expression @return The new query string */
ParseListQueryExpression (ListQueryExpression, integer, integer) Parses a ListQueryExpression instance
ParseQuery (character) Parses the logical buffer's target query and stores it for transformation to the datasource query.
ParseQuery (IQueryExpression, ListSortField) Parses the logical buffer's target query and stores it for transformation to the datasource query.
ParseSortExpression (character) Parses the Sort Expression
CHARACTER ResolveColumn (character, integer) Resolves a temp-table column reference to the corresponding database source column using the IQueryMap callback
CHARACTER SortExpression (character) Returns the sort expression of the passed querystring
UnescapeKnownFunctions (character[]) Restores escaped brackets, commas and spaces in parsed expressions

Top Constructor Summary
Options Name Purpose
QueryString (character, IQueryMap) Constructor of the QueryString class

Top Property Summary
Options Name Purpose
LOGICAL FilterUsingInnerJoin
LOGICAL ThrowErrorsOnInvalidSourceMapping


Method Detail
Top

AddQueryWhere (character, character, character)

Purpose: Inserts a new expression to query's prepare string for a
specified buffer.
Notes:

Parameters:
pcBuffer CHARACTER
The name of the Buffer
pcExpression CHARACTER
The new expression
pcAndOr CHARACTER
Specifies what operator is used to add the new expression to existing expression(s), AND (default) / OR
Top

CHARACTER BuildQueryString (handle)

Purpose: Builds the QueryString for the Query
Notes:

Parameters:
phQuery HANDLE
The HANDLE of the QUERY widget
Returns CHARACTER
The Query String
Top

LOGICAL CanAddRefTables (character, integer, character)

Purpose: Evaluates if pcRefTables can be added to piTableLevel entry in a
pcTables ordered query
Notes:

Parameters:
pcRefTables CHARACTER
The references tables
piTableLevel INTEGER
The current table level
pcTables CHARACTER
The tables to be added
Returns LOGICAL
Logical value indicating if pcRefTables can be added to piTableLevel entry in a pcTables ordered query
Top

CHARACTER CheckIndex (handle)

Purpose: Returns the Index information of the query used for a buffer
Notes: For debugging/logging purposes only

Parameters:
phBuffer HANDLE
The handle to the buffer to return index information for
Returns CHARACTER
The index information of the query used for the buffer handle
Top

ClearQuery ()

Purpose: Clears the internal state to allow parsing another query string
Notes:

Top

Debug ()

Purpose: Displays debug-information
Notes:

Top

CHARACTER EscapeKnownFunction (character)

Purpose: Escapes the brackets around known ABL functions in the query string
Notes: SCL-1201, workaround for parsing issues with RECID() or ROWID()
function used in the query string

Parameters:
pcQueryString CHARACTER
The Query String to escape
Returns CHARACTER
The query string with the escaped brackets
Top

ExpandDateEqualityExpressions (handle)

Purpose: Expands date equality expressions on datetime or datetime-tz
fields into range expressions (>= date AND < date + 1)
Notes: SCL-5213, when a query uses = or EQ with a date-only value on a
datetime or datetime-tz column, the equality is expanded to a
range check for the full day

Parameters:
phQuery HANDLE
The handle of the QUERY widget to look up field data types
Top

CHARACTER GetEvaluation (integer)

Purpose: Returns the fully assembled query expression for an evaluation entry
Notes: Recursively resolves expression and parenthesis references

Parameters:
piEval INTEGER
The index of the evaluation entry to assemble
Returns CHARACTER
The assembled query expression string
Top

CHARACTER GetEvaluationTables (integer, character)

Purpose: Returns the list of tables referenced by expressions in an evaluation entry
Notes:

Parameters:
piEval INTEGER
The index of the evaluation entry to inspect
pcTables CHARACTER
The accumulated comma-delimited list of referenced tables
Returns CHARACTER
The comma-delimited list of all tables referenced in the evaluation
Top

CHARACTER GetTableEvaluation (integer, integer, character)

Purpose: Performs the Query evaluation for a table
Notes:

Parameters:
piEval INTEGER
The index of the evaluation entry (parenthesis level) to process
piTableEntry INTEGER
The entry of the table in the table list
pcTables CHARACTER
The comma-delimited list of tables in the query
Returns CHARACTER
The evaluated query string for the specified table
Top

CHARACTER InsertExpression (character, character, character)

Purpose: Inserts an expression into ONE buffer's where-clause.
Notes: - The new expression is embedded in parenthesis and a parentheses
is also placed around the existing one, which is different.
than the original ADM's version which is just appended
This would be problematic in adm, as it would be to many
parenthesises.
(could be improved to check for any OR and avoid parenthesis if not
found )
- Lock keywords must be unabbreviated or without -lock (i.e. SHARE
or EXCLUSIVE.)
- Any keyword in comments may cause problems.

Parameters:
pcWhere CHARACTER
Complete where clause with or without the FOR keyword, but without any comma before or after.
pcExpression CHARACTER
New expression OR OF phrase (Existing OF phrase is replaced)
pcAndOr CHARACTER
Specifies what operator is used to add the new expression to existing ones. AND (default)/OR
Returns CHARACTER
The new query string
Top

CHARACTER InsertString (character, character, integer, integer)

Purpose: Workaround for temporary core bug
Notes:

Parameters:
pcString CHARACTER
The String to insert
pcTargetString CHARACTER
The String to insert into
piPos INTEGER
The position to insert
piLength INTEGER
The length of the original string
Returns CHARACTER
The resulting string
Top

LOGICAL InsertToQuery (handle)

Purpose: Insert the QueryString into the query
Notes: Actually performs QUERY-PREPARE on the Query-Handle

Parameters:
phQuery HANDLE
The HANDLE of the QUERY widget
Returns LOGICAL
True if successful
Top

CHARACTER NewQuerySort (character, character)

Purpose : Insert sort criteria (BY phrase) in a QueryString.
Notes:

Parameters:
pcQuery CHARACTER
Query String to add sort to (current sort will be replaced)
pcSort CHARACTER
New sort expression
Returns CHARACTER
The new query string
Top

ParseListQueryExpression (ListQueryExpression, integer, integer)

Purpose: Parses a ListQueryExpression instance
Notes: See main comments

Parameters:
poQuery Consultingwerk.ListQueryExpression
The ListQueryExpression to parse
piExpressionCount INTEGER
The count of expressions in the query expression
piParenthesesCount INTEGER
The count of parentheses in the query expression
Top

ParseQuery (character)

Purpose: Parses the logical buffer's target query and stores it for
transformation to the datasource query.
Notes: See main comments

Parameters:
pcQuery CHARACTER
The QueryString to parse
Top

ParseQuery (IQueryExpression, ListSortField)

Purpose: Parses the logical buffer's target query and stores it for
transformation to the datasource query.
Notes: See main comments

Parameters:
poQueryExpression Consultingwerk.IQueryExpression
The QueryExpression to parse
poQuerySort Consultingwerk.ListSortField
The ListSortField for the query
Top

ParseSortExpression (character)

Purpose: Parses the Sort Expression
Notes:

Parameters:
pcSort CHARACTER
The sort expression to parse
Top

CHARACTER ResolveColumn (character, integer)

Purpose: Resolves a temp-table column reference to the corresponding
database source column using the IQueryMap callback
Notes: Also tracks table references per expression and globally

Parameters:
pcColumn CHARACTER
The temp-table qualified column name to resolve
piExp INTEGER
The expression index to track the table reference for (0 for sort expressions)
Returns CHARACTER
The resolved source (database) column name
Top

CHARACTER SortExpression (character)

Purpose: Returns the sort expression of the passed querystring
Notes: Includes the first BY also (getQuerySort does not) and
removes extra spaces.

Parameters:
pcQueryString CHARACTER
The complete QueryString
Returns CHARACTER
The sort expression of the QueryString including the first BY
Top

UnescapeKnownFunctions (character[])

Purpose: Restores escaped brackets, commas and spaces in parsed expressions
Notes: Called after tokenization to undo the escaping performed by
EscapeKnownFunction for ABL functions like RECID, ROWID, etc.

Parameters:
pcKnownFunctions CHARACTER
The list of function names that were escaped


Constructor Detail
Top

QueryString (character, IQueryMap)

Purpose: Constructor of the QueryString class
Notes:

Parameters:
pcQueryWhere CHARACTER
The query string to parse
poQueryMap Consultingwerk.OERA.Query.IQueryMap
The reference to the IQueryMap instance that provides call backs for the query manipulation


Property Detail
Top

LOGICAL FilterUsingInnerJoin


Returns LOGICAL
Top

LOGICAL ThrowErrorsOnInvalidSourceMapping


Returns LOGICAL


©2006-2026 Consultingwerk Ltd.         info@consultingwerk.de         http://www.consultingwerk.de       13.04.2026 10:22:33