How to create a quick and dirty SQL screen for a FileMaker database:
1. Create a data table. I call it SQLWB. Give this table two text fields: “Query” and “Result”. Both of these will be text fields.
2. Modify the layout I call it SQL Workbench.
3. Resize the two fields to show a larger amount of text. I add a scrollbar to the end of each field
4. Create a scripts to run the query. I call it RunSQLQuery.
Set Field [SQLWB::Results; ExeuteSQL (SQLWB::Query;””;””)]
5. Create a script to clear the two text boxes. I call this script ClearResults.
Set Field [SQLWB::Query;””]
Set Field [SQLWB::Results;””]
6. Add two buttons to the layout; one for each of the scripts.
The result will look something like this:
Note that this isn’t a full-blown SQL implementation, it will only respond to SELECT statements. (You can’t INSERT or DELETE, for example. Also, if there any problems with your SQL syntax, the result box will only show a question mark.