Re: Export all fields



In article <slrnfi3edk.o4u.t-use@xxxxxxxxxxxxxxxxxxxxxxxxx>,
Martin Trautmann <t-use@xxxxxxx> wrote:

I'll try a real example.

Imagine a backup script that should save all data. Let's assume the mail
merge format, since it offers a first record with field names.

Now you want to save everything, every day.
Automatic execution and file renaming from "backup.txt" to
backup-$year-$month-$day is already solved.

You have a database with

- Table A: Fields A1, A2
- Table B: Fields B1, B2

AFAIK you could export records reasonably only by exporting as table per
table to file per file? (one export to backup-A.txt from A and another
backup-B.txt for table B)

When you do it manually, you will do e.g.

Goto layout (which does contain B-records)
Select all records
(sort or unsort)
Export records
-> to file "backup.txt"
-> with format "mail merge"
-> encoding "UTF-8"
... and take table B, move all fields from the left
to the right column and perform it.

A script will repeat these steps. When you define the export command,
you will use this export order again:

B::B1, B::B2

All of this should be done without confirmation, automatically


No you will modify your database:
* rename field B::B1 to B::id
* rename table B to table "data"
* create field "comment" in this table

What will happen when you export the data?
I'd expect that the record will contain
data::id, data::B2

... but I doubt that data::comment would be included.

Is there an option to do the same as the manual "move all fields"?
I guess: no for FMP's Script-Maker, while some external tools (e.g.
Automator) could do this task on dedicated platforms.

- Martin

I think I understand your point.

To get a complete backup by export, you have to do an export from each
of the tables. You would need separate script steps for each of the
tables.

You can do "move all fields" in the script step when you specify fields
for export. If you add a field later, you will have to go back and
re-specify the fields for export to include the new field,

I think that is what you were getting at.
.



Relevant Pages

  • Re: PHP/MySQL Database backup script
    ... decent MySQL backup script on my remote servers. ... database on local hard drive (local as same as the web server is run on). ... which I don't have on these cheapo cPanel type hosting arrangements. ...
    (alt.php)
  • Re: PHP/MySQL Database backup script
    ... decent MySQL backup script on my remote servers. ... which I don't have on these cheapo cPanel type hosting arrangements. ...
    (alt.php)
  • Re: permission of script linked to cron
    ... directory run as root irrespective of where the link points to. ... Place a link to the following script and examine its ... input of the sudo command. ... the backup script to have the permission of root. ...
    (Debian-User)
  • Re: permission of script linked to cron
    ... directory run as root irrespective of where the link points to. ... Place a link to the following script and examine its ... input of the sudo command. ... the backup script to have the permission of root. ...
    (Debian-User)
  • Re: help with linux backup script
    ... > I am wondering if anyone could help with a backup script. ... shares, in particular smb shares. ... into a logfile and mail it to myself as the last line in the script... ...
    (comp.os.linux.misc)