Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old


Queries the last error code from an SQL call

Component Version macOS Windows Linux Server iOS SDK
FM FMSQL 1.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "FM.ExecuteSQL.LastError" )




Queries the last error code from an SQL call
Set by FM.InsertRecord, FM.SQL.Execute, FM.ExecuteSQL, FM.ExecuteFileSQL or FM.ExecuteSQLOnIdle.
The Errors number s are the same ones as the ones retuned by Native FileMaker function "Get(LastError)" Examples: 1200 - Generic Calculation Error" 200 - "Access Denied" 106 - "Missing Table" Known Limitations: Record Locking Errors are Not Reported! This means you must exercise caution when using UPDATE. There is no way to determine if an update actually occurs unless you check the value again after the update occured.
In general error 8309 is a semantic error, so something is wrong in your SQL. 8310 is a syntax error, something in the SQL is not correctly parsed.
Error 8309 means you did pass wrong data type, like string for a number.
See also FM.ExecuteSQL.LastErrorMessage.


Get Last SQL Error

MBS( "FM.ExecuteSQL.LastError")

See also

Example Databases

Blog Entries

This function is free to use.

Created 18th August 2014, last changed 14th September 2015

FM.ExecuteSQL - FM.ExecuteSQL.LastErrorMessage