« FileMaker and Xojo Me… | Home | MBS FileMaker Plugin,… »

Execute SQL in FileMaker and get back native field types

Yesterday I met some FileMaker developers in Munich and in our discussion at one point there was a talk about the fact that executing SQL in FileMaker gives you only text. No way to get back the field value in it's original type. Containers are returned as file name, dates/times converted to text as well as numbers.

So today I wrote a few new plugin functions:

FM.SQL.Execute takes a SQL query and optional a file name and parameters. The query is executed and the function returns an error message or on success a reference number. This reference number can be used to query data from the result. FM.SQL.RowCount tells you the number of rows while FM.SQL.FieldCount tells you the number of fields in each row. FM.SQL.Field returns a field value and FM.SQL.FieldType the type of that field. Finally you use FM.SQL.Release to release the result from memory.

The great thing is that you can now use the plugin to run queries and get containers, dates, times and numbers back from the result without conversion to text. With next prerelease plugins we'll include an example database which shows this. Claris FileMaker Plugin
18 04 15 - 13:15