Home page  
Help >
ddlChangeV() - change records in a collection (vectorized)
Version 7.11
ddlChangeV() - change records in a collection (vectorized) ddlChangeV() - change records in a collection (vectorized)

Prototype:
   void ddlChangeV(
      CONTROL *ctl,
      char *OptnStr,
      char *ArgList,
      char *ValueVector[]);

Permitted values in OptnStr:
   /Cn - change the first n values only

Form of ArgList:
      <cx> [<TableName>] <field1> <op> <value1> ...
Where: <cx> is the name of the source collection
<TableName> is the ASCII name of the desired table in the database. If <TableName> is omitted, the global collection is used.
<field1> is the first field to be changed
<op> is "=", "TO" or "BY"
      the "=" and "TO" <op>s cause absolute reassignment to <value>
      the "BY" <op> causes incremental change by <value>
<value1> is a literal value to be assigned to <field1>
Any value may be replaced by a token that indicates that a pointer to the value is in the next ValueVector[] entry. Variables are not permitted in ddlChangeV() expressions.
The permissible tokens and their corresponding argument types are:
      %b - BYTE data field of proper length
      %nnnnb - BYTE data field of length nnnn
      %nnnnb - BLOB [length = nnnn]
      %d - 16 bit int*
      %ld - 32 bit int*
      %lu - unsigned 32 bit int*
      %hd - 64 bit int*
      %hu - unsigned 64 bit int*
      %f - float (32 bit)*
      %lf - double (64 bit)*
      %s - char* (null terminated string)
               for BYTE datatype, string is in the form 0xnnnnnnn ...

Form of ValueVector[]
Each entry in the ValueVector[] array contains a (type-cast) pointer to the value of the corresponding token.

For example:

   {
      float x=123.00;
      double y=321.00;
      char *ValueList[2];
 
      ValueList[0] = (char*)&x;
      ValueList[1] = (char*)&y;
 
      ddlChangeV(&ctl,"/","a customers x = %f y =%lf",ValueList);
   }

Description:
ddlChangeV() modifies the contents of existing data base records specified by the source collection. Only the fields specified in the list are modified.

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:
The parameterized forms for BYTE data type are:
      %s - with the corresponding string parameter in the form 0xnnnnnnn ...
      %b - with the corresponding byte parameter being the required size;
      %nnnnb - with the corresponding byte parameter being nnnn bytes;
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 changed
Control.Ans2 Number of records read

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.