August 27Aug 27 Hi,I've got a script that grabs a numeric value from record #1 in a SQL table (SYS_TAB) (that only has ONE record EVER), a "last transaction number", to increment by one, then use that new value to update that SYS_TAB and three other SQL tables (INV_HDR, INV_REG, INV_TTL.Sometimes, the value appears to NOT be returned properly, and I cannot figure out why...It's SQL Server 14.0.1000.169, FileMaker 2026 (26?)I have a log entry being created (partial here), as: ["notes"; "Save audit history, Trn #: " & $$ln_F1032 & ", User: " & $$UserID ; JSONString];..... and when this happens, the value in the string for $$ln_F1032 shows as a "?" (no quotes).I've tried grabbing the value using FileMaker (External Data Source), and also using " ExecuteSQL ("SELECT F1032 FROM SYS_TAB" ; "" ; "") " to set the variable (currently in the code, as the FileMaker EDS failed).Can anyone shed light on what causes the variable $$ln_F1032 to show as a question mark, and/or why this SOMETIMES fails, but works MOST of the time, no matter which method I use to grab that value?Thanks in advance.
August 29Aug 29 On 8/27/2026 at 8:05 PM, RCrosier said:what causes the variable $$ln_F1032 to show as a question markFrom the help:"If an error occurs during query parsing or execution, ExecuteSQL returns ?. To receive more detailed error information, use ExecuteSQL in the Data Viewer, or use the ExecuteSQLe function. See FileMaker SQL error codes in the FileMaker SQL Reference."https://help.claris.com/en/pro-help/content/executesql.htmlIf you are using the Execute SQL script step to query an ODBC source you can use the Get(LastErrorDetail) function to return the latest error state returned by ODBC.https://help.claris.com/en/pro-help/content/execute-sql.html Edited August 29Aug 29 by comment
August 31Aug 31 Author On 8/29/2026 at 4:53 PM, comment said:From the help:"If an error occurs during query parsing or execution, ExecuteSQL returns ?. To receive more detailed error information, use ExecuteSQL in the Data Viewer, or use the ExecuteSQLe function. See FileMaker SQL error codes in the FileMaker SQL Reference."https://help.claris.com/en/pro-help/content/executesql.htmlIf you are using the Execute SQL script step to query an ODBC source you can use the Get(LastErrorDetail) function to return the latest error state returned by ODBC.https://help.claris.com/en/pro-help/content/execute-sql.htmlI do now have the "Get(LastErrorDetail)" in my code, which I put in there right after this happened... it has not happened since, for me to try to figure out what caused it. Thanks.
Create an account or sign in to comment