sqlsetfilter=<where-clause>
sqlsetfilter is part of the SQL-commands.
For understanding a SQL-command here is a general description:
Normally the WHERE- and ORDER-clause of the DataWindow is interpreted.
BEASSCRIPT supports a triple nested system of WHERE- and ORDER, setting the 3 clauses successively:
select <...> from <...> where <where1> and <where2> and <where3> order by <order1> <order2> <order3>
You can manipulate Where2+3 and Order2+3.
When refreshing the window with a TABCHANGE the WHERE2+3-Klausel gets buffered. You can also set it manually:
tab=where=<TabNr>=<Whereclause>
a simple command is:
sqlsetfilter=<where-clause>
This defines and sets the WHERE-clause 2.
Contrary to "SETFILTER" the data is not filtered on the client but on the server.
This allows a comfortable sorting and not too much data is retrieved.
Example:
In the DataWindow there is the command:
select belnr from fthaupt where kndname like :input
This shows all orders with the customer-name <input>
With the command
sqlfilter=abgkz='N'
the SQL-Query is extended and it follows a new retrieve
select belnr from fthaupt where kndname like :input and abgkz='N'
How can I set a SQL-filter before opening the window?
Set the SQL-filter directly to the tabsheet in the masterscript
tab=where=<TabNr>=<WhereClause>
Resetting of the filter
sqldel resets the filter