FillAppend method: Rowset class

Syntax

FillAppend([wherestring [, bindvalue] .  .  .])

Description

The FillAppend method reads records from the database into successive rows of the rowset starting after the last row that exists in the rowset. Unlike Fill, it doesn’t first flush the rowset.

Note:

FillAppend appends rows after the last active row in the rowset. If you have deleted rows in the rowset, they will still be the last rows.

When a rowset is selected into, any autoselected child rowsets are also read. The child rowsets are read using a where clause that filters the rows according to the where clause used for the parent rowset, using a subselect.

When a rowset is created using CreateRowset, it contains one empty row. If the rowset hasn’t been filled with data, FillAppend fills that row also (so you don’t have an empty row at the start of your rowset.)

The records are read from the database tables corresponding to the primary database record of the scroll into that record. The records are selected by the optional wherestring SQL clause, in which the optional bindvalues are substituted, using the usual bind placeholders (:n).

In general, use this method only with rowsets that were created using the CreateRowset function.

The actual number of records read into the rowset is an optional return of this method.

Note:

This method does not work with Application Engine state records. Also, you cannot use this method in dynamic views.

When this method executes, unlike the Select method, it does not cause any associated PeopleCode to run as part of reading data into the rowset.

Note:

FillAppend reads only the primary database record. It does not read any related records, nor any subordinate rowset records.

For every record read with the FillAppend method, if the set language is not the base language and the record has related language records, the FillAppend method tries to read the related language record and does related language processing.

The FillAppend method uses a correlation ID of FILLAPPEND for the table it reads. You must use the correlation ID if you want to refer to the rowset table name as part of the wherestring. You receive a runtime error if you use the table name as a column prefix instead of the correlation ID.

Parameters

Parameter Description

wherestring

Specify a SQL WHERE clause to use for selecting records to fill the rowset. This can be a string or a SQL definition.

bindvalue

Specify optional bind variables to be used with the WHERE clause.

Returns

The number of records read into the rowset.

Example

The following example reads all of the QA_MYRECORD records that have a MYRECORD field equal to the value of &UVAL into a rowset, and returns the number of rows read:

&NUM_READ = &RS.FillAppend("where MYRECORD = :1", &UVAL);

To re-use a WHERE clause for the wherestring you can use the SQL repository, and a SQL object.

&NUM_READ = &RS.FillAppend(SQL.MYWHERE, &UVAL);