Macro Language Reference > Macros > Database > generate
  
generate
Description
Creates an internal table or adds array to the internal table with the selected data.
 
Example 37. Build up internal table of selected rows
dbgenerate "Baskets",1
^dbgenerate=1
Syntax
generate table_name:s new:n
table_name
Name of internal table to generate.
new
0
Append existing array.
1
Create new array.
Additional Information
Return values:
^dbgenerate
1- Success; 0 -Failed
getvar 01940
 
The internal PTC ALD SQL buffer must contain data selected by SQL statement with same number of columns as (table_name). Otherwise an error message will be generated. If the internal SQL buffer is empty and new=1 all rows in existing table_name will be deleted.
 
It is worth noting that since support for Perl was introduced in version 7, it is possible to use various freely available Perl modules to perform various database activities if you are already experienced in or prefer to use Perl.