CreateRowset

Mon 01 January 2018

Syntax

CreateRowset({RECORD.recname | &Rowset} [, {FIELD.fieldname, RECORD.recname | &Rowset}] .  .  .)

Description

Use the CreateRowset function to create an unpopulated , standalone rowset.

A standalone rowset is a rowset that has the specified structure, but is not tied to any data (that is, to the component buffer or to a message.) In addition, a standalone rowset isn’t tied to the Component Processor. When you fill it with data, no PeopleCode runs (like RowInsert, FieldDefault, and so on.)

The first parameter determines the structure of the rowset to be created.

If you specify a record as the first parameter, it’s used as the primary level 0 record. If you don’t specify any other parameters, you create a rowset containing one row, with one unpopulated record. To populate this type of rowset with data, you should only use:

  • the Fill or FillAppend rowset class methods

  • a record method (SelectByKey)

  • the SQLExec function

If you specify a rowset object, you are creating a new rowset based on the structure of the specified rowset object, including any child rowsets. It will not contain any data. If you want to populate this type of rowset with data, use the CopyTo method or a SQL statement.

Note: You should not use the rowset Select or SelectNew methods for populating rowsets created using CreateRowset. Use Fill or FillAppend instead.

Parameters

Field or Control

Definition

RECORD . recname | &Rowset

Specify either a record name or an existing rowset object.

FIELD . fieldname , RECORD . recname | &Rowset

Use FIELD . fieldname , RECORD . recname to specify a related display record . FIELD . fieldname refers to the controlling field, (not the related display field) while RECORD . recname refers to the related display record.

If you specify &rowset , you are adding a child rowset object to the newly created rowset. This must be an existing rowset object.

Returns

An unpopulated, standalone rowset object.