Synergex.SynergyDE.Select.NoCaseGroupBy

WTSupported in traditional Synergy on Windows
WNSupported in Synergy .NET on Windows
USupported on UNIX
VSupported on OpenVMS
namespace Synergex.SynergyDE.Select
public class GroupBy
public class NoCaseGroupBy extends GroupBy

The NoCaseGroupBy class extends the GroupBy class. Like the GroupBy class, the NoCaseGroupBy object provides a subset of the functionality of a SQL “GROUP BY” clause, which arranges identical data into groups, and returns distinct records based on field specifications. However, NoCaseGroupBy is designed for alpha fields that require a case-insensitive sort and cannot be used with integer fields, while GroupBy is case sensitive and can also be used with integer fields.

Important

Once created, any object used by the Select (From, Where, NoCaseWhere, GroupBy, NoCaseGroupBy, On, OrderBy, NoCaseOrderBy, and Sparse) must remain in contact with the same record(s) specified in the From object(s) as well as fields referenced in the Where, NoCaseWhere, On, OrderBy, and Sparse objects that are contained in the record(s). In other words, you can’t create one of these objects and pass it to another routine unless that routine has direct access to the original record. If this is not the case, an InvalidOperationException or $ERR_INVOPER error (“Where operator requires at least one field reference”) will result when creating the Select object. On the other hand, all data references outside a From object’s record are copied during the object’s creation and are not required to remain in contact with the original data.

Methods

Ascending

public static varargs Ascending(field1, ...), @NoCaseGroupBy

Declares a list of fields (MISMATCH n), separated by commas, by which the selected records will be grouped in ascending order upon being returned.

Descending

public static varargs Descending(field1, ...), @NoCaseGroupBy

Declares a list of fields (MISMATCH n), separated by commas, by which the selected records will be grouped in descending order upon being returned.

Operators

The logical and operator (&& or .AND.) is supported and is equivalent to its Synergy counterpart. See Expressions for more information about this operator.

Discussion

When Ascending() or Descending() is used, the entire selection is read from the specified file when the AlphaEnumerator object is created (on Select.GetEnumerator() or FOREACH). Changes to the file after making the selection may not be reflected in the records retrieved, especially if a record that matches the selection criteria is updated or inserted.

The fields specified by Ascending() and Descending() must be in the record specified in the From class object. If they are not, an InvalidOperationException or $ERR_INVOPER error (“Field reference not entirely part of specified record”) will be generated at runtime.

You can combine multiple fields in your group criteria using the .AND. operator. For example,

sobj = new Select(from, wobj, 
&  NoCaseGroupBy.Ascending(fld1).and.NoCaseGroupBy.Ascending(fld2))

If you need case-sensitive grouping of records, use Synergex.SynergyDE.Select.GroupBy. You can combine GroupBy and NoCaseGroupBy using .AND. if only some fields require case-insensitivity or if some fields are integer.