The table.external_record_content_get() function for dbf table works get, but it of course, does work with SQL. There is a similar replacement called SQL_LOOKUP() but it only returns the first value found. If you need a list from sql here is a function that might help.

This assumes you have a named connection.
?sql_table_content("district","districtname","bus_rpt=1") would give a a list of district names from table called district where the field bus_rpt was true. This can be used with or without a filter. The filter expression needs to be valid sql syntax.

FUNCTION sql_table_content AS C (table AS C, field AS C, filter AS C )
dim cn as SQL::Connection
cn.open("::name::MySQLConnection")
dim qry as c
if filter = "" then
qry = "SELECT "+ field + " FROM " + table
else
qry = "SELECT "+ field + " FROM " + table + " WHERE " + filter
end if

cn_result = cn.Execute(qry)
sql_table_content = cn.ResultSet.ToString()
cn.Close()
END FUNCTION