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.

Fast delete of all records via an ESS connection

Featured Replies

Hi,

I currently have a FileMaker file loaded onto Server 19. The file has an ESS connection to a MySQL server at a different host. I need to delete all of the records in the MySQL database once a week and upload fresh data via the FM Server. I got it to work on the server using a FileMaker layout and the Delete All Records script step. I'd like to speed up the deletion of the files on MySQL server via the ESS connection. I have tried to use the ExecuteSQL script step with DELETE FROM mytable, but nothing happens. I also notice that when I try to specify the ODBC Data Source, it is empty and I can't add anything, although the Filemaker files has two connections. What am I doing wrong? Any help is appreciated.

04-17-2024-13.04.54.jpg

04-17-2024-13.05.03.jpg

04-17-2024-13.05.15.jpg

35 minutes ago, Fred_S said:

I'd like to speed up the deletion of the files on MySQL server via the ESS connection.

Provided you're willing to use a plugin: 

https://www.mbsplugins.eu/component_SQL.shtml

...as an alternative to using ESS.

--sd

I know practically nothing about ODBC, so I cannot help you there.

But perhaps it might be sufficient to use the Truncate Table script step instead? According to the help:

Quote

This script step may be faster than the Delete All Records script step for deleting a large number of records.

 

Edited by comment

  • Author
1 hour ago, comment said:

I know practically nothing about ODBC, so I cannot help you there.

But perhaps it might be sufficient to use the Truncate Table script step instead? According to the help:

 

Thanks, @comment but it does not show ESS Tables, just the internal FileMaker files.

image.thumb.jpeg.b2d83a5a3a1db14e3787fa9fcd3445ce.jpeg

 

 

  • Author
10 hours ago, Søren Dyhr said:

Provided you're willing to use a plugin: 

https://www.mbsplugins.eu/component_SQL.shtml

...as an alternative to using ESS.

--sd

Thanks, @Søren Dyhr  MBS( "FM.ExecuteFileSQL"; ""; "DELETE FROM JitBit_Data") deletes twice as fast as the Delete All Records script step!

Now, I'm trying to figure out if there's a TRUNCATE option.

1 hour ago, Fred_S said:

Now, I'm trying to figure out if there's a TRUNCATE option.

I do know next to nothing about the scenario here, but I've learned that while you directly can read and write, between the RDBS'es is it good practice instate a broker-file in between, where audit logging is made to ensure errors is caught ... to be acted upon. It's Murphys law, if anything can go wrong, it eventually does it! ...and oftentimes is it networking. All syncing of tables in different places is basically wrong when speaking of relational databases although it's done all the time.

But i wish to convey here, was that if you sync over a broker-system ... is the mirroring done pretty often, and records are never deleted, in either of the RDBS's - but just marked as not active.

--sd

Edited by Søren Dyhr

  • Author

In this case, the data is not mission critical if there is an error, the process can just be restarted. We just need the most up-to-date information available on a public facing website which is driven by a MySQL database and a PHP script. Each upload is about 1500 records.

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.