Instantiating a Row Class Object

There are four ways to instantiate a Row Class object.

Option

 

1

type Row identifier = Class.new("Row",columnList)

2

type Row identifier = StringVariableOrLiteral.toRow(columnList,delimiter)

3

type Row identifier = ResultSetIdentifier.getRow(delimiter,columnList)

4

type String identifier = ResultSetIdentifier.getrow().propertyName

 Option 4 supports temporary instantiation.

Parameters

The columnList parameter must be defined and not null. This parameter corresponds to the ordinal position of the data in the row object (i.e., the first column name maps to the first position in the row, etc.). This parameter consists of the PSL Class of the column followed by a space character, followed by the designated column name. If a column does not contain this pattern, the String class defaults, and the column name is the value at that position. Columns are comma-separated.

columnList = "String LNM,NumberBAL" or "LNM,NumberBAL"

The columnList parameter can be a literal, variable, or a reference to an extrinsic function or template definition.

type Row abc = Class.new(Row","String LNM,Number Bal,Number TYPE")  // Literal

type Row abc = Class.new("Row",var)  // Variable.

type Row abc = Class.new("Row,","#$$GETLIST^XXX(""DEP"")")"  // Compile time extrinsic function

type Row abc = Class.new("Row","#fsn^SQLDD(fsn()))")  // Compile time template lookup

In option 3, this parameter is optional because the column list defaults to the select statement of the ResultSet object.

The delimiter parameter defaults to the <tab> delimiter if it is not defined or is null.

Example - Option 1

 

Example - Option 2

 

Example - Option 3

 

Example - Option 4