WRITE-RS

Function

Writes values to the specified row set.

Syntax

WRITE-RS

NAME=row_set_name_var|_lit|_col

VALUE=({name_var|_lit|_col},{data_var|_lit|_col})

Arguments

NAME

Name of the row set.

VALUE

Column name and value. Can be repeated as many times as needed to satisfy the row set definition.

Description

WRITE-RS can reside in any section except BEGIN-SETUP, BEGIN-SQL, and BEGIN-DOCUMENT. Validation rules include:

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.

Example

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', &addr1)
  Value = ('addr2', &addr2)
  Value = ('city', &addr3)
  Value = ('state', &addr4)
  Value = ('zip', &zip)
  Value = ('phone', &phone)
  Value = ('tot', $&tot)
 from customers
 order by cust_num
 End-Select
 Close-RS Name='customer'
End-Report

See Also

OPEN-RS, CLOSE-RS