SET_SQL_CONSTRAINT¶
Applies to: ORAFlex SQLFlex MYSQLFlex PGFlex DB2Flex
This command allows you to put an additional constraint on your finds, moving filtering to the SQL backend. Using this command can result in significantly improved performance, since the server network traffic reduced. Note that the SQL statement passed for this command is added onto the predefined Database SQL statement so treat it as such. Because of this, it will almost always begin with “AND” followed by the desired constraint.
Syntax
SET_SQL_CONSTRAINT of {file} to {variable}
Parameter |
Description |
---|---|
file |
Name or Number of the file. |
variable |
A SQL expression that constrains the data |
Example
Open Customer
SET_SQL_CONSTRAINT of 1 to (SFormat('AND "%1"."%2" = ' + "'%3'", "Customer", "Status", "Active"))
For_All Customer by Index.1 do
Showln Customer.FirstName
End_For_All
DF_FIELD_PROGRAMMATIC_DEFAULT