Home page  
Help >
ddlFetch() - read data to variables
Version 7.11
ddlFetch() - read data to variables ddlFetch() - read data to variables

Prototype:
   void ddlFetch(
      CONTROL *ctl,
      char *OptnStr,
      char *ArgList);

Permitted variables in OptnStr:
   /Cn  - FETCH the n-th record in the collection;
   /L   - FETCH the last record in the collection;
   /N   - FETCH the next record in the collection; else, FETCH first record 

Form of ArgList:
      <cx> [<TableName>] <field1> TO <variable1> ...
Where: <cx> is the name of the collection
<TableName> is the ASCII name of the desired table in the database.
<field1> is the first field to be read
<variable1> is a global variable where <field1> is to be stored

Description:
ddlFetch() reads data from the specified collection and stores the requested values into the target variables.

If no option is specified, ddlFetch() reads the first record of the collection.

The /Cn option, /L option or /N option can be specified to modify this behavior.

Except as noted below, the target variable can be either a string variable or a numeric variable. If the specified target variable is not defined, it is created automatically as a string variable.

For BYTE data type, the target variable must be a string variable. The result is stored in the target variable as a character string in the form 0xnnnnnnn ...

If the target variable is a string variable, and the field data type is DATE, DATETIME, DATETIMEEX or TIME, the value is transferred according to the default template. However, the default template can be overridden with an explicit format override following the target variable.

If the target variable is a string variable, and the field is a numeric data type (N, I, ID, ... F, FD), the value is transferred according to the default format. However, the default format can be overridden with an explicit format override following the target variable.

Values returned in Control Structure:
Control.Ans1 1 if a record was FETCHed; else, 0
Control.Ans2 Record number of the record that was FETCHed
Control.Ans3str Table Name of the record that was FETCHed

Copyright © 2019 , WhamTech, Inc.  All rights reserved. This document is provided for information purposes only and the contents hereof are subject to change without notice. Names may be trademarks of their respective owners.