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.
Juggernaut

question re import from mysql

Featured Replies

I'm working with a Filemaker database which is imported from a mysql server every night. It's imported, rather than set up as a direct external data source, for reasons of speed - it's just too slow to use otherwise. So up to now I have been doing an "add" import, by adding all the records from the external source, deleting all the omitted records if it succeeds, otherwise on an error, deleting the new imported records, and then showing the omitted ones again. Because of this, I've been careful to run the script after hours, because I worry that connected users may have trouble during this process, or records may be locked by users, and so the script would fail and leave a mess. In addition, the reason for doing an "add" rather than an "update" import, was because there were some join tables in the external data source that did not have primary keys, and I found that an "update" in that case would take way too long to complete, if ever. But now I've corrected that problem on the external data source, so all my imports can be the "update" type, adding new records if there are any, and I am not deleting anything in the event of an error. With this in mind, is it safe to run the script during normal hours? I suppose there still could be locked records, but I can trap for that, and try to commit them or halt the script with an error.

  • Author

Another concern I have is this - does an “update” type import delete records that don’t exist in the source anymore (matched by ID)? Or does it just add new ones and leave the old ones untouched?

 

-- NVM, I found the answer to this is yes it deletes

Edited by human
found the answer

1 hour ago, human said:

I found the answer to this is yes it deletes

No, it doesn't.  It merely omits them. Where do you find your "answers"?

 

  • Author
1 hour ago, comment said:

No, it doesn't.  It merely omits them. Where do you find your "answers"?

 

I tested it and I thought that it was deleted - perhaps I didn't see that it was "omitted" - I'll check that now. If it was omitted, then I I should be able to do "show omitted only" and then "delete found records" to zap them - correct?

  • Author
33 minutes ago, human said:

I tested it and I thought that it was deleted - perhaps I didn't see that it was "omitted" - I'll check that now. If it was omitted, then I I should be able to do "show omitted only" and then "delete found records" to zap them - correct?

You are correct. they are omitted, not deleted. But my method works I think. Thanks

Edited by human

  • Author

I would like to re-ask the original question, in simplified form: is it safe to do "update" type imports while users may be accessing the data? The data in FM is read-only, so they can't be editing it while updating it, but there could still be things like find operations going on while the import is running.

Edited by human
correction

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.