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

Preserving Serials on Import & Export

Featured Replies

After 2 1/2 not totally pleasant months, one of the databases im working on is almost finished (yay). Now comes the fun part, exporting and importing, with 46 tables, the actual export script shouldnt be to difficult, however my query comes about the serial keys. Almost all of my tables have an incrementing primary key.

A) I forgot the functions to pull out (and set) the next serial key in the particular field of a table.

:) I have no idea where to store them so that i can restore them after an import.

Cheers for help, I really am not thinking to well lately so thanks for putting up with my fun questions.

~Genx

The import "wizard" has a setting to disable auto-enter on the imported records, so your old primary keys are safe if you choose that option. All you'd need to do is reset the "next" value in the pk's field definition.

  • Author

Well, that solves one problem, but, lets say i export all my records, where would i store the "next" serial value for a particular table so that i could set / "restore" it in the other file?

Thanks,

~Genx

  • Author

Maybe a global field that stores the last serial? I import that into the other file and restore that value using a script. Would this work?

There is a special Design function, GetNextSerialValue ( fileName ; fieldName )

Now, it has a weakness, in that both the file name and the field name may need to be entered as plain text. But when doing such an "update" routine you would know the file name and the field name (which would be an auto-entered serial ID field).

You'd use a special script step also. The whole thing looks like:

Set Next Serial Value [ GetNextSerialValue ( fileName; fieldName ) ]

And be grateful that you are "Young & Reckless", because what we had to do before FM added these was really awful, multiple Replaces to increment the number.

  • Author

Hehe, i love it, Thanks Fenton. I assume field name would be entered in the format "tablename::fieldname", and both files would have to be open. Based on this assumption, yay, i never really thought of having both files open at once. So thanks again guys.

~Genx

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

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.