1. You can get a SQL prompt directly at the Magik prompt...
SQL> SELECT name, address1 FROM hotel ORDER BY address1
Name Address 1
Acorn Guest House 154 Chesterton Road
Hamilton Lodge 156 Chesterton Road
De Freville House 166 Chesterton Road
Rosswill 17 Chesterton Road
Cam Guest House 17 Elizabeth Way
Kirkwood House 172 Chesterton Road
All Seasons 219 Chesterton Road
Lyngamore 35 Chesterton Road
Suffolk House 69 Milton Road
Southampton House 7 Elizabeth Way
Ashley Hotel 74 Chesterton Road
Arundel House Chesterton Road
Gonville Hotel Gonville Place
Garden House Granta Place
University Arms Regent Street
15 record(s) selected
SQL> SQL> select count(*) from min_road
1 record(s) selected
NOTE: the sql() procedure is defined in module :sql2. You can load that module if your image doesn't have the sql() procedure loaded.
2. You can also use the sql2_parser object directly in your Magik code.
You can find out more by searching the Smallworld documentation for "SQL Support". To be clear, this is not the same as Smallworld's SQL Server image code. This is strictly related to writing SQL in Magik to query Smallworld tables.
I have never used this in code, but I suppose it could come in handy if you were more comfortable writing a SQL statement compared to writing a selection predicate. I'm curious to hear if anyone else uses this SQL functionality within Smallworld.