QueryRecord Collection Methods

In this section, we discuss each QueryRecord collection method. The methods are discussed in alphabetical order.

Syntax

First()

Description

The First method returns the first QueryRecord object in the QueryRecord collection.

Parameters

None.

Returns

A reference to a QueryRecord object if successful, NULL otherwise.

Example

&MyQueryRecord = &MyCollection.First();

Syntax

Item(number)

Description

The Item method returns the QueryRecord object that exists at the number position in the QueryRecord collection.

Parameters

Field or Control

Definition

Number

Specify the position number in the collection of the QueryRecord object that you want returned.

Returns

A reference to a QueryRecord object if successful, NULL otherwise.

Example

For &I = 1 to &QueryRecordColl.Count; 
   &MyQueryRecord = &QueryRecordColl.Item(&I); 
   /* do processing */ 
End-For;

Syntax

ItemByAlias(Alias)

Description

The ItemByAlias method returns the QueryRecord object specified by Alias.

Parameters

Field or Control

Definition

Alias

Specify the record alias (for example, A, B, C, and so on), used in the SQL statement as a TableName alias.

Returns

A reference to a QueryRecord object if successful, NULL otherwise.

Example

&MyQueryRecord = &MyCollection.ItemByAlias("A");

Syntax

Next()

Description

The Next method returns the next QueryRecord object in the QueryRecord collection. You can use this method only after you have used the First method: otherwise the system doesn’t know where to start.

Parameters

None.

Returns

A reference to a QueryRecord object if successful, NULL otherwise.

Example

&MyQueryRecord = &MyCollection.Next();