Subject RE: [firebird-support] Re: Import data from flat files
Author Oleg Lebedev
Putting sql in the file and running it won't work for me. The reason is
that I wanted to save myself some time and write a shell script that
would, say drop multiple tables (this is a very simple example). So, I
would have an array of table names I need to drop and a loop that goes
through all of them and sends a line "DROP TABLE $t_name" to isql.
Thanks.

-----Original Message-----
From: Fabrice Aeschbacher [mailto:fabrice.aeschbacher@...]
Sent: Wednesday, October 01, 2003 2:39 AM
To: firebird-support@yahoogroups.com
Subject: [firebird-support] Re: Import data from flat files
Importance: Low


--- In firebird-support@yahoogroups.com, Oleg Lebedev <oleg.lebedev@w.
..> wrote:
> Ok, great.
> I am wondering if there is a way to execute an SQL command through
some
> FB utiltity from a shell. Smth like:
> bash> time isql -c "SELECT count(*) FROM tableA" /tmp/mydb.fdb
>
> *************************************

Hi,

Put your SQL command into a command.sql file. This file must start
with:

SET NAMES ISO8859_1;
CONNECT 'host:/path/to/database.fdb'
USER 'SYSDBA'
PASSWORD 'masterkey';

Then try running isql with "-i" option:

$isql host:/path/to/database.fdb -u SYSDBA -p masterkey -o isql.out -m
-e -i command.sql

HTH,
Fabrice



To unsubscribe from this group, send an email to:
firebird-support-unsubscribe@yahoogroups.com



Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/

*************************************

This e-mail may contain privileged or confidential material intended for the named recipient only.
If you are not the named recipient, delete this message and all attachments.
Unauthorized reviewing, copying, printing, disclosing, or otherwise using information in this e-mail is prohibited.
We reserve the right to monitor e-mail sent through our network.

*************************************