Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
FM.ExecuteSQL.LastErrorMessage
Queries the last error message from an SQL call
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
FM FMSQL | 3.0 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
MBS( "FM.ExecuteSQL.LastErrorMessage" )
Parameters
none
Result
Returns error message.
Description
Queries the last error message from an SQL callSet by FM.InsertRecord, FM.SQL.Execute, FM.ExecuteSQL, FM.ExecuteFileSQL, FM.ExecuteSQLOnIdle and other SQL using functions.
If last error code was 0 (no error), you get an empty string.
Error may be something like this:
ERROR: FQL0007/(1:7): The column named "fieldname" does not exist in any table in the column reference's scope.
Error | Message |
FQL0001 | There is an error in the syntax of the query. |
FQL0002 | The table named "?0" does not exist. |
FQL0003 | The table named "?0" already exists in this query. |
FQL0004 | The query is too complex. The maximum number of tables has been exceeded. |
FQL0005 | Expressions involving aggregations are not supported. |
FQL0006 | "The column named "?0" appears in more than one table in the column reference's scope." |
FQL0007 | The column named "?0" does not exist in any table in the column reference's scope. |
FQL0008 | The table named "?0" does not exist in the column reference's scope. |
FQL0009 | The column named "?1" does not exist in table "?0". |
FQL0010 | The literal value "?0" is not a valid DATE, TIME or TIMESTAMP. |
FQL0011 | Predicate must contain a logical operation (=, <, OR, AND, IS NULL, ...). |
FQL0012 | The ordinal reference "?0" in the ORDER BY clause is not valid. |
FQL0013 | Incompatible types in assignment. |
FQL0014 | The number of values in a VALUES row value constructor does not match the number of values in the target. |
FQL0015 | The number of values in an INSERT...SELECT statement does not match the number of values in the target. |
FQL0016 | A subquery contains an illegal outer reference to a column in the INSERT's target table. |
FQL0017 | An expression contains data types that cannot be compared. |
FQL0018 | An expression contains incompatible data types. |
FQL0019 | The result data type of a CASE expression cannot be inferred; they are all NULL. |
FQL0020 | An invalid number of parameters was supplied to the function "?0" |
FQL0021 | Parameter number ?0 to the function "?1" is not of the correct type. |
FQL0022 | A subquery expression must have exactly one value in the SELECT list. |
FQL0023 | A CAST expression requested an invalid data type conversion. |
FQL0024 | A reference to ROWID must be qualified if more than one table is present in the query. |
FQL0025 | All non-aggregated column references in the SELECT list and HAVING clause must be in the GROUP BY clause. |
FQL0026 | The number of columns in both inputs to a UNION operation must be the same. |
FQL0027 | The data types of corresponding columns in the inputs to a UNION operation must be the same. |
FQL0028 | Field repetitions must be numeric and between 1 and ?0. |
FQL0029 | A field repetition in the SET clause of an UPDATE statement must be a constant. |
FQL0030 | "?0" is an invalid function. |
FQL0031 | The the parameter's type cannot be inferred in this context. At least one query parameter must be an expression, a column or a constant. |
FQL0032 | A query may contain either named parameters or dynamic parameters, but not both. |
FQL0033 | Column names in FROM clause subqueries must be unique. |
FQL0034 | The number of output columns in a FROM clause subquery must match the number of columns in the table's name list. |
FQL0035 | Cursor support is not enabled for this query. |
FQL0036 | A cursor with the name "?0" already exists. |
FQL0037 | There is no cursor with the name "?0". |
FQL0038 | The cursor "?0" is already open. |
FQL0039 | The cursor "?0" is not open. |
FQL0040 | The target cursor "?0" does not reference a query that is valid for WHERE CURRENT OF . |
FQL0041 | The target cursor "?0" does not reference the same table as the current statement. |
FQL0042 | The default value for column "?0" does not match the column's data type. |
FQL0043 | The string "?0" is not a valid stream name. |
FQL0044 | The column "?0" is not valid in this context. The targets of GETAS and PUTAS must be Container fields. |
See also FM.ExecuteSQL.LastError. Use FM.ExecuteSQL.LastSQL to get the SQL command.
If you get error "FQL0013 Incompatible types in assignment" when using FM.InsertRecord or similar functions, the data type doesn't match. For a numeric field, you can use GetAsNumber() in the call to make sure the value is numeric. Same for date/time/timestamp fields with GetAsDate/GetAsTime/GetAsTimestamp functions and of course text fields, which may need a GetAsText().
See also
- FM.InsertRecordCSV
- FM.InsertRecordQueryIgnoreDuplicates
- FM.InsertRecordTSV
- FM.SQL.Execute
- JSON.Import
- Matrix.InsertRecords
- SQL.InsertOrUpdateRecords
- SQL.InsertRecords
- XML.Import
- XML.Import.Work
Example Databases
Blog Entries
- Storing data in the FileMaker schema
- Comparing Base Elements Plugin to MBS FileMaker Plugin
- ExecuteSQL and getting error details
- MBS Filemaker Plugin, version 3.2pr2
- Create fields in Filemaker database from a Script
- MBS Filemaker Plugin, version 3.0pr2
FileMaker Magazin
This function is free to use.
Created 18th August 2014, last changed 27th August 2024