Sybase 2 Barcode Reader User Manual


 
CHAPTER 4 Defining DataWindow Objects
DataWindow Designer User’s Guide 131
Dynamically selecting, sorting, and grouping data
Selection, sorting, and grouping criteria that you define in the Select painter are
added to the SQL statement and processed by the DBMS as part of the
retrieval. You can also define selection, sorting, and grouping criteria that are
created and processed dynamically by DataWindow Designer after data has
been retrieved from the DBMS.
For more information, see Chapter 9, “Filtering, Sorting, and Grouping
Rows.”
Referencing retrieval
arguments
If you have defined retrieval arguments, you reference them in the WHERE or
HAVING clause. In SQL statements, variables (called host variables) are always
prefaced with a colon to distinguish them from column names.
For example, if the DataWindow object is retrieving all rows from the
Department table where the dept_id matches a value provided by the user at
runtime, your
WHERE clause will look something like this:
WHERE dept_id = :Entered_id
where Entered_id was defined previously as an argument in the Specify
Retrieval Arguments dialog box.
Referencing arrays
Use the IN operator and reference the retrieval argument in the WHERE or
HAVING clause.
For example, if you reference an array defined as deptarray, the expression in
the
WHERE view might look like this:
"employee.dept_id" IN (:deptarray)
You need to supply the parentheses yourself.
Defining WHERE
criteria
You can limit the rows that are retrieved into the DataWindow object by
specifying selection criteria that correspond to the
WHERE clause in the
SELECT statement.
Group the retrieved data before it is brought into the
DataWindow object
GROUP BY
Limit the groups specified in the GROUP BY clause HAVING
To do this Use this clause