Opens a row set.
OPEN-RS NAME=row_set_name_var|_lit|_col FILENAME=file_name_var|_lit|_col COLUMN=({name_var|_lit|_col},{type_var|_lit|_col})
NAME
Name of the row set.
FILENAME
Name of the external file used to hold the row set.
COLUMN
Column name and data type. Can be repeated as many times as needed. The column name is case-sensitive.
OPEN-RS is used to instantiate the specified row set. When executed, the specified external file is created. If it already exists, the current contents are replaced. OPEN-RS can reside in any section except BEGIN-SETUP, BEGIN-SQL, and BEGIN-DOCUMENT. Validation rules include:
The row set specified by row_set_name must not be active, or an exception is thrown.
The external file specified by file_name must be writable. An exception is thrown if the file cannot be created or written to.
Column names must be unique within the row set.
The data type must be Integer, Double, Decimal, String, Date, Time, DateTime, or Binary.
If both the name and data type for a column are empty strings, then the corresponding COLUMN entry is ignored.
You must define at least one active COLUMN entry, or an exception is thrown.
The row set file is an XML file. You can define whether to create the XML file in a BI Publisher (BIP) format or an SQR format in the FormatForRowsetXML entry in the [Default-Settings] section of SQR.INI.
Begin-Report
Open-RS Name='customer' FileName='customer.xml'
Column = ('cust_num', 'integer')
Column = ('name', 'string')
Column = ('addr1', 'string')
Column = ('addr2', 'string')
Column = ('city', 'string')
Column = ('state', 'string')
Column = ('zip', 'string')
Column = ('phone', 'string')
Column = ('tot', 'integer')
Begin-Select
cust_num
name
addr1
addr2
city
state
zip
phone
tot
Write-RS Name='customer'
Value = ('cust_num', &cust_num)
Value = ('name', &name)
Value = ('addr1', &addr2)
Value = ('addr2', &addr2)
Value = ('city', &city)
Value = ('state', &state)
Value = ('zip', &zip)
Value = ('phone', &phone)
Value = ('tot', &tot)
from customers
order by cust_num
End-Select
Close-RS Name='customer'
End-Report