In this example, you will learn how to display all the result rows as strings in a list box.
When you have finished, you will have a window that looks like this:

SELECT STAFF.NAME, STAFF.COMM, STAFF.DEPT, STAFF.ID,
STAFF.JOB, STAFF.SALARY, STAFF.YEARS
FROM STAFF

Notice that all of the columns are concatenated, but separated by left and right brackets. Since this probably isn't the appearance you want, you can write a script that formats the results more neatly by concatenating the name and job columns and displaying just those columns in the list.
To create this script and add it to your visual part, follow these steps:
formatRows
| items address rows |
items := OrderedCollection new.
((self subpartNamed: 'resultTable of Multi-row Query1')
valueOfAttributeNamed: #rows selector: #'IS_rows')
do: [:each |
each isNil ifFalse: [
address := (each at: 'NAME') trimBlanks,
', ', (each at: 'JOB').
items add: address.]].
^items
For each row of the result table, this script concatenates the name and job values, separated by a comma. As it iterates through the rows, each of these strings is added to an ordered collection, which is returned at the end of the script.
Your connections should look like the following:
