sql.debug ( )

Function stats

Average user rating
FileMaker 10.0 +
Date posted
28 July 2012
Last updated
28 July 2012
Recursive function

Author Info
 Andries Heylen

11 functions

Average Rating 4.9



Function overview


sql.debug  ( _executeSQL )


_executeSQL  the ExecuteSQL() function call


Tags:  Sql   Debug  

This function will help you to debug your SQL statement if it returns a "?". Unfortunately this technique only works in the dataviewer (and not even with the "Edit Expression" window open, so you need to click on "Monitor" first).

Actually what we discovered is that when you send an ExectuteSQL ( ) calculation to a custom function, when evaluated in the dataviewer, you will actually see the error returned by the internal FQL engine of FileMaker.


Sample input

sql.debug ( ExecuteSQL ( "SELECT unexistingfield from table" ; "" ; "" ) )

Sample output

The column named "unexistingfield" does not exist in any table in the column reference's scope.


Function code

If (

//the sql call results in an error, return empty so the error will be returned
_executeSQL = "?" ; "" ;

//the sql call is executed correctly, just return the result

// ===================================

    This function is published on FileMaker Custom Functions
    to check for updates and provide feedback and bug reports
    please visit http://www.fmfunctions.com/fid/335

    Prototype: sql.debug( _executeSQL )
    Function Author: Andries Heylen (http://www.fmfunctions.com/mid/57)
    Last updated: 28 July 2012
    Version: 2.2

// ===================================



28 July 2012

how the f... did you discover this?
great !
  General comment
Andries Heylen
28 July 2012

Working with Andreas on MagicValueList, and suddenly I saw this error message in his dataviewer :-)
  General comment
29 July 2012

Wow, that's cool!
  General comment
Mr Vodka
31 July 2012

Nice find Andries!
  General comment
24 February 2013

Hello, I am new to FMPro but have plenty of rdbms/sql experience.
Can you explain how one might use this function?
I've created a 'Calculation' field in a table and attempted to write a multi-table aggregation (using SUM()), but I get a '?', and am trying to debug.
Being unfamiliar with FMP, I'm not sure how to actually use this function.
Also, google suggests that 'Data Viewer' may only be available in FMP Advanced.
Can this be used in the base FMP program?
If so, how?
TiA for any further direction you can give !
  General comment
Andries Heylen
24 February 2013

you need filemaker pro advanced for this custom function... sorry. the data viewer is indeed only available in fmpro advanced.
  General comment
07 October 2013

how can i use this function?, is necessary install?, i am novice in filemaker. thanks.
  General comment
03 July 2014

Ok. Struggling here. How to use it. I put the code in a function. Then I have a script step that sets a variable to sql.debug(my query) but when I use script debugger and data viewer I never see the error. Anyone know what I may be doing wrong?
  General comment






Top Tags

Text Parsing  (33)
List  (32)
Date  (30)
XML  (27)
Format  (23)
Sql  (22)
Dev  (20)
Debug  (17)
Layout  (15)
Interface  (15)
Text  (14)
Variables  (13)
Filter  (12)
Design  (11)
Layout Objects  (11)
Array  (8)