Article Details
Id: | 12431 |
Product: | finPOWER Connect |
Type: | NEW |
Version: | 2.02.03 |
Opened: | 17/11/2014 |
Closed: | 18/11/2014 |
Released: | 04/12/2014 |
Job: | J014494 |
ISSqlWhereBuilder; Updated to handle comparisons with SQL functions
Internally within finPOWER Connect, SQL Where clauses comparing the result of an SQL function are rarely used. However, Script code may wish to create SQL such as:
WHERE IIF(Value > 100, True, False) = 1
Simply using one of the AppendComparison methods of the SQL Where builder, as per the following example, does not work consistently since it escapes the entire function name (e.g., [IIF(Value > 100, True, False)]):
.AppendComparisonIntegerBoolean(finBL.Database.SqlIif("Value > 100", "True", "False"), "=", True)
Using one of the new AppendFunction methods solves this issue, e.g.:
.AppendFunctionBoolean(finBL.Database.SqlIif("Value > 100", "True", "False"), "=", True)
The following methods have been added to the ISSqlWhereBuilder object:
- AppendFunctionBoolean
- AppendFunctionDate
- AppendFunctionDecimal
- AppendFunctionDouble
- AppendFunctionField
- AppendFunctionInteger
- AppendFunctionString