Scope object
is a member of the data
object. It provides the ability to set and modify SQL expressions,
which define the criteria by which the records are filtered. The SQL syntax can
vary from one database system to another. The scope object can translate
standard SQL syntax into one that is native to a specific database
system thereby improving performance and resolving compatibility issues. Some
database-specific features may be unavailable because of this
translation. Set the check_syntax parameter to false to
disable the translation, in which case the SQL expression will
be used as is.
The object is exposed through the IScope interface. MethodsSetSets an SQL expression to be used to filter records. The old object content is overwritten by a call to this method. Function Set( sql,
expression_id(optional, default = -1), check_syntax(optional, default =
true) ) Scope.Set "ID=25", 1, true ModifyModifies an existing sub-expression identified by expression_id or adds a new sub expression. Pass an empty string as the first parameter to remove an existing sub-expression. Function Modify( sql,
expression_id(optional, default = -1), check_syntax(optional, default =
true) ) Scope.Modify "ID=26", 1, true GetGets the complete SQL expression stored in the scope object. You may request either the compiled or the original representation of the SQL expression. The compiled version has all custom fields expanded to their definitions and the syntax translated into that of the dialect of the database being used. You may pass a table alias as a parameter, in which case the compiled version will be returned and all the fields in the SQL statement will be pre-pended with that alias. Function
Get( how(optional, default = false) ) Scope.Get() |