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.

Using ExecuteSQL Query in Stored Claculations

Featured Replies

I am new to Filemaker 12 and eager to utilize ExecuteSQL queries as much as possible, but unsure of its strengths and limitations.

Here is an example of a common scenerio in my database that I am hoping to streamline with its use:

When I generate a report in my database that is filtered through a KEY calculation field, I am limited by the fact that the data is used to calculate the KEY field has to be indexed for the report to generate. In order for the KEY field to remain indexed, any data that is referenced in the KEY calculation has to also be stored. If the referenced data comes from another table or relationship, that data will not refresh on its own without using a script.

I know that ExecuteSQL is somehow a better fit here, but I am not sure where it can be used best Should I replace each LOOKUP field that is used by the KEY with a stored ExecuteSQL calculation, or am I better off to place my Queries right in the KEY calculation, and get rid of the other lookup fields altogether?

Do ExecuteSQL Queries remain refreshed at all times? Can they slow down the database by using them too much?

No and no.

ExecuteSQL() is just another function and follows the rules of all other functions. If it's in a calculation field and references a related field, FMP will required it to be unstored. If it's in an auto-enter calculation, it won't refresh unless a local field referenced in the calculation is modified.

On a related note, I don't see Lookups as being useful. Auto-enter calcs are the way to go. But we may not be in agreement with what "Lookup" means in your post.

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.