Home page  
Help >
ddlCreateColl() - create a new collection at run-time
Version 7.11
ddlCreateColl() - create a new collection at run-time ddlCreateColl() - create a new collection at run-time

ddlCreateColl() creates a new collection at run-time.

Prototype:
   void ddlCreateColl(
      CONTROL *ctl,
      char *OptnStr,
      char *ArgList);          /* command argument list */
Permitted values in OptnStr: NA

Form of ArgList:
Form1: <CollectionName>
Form2: <CollectionName> <Table1> <Table2> ... <Alias1>=<Table1> <Alias2>=<Table2> ...
<CollectionName> represents the new Collection name;
<TableN> represents a table name to be included in the new collection;
<AliasN> represents an alternate (additional) name for a table;

In Form1, all tables are included in the new collection;

In Form2, only the specified tables are included in the new collection; in addition, one or more table aliases can be created.

Description:
A collection created with the ddlCreateColl() function is limited in scope to the current connection. In addition, a collection created with the ddlCreateColl() function can be destroyed with the ddlDestroyColl() function.

The grammer for constructing the new <CollectionName> is:
      . It must contain at least 1 and not more than 24 characters;
      . The first character must be from the set {'A'-'Z','a'-z'};
      . The remaining characters must be from the set {'A'-'Z','a'-'z','_','#'};
      . Alphabetic characters are not case sensetive;
      . The reserved words are not allowed;

Form1 of this command provides a simple way to create a collection dynamically, whenever it is needed.

Form2 of this command provides almost unlimited flexibility to limit the tables within the collection, and to create alias table names.

An alias table name exists only in the context of the defining collection.

Because a table name can occur only once in a RELATE command, alias table names are especially important in cases where a table must occur more than once, such as a self-join.

In theory, an alias table name can be used anywhere (in context of the defining collection) that a true table name can be used. For example, an alias table name can be used in any of these commands; or the alias table will be treated as part of the global collection:
      . CLEAR
      . FILL
      . PICK
      . RPR
However, there are several restrictions on the use of an alias table name within the FIND and MATCH commands:
      . It cannot be used in a non-keyed FIND;
      . It cannot be used with a NE, LT or LE operator;
      . It cannot be used in a complex FIND;
      . It cannot be used in a non-keyed MATCH;
On the other hand, the following statements are allowed:
      FIND AX <Table-alias> where AX <Table>
      FIND AX <Table> where AX <Table-alias>


Value returned in Control.Ans1:
      If the command succeeds, %Answer1 contains "1".

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.