You don’t really need to use an external script. Set up a simple connector to your database and an appropriate sql string to pass to SQLSelect(). Look at the examples where it is done to in-memory databases. Works the same on existing databases as well. You can do this through the action event of a button, or use a textarea for the sql statements and process them using a button event.
The idea to put the SQL strings into a text file is not that bad (especially for complex ones), as Xojo doesn’t support multiline strings without concatenation. Just drag the text file with the SQL string into the project. The file name (without extension) will become the project item name which is also a globally available string.
If a file with the name Test.sql contains SELECT * FROM tableXYZ, you’ll have a global string variable in your project with the name Test. To test you can do:
MsgBox(Test) // shows "SELECT * FROM tableXYZ"
Note that the file will be accessible for everyone in the resources folder of the compiled application. This might be good or bad, depending on your application.