Rows.cols()
This article is about the cols() function of the Rows object.
Rows.cols()
Gets a collection of columns of the rows in scope.
Returns a UdbCols object.
Syntax
$.udb( *ds* ).rows( [rowRef1], [rowRef2] ).cols( [columns], [check] )
$.udb( *ds* ).rowSet( *rowSet* ).rows( [rowRef1], [rowRef2] ).cols( [columns], [check] )
*check* ::= { [true] | false }
The required ds parameter 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 rowRef1, rowRef2 are row selectors. If omitted, all records in scope are addressed.
The optional columns is a string or an array identifying one or more columns. If columns is not passed, all the columns are returned.
The optional check is a boolean that determines whether columns must refer to existing columns. If true (the default) and a column reference does not exist, an error is raised. If false, non-existent column references are silently skipped.
Example
let empNo = $.udb('EMP').rows('current').cols('EMP_NO');
The most common purpose of calling this function is to access a specific column value, like so:
let empNo = $.udb('EMP').rows('current').cols('EMP_NO').val();