ApiTableAttachToSQL - cDbUpdateFunctionLibrary

To attach to an existing SQL table.  This might not do what you think - Here's what it does:

- It checks that the passed hTable TableName in filelist.cfg is exactly the same as at the SQL back-end.

- If that is True; it creates an .int file for it and changes Filelist.cfg to point to the SQL table.


Typical usage for this function is when an entry exists in the Filelist for a table and the table already exists in SQL. 



Type: Function


Parameters: Handle hTable Boolean bUseConnID

Parameter

Description

hTable

A file handle to the table name. Same as the Filelist.cfg slot number.

bUseConnectionID

Pass a True if connection ID should be used for the .int file


Syntax


Function ApiTableAttachToSQL Handle hTable Boolean bUseConnID

Call:

Get ApiTableAttachToSQL Suppliers.File_Number True to bOK



Description

Use it to connect a table to SQL. The file handle is the same as the file number in Filelist.cfg.


Example 1


Object oDbUpdateVersion1 is a cDbUpdateVersion

    Set pnVersionNumber to 1.0

    Procedure OnUpdate

        Boolean bOK

        Get ApiTableAttachToSQL Employees.File_Number True to bOK

    End_Procedure


End_Object