SqlUtilColumnExists - cDbUpdateFunctionLibrary
Checks if a column/field name exists in an SQL table definition.
Type: Function
Parameters: String sTableName String sFieldName
Parameter |
Description |
sTableName |
The name of the table on the SQL server. |
sFieldName |
The column or field name to check if it exists |
Syntax
Function SQLUtilColumnExists String sTableName String sFieldName Returns Boolean
Call: |
Get SQLUtilColumnExists "OrdHea" "Order_No" to bOK |
Description
Use it to check if a column exists in an SQL table. The return value is True if the column exists.
Example
Procedure OnClick
Boolean bOK
String sTableName sColumnName
Move "OrderHea" to sTableName
Move "Order_Total" to sColumnName
Get SQLUtilColumnExists of ghoDbUpdateFunctionLibrary sTableName sColumnName to bOK
Send Info_Box ("The column name" * sColumnName * If(bOK,"does", "doesn't") * "exist")
End_Procedure