Selecting a row
The query in the following example returns all rows in the STAFF table of the SAMPLE database by issuing the SQL statement directly in the code, follow these steps:
1. Evaluate either block of code using the Inspect command.
2. Look at the contents of the ordered collection in the Inspector window.
"Selects rows from a table"
| querySpec result resultCollection connection |
resultCollection := OrderedCollection new.
connection := AbtDbmSystem activeDatabaseConnectionWithAlias: 'SampleConSpec'.
querySpec := (AbtQuerySpec new)
statement: 'SELECT * FROM STAFF'.
result := connection resultTableFromQuerySpec: querySpec.
result do: [:eachRow | resultCollection add: (eachRow asString)].
^resultCollection.
Last modified date: 01/29/2015