fm_sql_execute


mixed fm_sql_execute ( string $sql_query [, string $file_name [, arguments... ]] )


 

Description


Allows you to perform SQL DELETE, INSERT or UPDATE queries against a FileMaker file.

See FileMaker’s SQL Reference for more info on SQL support in FileMaker.

 

Parameters


sql_query (required)
A valid SQL DELETE, INSERT or UPDATE statement. The query must begin with “DELETE, INSERT or UPDATE”.

file_name (optional) (only available in FileMaker 11 or higher)
Allows you to specify the name of the file in which to run the query. The current file will be used by default so this is only needed if the table(s) you’re querying are in a different file. Note that the file must be open.

arguments... (optional) (only available in FileMaker 11 or higher)
Any number of optional arguments corresponding to the dynamic parameters (?’s) in your query.

 

Return


Returns true if the query executes successfully or false if an error occurs.

Most errors are caused by invalid SQL statements. Use fm_get_last_error to get error details.

 

Errors


There are no errors for this function but note that fm_get_last_error will return “106 Invalid parameter” if the query doesn’t begin with “DELETE, INSERT or UPDATE”.

 

Example 1 - Concatenate 3 strings
// Todo

Change Log

VersionDescription
3.0.0Added optional parameters: file_name and arguments...