Jump to content
Server Maintenance This Week. ×

How to Debug FQL


This topic is 3213 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

  • 1 year later...

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.

  • Like 2
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 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?

Link to comment
Share on other sites

This topic is 3213 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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