Select Statements on Fields

It is possible to use a select statement in a lookup on a field. Following a select statement that fetches a record in a table, you can write .fieldName to reference a field in the table. These select statements must be used in expressions.

There is a difference between a normalselect statement and a fieldselect statement:

  • The fieldselect statement operates directly on a table.

  • The normalselect statement operates on a table buffer variable.

void selectFieldExamples ()
    // Prints the NameRef field from the selected customer
    print (select custTable order by NameRef).NameRef;
    // Uses the balance field from the customer with AccountNo 5000
    if ((select custTable where AccountNo == "5000").Balance > 500000)
    print "This customer has a balance above $500,000";

Community Additions