Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

So trying to use ExecuteSQL but needing a way to debug the query. I tried using the function sql.debug but I obviously am doing that wrong since I don't get any response. Looked for additional documentation on that function but no luck. How do you all debug sql statement?

 

Thanks

Thom

Hi Thom,

 

Did you do a google search for your keywords?

 

There is a file in our Download (see the button above) called SQL Builder. Seedcode, one of our sponsors also offers a free SQL file 

SQL Exploreer here

 

HTH

 

Lee

www.modularfilemaker.org has a SQL Builder tool available that has the debug function built in.

Wim, isn’t that the same one that pointed to in my reply “Download” above?

 

file in our Download (see the button above) called SQL Builder

 

Or is this a new tool?

Edited by Lee Smith
added quote

Hey Wim,

 

I forgot about that one and it is probably the one he will get the most out of.

 

Lee

 

p.s.

 

Here is an article by Kevin Frank and Beverly Voth Missing FM 12 Execute SQL Ref

Edited by Lee Smith
p.s.

  • 1 year later...

 Sigh. What a lot of waffle just to get to this:

 

If(statement = "?"; ""; statement)

put that in a custom function and wrap it around your executeSQL call.

Your point is?

 

The tool referenced allows you to do this without having to build it into your dev environment IF you don't want to and to be able to tackle it from a standalone perspective.

You're referencing this "as a lot of waffle" does not do justice to the folks and their brainpower that are trying to bring us tools to do this and allowing us to check it from a a place that does not require us to code it into one place.

If the OP is talking about this custom function, it only works in the data viewer. It will display the actual error.

@wintergreen, I would argue that displaying nothing is not the same thing as debugging.

Just to add to the options . . . there are also some good ideas, and well-articulated debate!, over at FM Standards.org re ideas for formatting ExecuteSQL ( ) calcs so as to facilitate debugging.

  • 2 weeks later...

 Sigh. What a lot of waffle just to get to this:

 

If(statement = "?"; ""; statement)

put that in a custom function and wrap it around your executeSQL call.

Actually, if you go to the filemaker hacks article (get the PDF), you 'll see that I used EvalutionError() to help. Also, looking at the query in Data Viewer can point out many errors.

Just to add to the options . . . there are also some good ideas, and well-articulated debate!, over at FM Standards.org re ideas for formatting ExecuteSQL ( ) calcs so as to facilitate debugging.

That tells you how to get fields in the query that might otherwise break the query if 'hard-coded' and any of the names change.

There are many ways to "format" the eSQL to make it easier to debug (mostly to help you read it). I tend to use $vars, as these can be helpful while using Data Viewer. Then when the query works, just use any named var within the Let().

There have been links to several "builders" that can take some of the "pain" out of writing queries if you don't understand how or are getting many errors. Keep in mind that ExecuteSQL() is not going to let you do queries as you might in one of the big-gun SQL dbs. Perhaps if OP posted the query we can help point out errors?

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.