You can use the database query classes illustrated in the previous section to write VisualAge scripts that execute queries using information provided in a visual part.
The following example shows how to incorporate the sample code in Updating rows in a table into a VisualAge script. To use this code in a script, follow these steps:

executeQuery
"Script to Update a row in a table"
| connection querySpec oldRow newRow table|
connection := AbtDbmSystem activeDatabaseConnectionWithAlias: 'SAMPLE'.
querySpec := (AbtQuerySpec new)
statement: 'SELECT * from STAFF
where STAFF.NAME = 'Sanders' ';
hostVarsShape: (nil).
oldRow := (connection resultTableFromQuerySpec: querySpec) first.
newRow := (oldRow deepCopy)
at: 'SALARY'
put: ((self subpartNamed: 'Text1') object);
yourself.
table := (connection openTableNamed: 'STAFF')
atRow: oldRow putRow: newRow;
yourself.
^table asStrings.