SqlUtilEnumerateColumns - cDbUpdateFunctionLibrary

Enumerates SQL columns/fields for the passed table name and driver ID.


Type: Function


Parameters: String sTableName, String sDriverID

Parameter

Description

sDriverID

MSSQLDRV_ID, DB2_DRV_ID, ODBC_DRV_ID, ORAFLEX, SQLFLEX, MDSPgSQL or MDSMySQL

sTableName

The literal name of the SQL data table


Syntax


Function SQLUtilEnumerateColumns String sDriverID String sTableName Returns String[]

Call:

Get SQLUtilEnumerateServers MSSQLDRV_ID sTableName to sMyColumnArray



Description

Use it to retrieve all SQL columns/Fields for a named data table and e.g. fill a comboform. The return value is a string array. It relies on the SQLConnection string settings.



Example


Procedure Combo_Fill_List

   String[] sColumnsArray  

   String sTableName sDriverID

   Integer iCount iSize

               

   Send Delete_Data

   Get psDriverID of ghoSQLConnectionHandler to sDriverID

   Get Value      of oSQLTableName_cf        to sTableName

   

   Get SQLUtilEnumerateColumns of ghoDbUpdateFunctionLibrary sDriverID sTableName to sColumnsArray

   

   Move (SizeOfArray(sColumnsArray)) to iSize

   Decrement iSize

   For iCount from 0 to iSize

       Send Combo_Add_Item sColumnsArray[iCount]

   Loop

   If (iSize > 1) Begin

       Set Current_Item to 1

   End

End_Procedure


Procedure OnDropDown

   Send Combo_Fill_List

End_Procedure