Subject Re: [firebird-support] Dump data into sql scripts
Author Milan Babuskov
Ann W. Harrison wrote:
> I've just been asked by a support customer how to dump a Firebird
> database into a script that can be run with ISQL to recreate and
> repopulate the database including blobs. I thought that IBExpert did
> that, but the customer informs me that the scripts generated can only be
> run through IBExpert and they "don't want to distribute IBExpert". I
> suggested gbak but "management won't allow it."
> Suggestions?

1. Metadata: isql -x
2. Data: FBExport

FBExport creates INSERT statements, so you don't need anything but isql
on the other side. Unless, of course, if you have blobs in which case
you can use FBExport's binary format (.fbx) and you need to have
FBExport at both sides. If you do use .fbx format, you have better
control of import process: insert or update, error checking and ability
to stop at X errors (where X is user given number), transaction control
- commit/rollback on errors, etc.

If they are really nitpicking about having INSERT statements in separate
file, you could do the following:

1. isql -x metadata.sql
2. fbexport -Si -Q "select without blob columns" ... -F insert.sql
3. fbexport -S -Q "select pk, blob columns" ... -F blob.fbx

This way you'll have INSERTs in one file, and blobs in second.
Rebuilding database would look like this:

1. isql -i metadata.sql
2. isql -i insert.sql
3. fbexport -I -Q "update blob columns where pk = :1" -F blob.fbx

Milan Babuskov