API Make Database Changes - cDbUpdateFunctionLibrary

Name

Type

Description

ApiTableAttachToSQL

Function

Attaches a table in Filelist.cfg to an existing SQL table. It checks that the passed handle (hTable) table name in filelist.cfg is the same as at the SQL end. If True, it creates an .int file and changes filelist.cfg to point to the SQL table.

ApiTableChangeAttribute

Function

To change table attributes. Mostly for embedded DataFlex tables.

ApiTableConvertToSQL

Function

Converts an embedded table to SQL. You may need to set a series of properties in the cDbUpdateVersion object for this function to work, unless you have set them up with the SQLConnections tool for the current workspace. This is a more OOP directed function. To instead pass a series of parameters see the ApiTableConvertToSQL_Ex function.

ApiTableConvertToSQL_Ex

Function

Converts a whole embedded table to SQL. Pass a table handle, a driver ID, bToANSI=True (if data should be saved in ANSI format) and bCopyData=True, if data should be copied from the embedded table to the SQL side.

ApiTableCreate

Function

Creates a new database table.

ApiTableCreateAlias

Function

To create a table alias in filelist.cfg.

ApiTableRelate

Function

Creates a relation between two tables.

ApiTableRemove

Function

Deletes the .dat file or data cache file and .int file, then drops the passed data table name.

ApiTableRemoveRelation

Function

Use it to delete/remove a relationship between two tables.

ApiTableRename

Function

To rename a table.

ApiTableRenameAlias

Procedure

To rename a table alias.

ApiColumnAdd

Function

To add a new column to a table.

ApiColumnChange

Function

To change the length or type of an existing column.

ApiColumnChangeMainIndex

Function

To change the main index for a field/column.

ApiColumnMove

Function

To move a column within a table to a new position.

ApiColumnRemove

Function

To remove an existing table column. Note that all data will be gone too.

ApiColumnRename

Function

Renames a column name.

ApiIndexCreate

Function

Function for creating a new index. The first four arguments are required, the rest are optional (depending on how many index segments your index consist of) It does not set Ascending/Descending attributes. Use the ApiIndexChangeDirection to do that.


ApiIndexCreateByFieldNames

Function

Function for creating a new index. Instead of as with the ApiIndexCreate function, it can be used by passing one or more field/column names as a comma separated string as the third parameter.




ApiIndexChangeDirection

Function

To change the index direction of an index. The sort direction of an index segment.

ApiIndexChangeUppercase

Function

The case sensitivity of an index segment.

ApiIndexRemove

Function

To delete an index.

ApiTableConvertAllAddException

Procedure

Adds a table to the exception array for tables that should not be converted with the ApiTableConvertALLToSQL.

ApiTableConvertALLToSQL

Procedure

Converts ALL tables in Filelist.cfg - except "CodeMast", "CodeType" & "DbVersion" to SQL. See also ApiTableConvertAllAddException for adding other tables that should not be converted.

ApiTableCopyData

Function

To copy all data from an Embedded .Dat table to an existing SQL table.

ApiColumnUpdateValue

Function

To populate all current rows with a value.

ApiTableAttachALLToSQL

Procedure

Similar to ApiTableConvertALLToSQL, except that it depends on that the SQL tables already exists but the Filelist.cfg entries points to embedded .Dat tables.

ApiTableChangeFileListSlot

Function

To use a filelist slot for the passed table number (Filelist.cfg slot number). Or to change the filelist slot names. Note: If you pass empty strings ("") for the three parameters "sRootName", "sLogicalName" and "sDisplayName", the table will be removed from Filelist.cfg.


Note: All of the above functions uses Structure_Start - Structure_End commands. For some of the functions above there are faster SqlXXX functions available - see SQL Based Methods.