ApiTableUpdate - cDbUpdateFunctionLibrary
To convert/update tables with auto-generated code from the DUF Code Generator.
Type: Function
Parameters: Struct APITableNameInfo Struct[] aAPIColumn Struct[] aAPIColumn Struct[] aAPIIndex Struct[] aAPIRelation Boolean bOK
Parameter |
Description |
tAPITableNameInfo |
A struct with table name info |
tAPIColumn[] |
A struct array with column/field info |
tAPIIndex[] |
A struct array with index info |
tAPIRelation[] |
A struct array with relations info |
Syntax
Function ApiTableUpdate tAPITableNameInfo APITableNameInfoFrom tAPIColumn[] aColumnsFrom tAPIIndex[] aIndexesFrom tAPIRelation[] aRelationsFrom Returns Boolean
Call: |
Get ApiTableUpdate APITableNameInfo APIColumns APIIndexes APIRelations to bOK |
Description
Use it to update and/or convert tables to SQL. It is strongly advised to use the DUF Code Generator to auto-generate code for the current version of the database. It will create a package name like "DUF_MultipleTables1_5.pkg". The auto-generated code uses one ApiTableUpdate call for each of the tables in Filelist.cfg.
Note: You must have setup a SQL connection for the workspace with the help of the Database Update Framework's DUF SQL Connections tool.
Important: If the table exist on the SQL back-end but the Filelist entry points to an Embedded data table (.Dat) the ApITableUpdate logic will attach to the existing SQL table, rather than attempting to convert the current .dat table. It does so by calling the ApiTableAttachToSQL function.
If the current table is an Embedded table (.Dat) but the SQL table does not exist, the table will be converted to SQL if the 'From' table was e.g. MSSQLDRV driver (any driver other than the default "DataFlex" driver. It does so by calling the ApiTableConvertToSQL_Ex function.