You can click each column you want to include from the table representations in the Table Layout view. PocketBuilder highlights selected columns and places them in the Selection List at the top of the Select painter.
Figure 17-17: Column selection list in the Table Layout view
To reorder the selected columns:
Drag a column in the Selection List with the mouse. Release the mouse button when the column is in the proper position in the list.
To select all columns from a table:
Move the pointer to the table name and select Select All from the pop-up menu.
To include computed columns:
Click the Compute tab to make the Compute view available (or select View>Compute if the Compute view is not currently displayed).
Each row in the Compute view is a place for entering an expression that defines a computed column.
Enter one of the following:
An expression for the computed column. For example:
salary/12
A function supported by your DBMS. For example, the following is a SQL Anywhere function:
substr("employee"."emp_fname",1,2)
You can display the pop-up menu for any row in the Compute view. Using the pop-up menu, you can select and paste columns, functions, and arguments (if you have created any) into the expression.
Press the Tab key to get to the next row to define another computed column, or click another tab to make additional specifications.
PocketBuilder adds the computed columns to the list of columns you have selected.
Computed columns you define in the Select painter are added to the SQL statement and used by the DBMS to retrieve the data. The expression you define here follows the rules of the DBMS.
You can also choose to define computed fields, which are created and processed dynamically by PocketBuilder after the data has been retrieved from the DBMS. There are advantages to doing this. For example, work is offloaded from the database server, and the computed fields update dynamically as data changes in the DataWindow object. If you have many rows, however, this updating can result in slower performance.
For more information, see Chapter 18, “Enhancing DataWindow Objects.”