$.udb(ds).rows()
This article is about the rows() function of the DataSourceContainer object.
$.udb(ds).rows()
Addresses a record or a set of records of the first data source in the container.
Returns a collection of records.
Row selectors The optional arguments passed to .rows() in the syntax block below are row selectors. They allow you to identify one or more specific records.
Syntax
$.udb( *ds* ).rows( *index*, *index* )
$.udb( *ds* ).rows( *keyword*, *indicator* )
$.udb( *ds* ).rowSet( *rowSet* ).rows( *index*, *index* )
$.udb( *ds* ).rowSet( *rowSet* ).rows( *keyword*, *indicator* )
The required ds is a data source selector.
The optional rowSet parameter is a rowset identifier. If the .rowSet() clause is omitted, then .rowSet('current') is assumed.
The optional index, keyword, and indicator are row selectors. If you do not pass a row selector, all records in the data source are addressed. If you do pass a row selector, you either pass one or two index arguments or you pass a keyword argument that possibly requires an indicator argument.
Passing row selectors
The full explanation of row selectors and all of its options are discussed in row selectors.
Examples
This example addresses the 5th record:
$.udb('EMP').rows(4);
and is short for:
$.udb('EMP').rowSet('current').rows(4);
This example addresses the 5th, 6th and 7th record:
$.udb('EMP').rows(4, 6);
This example addresses the records with the specified indices:
$.udb('EMP').rowSet('current').rows([0, 1, 4, 7]);
This example addresses the record following the current record:
$.udb('EMP').rows('next');
This example addresses the records in the first data set:
$.udb('EMP').rows('dataset', 1);
This example gets records that satisfy the equality condition EMPNO = 10:
$.udb('EMP').rows( { EMPNO: '10' } );
These examples get records that satisfy more complex conditions:
$.udb('EMP').rows('condition', { BIRTH_DATE: '>=01-JAN-1980' } );
$.udb('EMP').rows('condition', { BIRTH_DATE: '>=01-JAN-1980&<=01-JAN-2000' } );
To get all rows where MANAGER is NULL and SALARY is higher than 35000:
$.udb('EMP').rows('condition', { MANAGER: 'NULL', SALARY: '>35000' } );