Home page  
Help >
ddlWrite() - write records
Version 7.11
ddlWrite() - write records ddlWrite() - write records

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

Permitted values in OptnStr:
   /Cn - write n records; default is 1
   /R  - do not clear target collection before operation
   /S  - do not structure new records

Form of ArgList:
      [<cx>] <TableName> <field1> <op> <value1> ...
Where: <cx> is the name of the target collection
<TableName> is the ASCII name of the desired table in the database.
<field1> is the first field to be written
<op> is "=" or "IS"
<value1> is a literal value or global variable to be assigned to <field1>

Description:
ddlWrite() creates one or more records in a specified table. All fields specified in the list are set to the assigned values. All other fields are set to the default value based on their data type:
   X()                      - ascii blanks
   N()                      - all zeroes
   BYTE()                   - all binary zeroes
   DATE                     - ascii blanks
   DATETIME                 - binary zero
   LOGICAL                  - false
   All binary integer types - binary zero
   All binary float types   - binary zero

If a target collection <cx> is specified, the collection <cx> <TableName> is cleared before the write operation begins. Then, for each record written, its recno is stored in the collection.

If the /R option is specified, the target collection is not cleared, enabling an effective OR of recno's from successive write operations.

The default format for the target value of a DATE field is the default template 'mm/dd/yyyy', 'mm-dd-yyyy' or 'mm.dd.yyyy'.

The default format for the target value of a DATETIME field is the default template 'mm/dd/yyyy hh:nn:ss.ttt', 'mm-dd-yyyy hh:nn:ss.ttt' or 'mm.dd.yyyy hh:nn:ss.ttt'.

The default format for the target value of a DateTimeEx or TIME field is the default template as specified in the Default Templates section.

In all cases, the default template can be overridden with a format override; or it can be modified with the ddlMode() DATEFORM function.

The query value for a BYTE field is expressed as a hex character string in the form 0xnnnnnnn ...

Notes:
If the Change Callback is defined [Ref. ddlSetChangeCb()], the callback is called with each record image after the specified values have been stored but before the record has been rewritten.

Values returned in Control Structure:
Control.Ans1 Number of records written
Control.Ans2 Record number of the first record written

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.