base.Channel.write

Writes a list of data delimited by a separator to the channel.

Syntax

Note: In the next(s) syntax diagram(s), the [ ] { } | symbols are part of the syntax.
write( arguments )
where arguments can be one of:
  • value
  • [ value , ... ]
  • record
  • [ record.* ]
  1. value is an expression of a primitive data type such as INTEGER, VARCHAR(50), etc.
  2. record is a variable defined as a RECORD.
  3. When there are multiple values to write, the value(s) must be specified between [ ] square brackets. These are provided as a variable parameter list.
  4. If only one value is to be written, you can specify the value without the [ ] brackets.
  5. To write all values from a RECORD variable, the record.* notation can be used when surrounded by [ ] brackets, to expand all record fields as a list of simple values. Or, you can also directly specify the record name without the .* notation and no [ ] brackets.

Usage

After opening a channel, use the write() method to write a record of data to the channel.

The write() method uses the field delimiter defined by setDelimiter().

The write() method takes a modifiable list of variables as the parameter.

The method raises error -6345 if the channel fails to write data.

Example

DEFINE cust_rec RECORD LIKE customer.*
...
CALL ch.write(cust_rec)  -- equivalent to ch.write([cust_rec.*])