Discussion:
How to create automatically a .SQL file?
W O
2013-08-29 17:16:26 UTC
Permalink
Hello everybody

In a Firebird's datatabase I have a large table with thousands of records,
is there a simple way for send these records to a text file?

My idea is to have a script with the "INSERT INTO" commands.

Something like it:

INSERT INTO MyTable(MyCol1, MyCol2, MyCol3) VALUES(1, 'Alicia', 444555);
INSERT INTO MyTable(MyCol1, MyCol2, MyCol3) VALUES(2, 'Beatriz', 654321);

So, when I initialize the database in another location I can put all those
records into it using the INPUT command of ISQL.

Greetings.

Walter.


[Non-text portions of this message have been removed]



------------------------------------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Visit http://www.firebirdsql.org and click the Resources item
on the main (top) menu. Try Knowledgebase and FAQ links !

Also search the knowledgebases at http://www.ibphoenix.com

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/firebird-support/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/firebird-support/join
(Yahoo! ID required)

<*> To change settings via email:
firebird-support-***@yahoogroups.com
firebird-support-***@yahoogroups.com

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

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
Ann Harrison
2013-08-29 18:35:17 UTC
Permalink
Post by W O
In a Firebird's datatabase I have a large table with thousands of records,
is there a simple way for send these records to a text file?
My idea is to have a script with the "INSERT INTO" commands.
INSERT INTO MyTable(MyCol1, MyCol2, MyCol3) VALUES(1, 'Alicia', 444555);
INSERT INTO MyTable(MyCol1, MyCol2, MyCol3) VALUES(2, 'Beatriz', 654321);
So, when I initialize the database in another location I can put all those
records into it using the INPUT command of ISQL.
That's the least efficient way to insert data - using a prepared statement
that
you activate and pass data to is much faster. Why not just backup the
source
and restore it to the new location? If you only want part of the data, you
could
write your data to an external file, then copy the external file to the
empty database
in the new location and move the data from the external to the internal
table. Or
use a tool that copies tables between databases.

Good luck,

Ann


[Non-text portions of this message have been removed]



------------------------------------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Visit http://www.firebirdsql.org and click the Resources item
on the main (top) menu. Try Knowledgebase and FAQ links !

Also search the knowledgebases at http://www.ibphoenix.com

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/firebird-support/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/firebird-support/join
(Yahoo! ID required)

<*> To change settings via email:
firebird-support-***@yahoogroups.com
firebird-support-***@yahoogroups.com

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

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
W O
2013-08-29 18:53:58 UTC
Permalink
Hello Ann

Thank you very much for your answer.

The databases are in location, the tables too, but without records yet, so
I need to populate them. It is not possible a full backup/restore from a
location to another because many tables has data and each location has its
own data. There are some tables with common data and those I need to have
in all the places.

Greetings.

Walter.
Post by W O
**
Post by W O
In a Firebird's datatabase I have a large table with thousands of
records,
Post by W O
is there a simple way for send these records to a text file?
My idea is to have a script with the "INSERT INTO" commands.
INSERT INTO MyTable(MyCol1, MyCol2, MyCol3) VALUES(1, 'Alicia', 444555);
INSERT INTO MyTable(MyCol1, MyCol2, MyCol3) VALUES(2, 'Beatriz', 654321);
So, when I initialize the database in another location I can put all
those
Post by W O
records into it using the INPUT command of ISQL.
That's the least efficient way to insert data - using a prepared statement
that
you activate and pass data to is much faster. Why not just backup the
source
and restore it to the new location? If you only want part of the data, you
could
write your data to an external file, then copy the external file to the
empty database
in the new location and move the data from the external to the internal
table. Or
use a tool that copies tables between databases.
Good luck,
Ann
[Non-text portions of this message have been removed]
[Non-text portions of this message have been removed]



------------------------------------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Visit http://www.firebirdsql.org and click the Resources item
on the main (top) menu. Try Knowledgebase and FAQ links !

Also search the knowledgebases at http://www.ibphoenix.com

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/firebird-support/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/firebird-support/join
(Yahoo! ID required)

<*> To change settings via email:
firebird-support-***@yahoogroups.com
firebird-support-***@yahoogroups.com

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

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
chris.waldmann
2013-08-29 18:54:40 UTC
Permalink
Post by W O
Hello everybody
In a Firebird's datatabase I have a large table with thousands of records,
is there a simple way for send these records to a text file?
My idea is to have a script with the "INSERT INTO" commands.
INSERT INTO MyTable(MyCol1, MyCol2, MyCol3) VALUES(1, 'Alicia', 444555);
INSERT INTO MyTable(MyCol1, MyCol2, MyCol3) VALUES(2, 'Beatriz', 654321);
So, when I initialize the database in another location I can put all those
records into it using the INPUT command of ISQL.
Greetings.
Walter.
[Non-text portions of this message have been removed]
Hi Walter
I use IBExpert for this, but I don't now if the personal editon has this Export option.
You can use also FlameRobin

Happy coding
Christian




------------------------------------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Visit http://www.firebirdsql.org and click the Resources item
on the main (top) menu. Try Knowledgebase and FAQ links !

Also search the knowledgebases at http://www.ibphoenix.com

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/firebird-support/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/firebird-support/join
(Yahoo! ID required)

<*> To change settings via email:
firebird-support-***@yahoogroups.com
firebird-support-***@yahoogroups.com

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

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
W O
2013-08-29 19:01:29 UTC
Permalink
Thank you very much for your answer Christian, I shall try your sugestion.

Greetings.

Walter.




On Thu, Aug 29, 2013 at 2:54 PM, chris.waldmann <
Post by W O
**
Post by W O
Hello everybody
In a Firebird's datatabase I have a large table with thousands of
records,
Post by W O
is there a simple way for send these records to a text file?
My idea is to have a script with the "INSERT INTO" commands.
INSERT INTO MyTable(MyCol1, MyCol2, MyCol3) VALUES(1, 'Alicia', 444555);
INSERT INTO MyTable(MyCol1, MyCol2, MyCol3) VALUES(2, 'Beatriz', 654321);
So, when I initialize the database in another location I can put all
those
Post by W O
records into it using the INPUT command of ISQL.
Greetings.
Walter.
[Non-text portions of this message have been removed]
Hi Walter
I use IBExpert for this, but I don't now if the personal editon has this Export option.
You can use also FlameRobin
Happy coding
Christian
[Non-text portions of this message have been removed]



------------------------------------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Visit http://www.firebirdsql.org and click the Resources item
on the main (top) menu. Try Knowledgebase and FAQ links !

Also search the knowledgebases at http://www.ibphoenix.com

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/firebird-support/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/firebird-support/join
(Yahoo! ID required)

<*> To change settings via email:
firebird-support-***@yahoogroups.com
firebird-support-***@yahoogroups.com

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

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
m***@panonnet.net
2013-08-31 09:38:27 UTC
Permalink
Hello, It would probably be more efficient to use FBExport because it uses a binary format, so file to transfer would be smaller. And you also get a benefit of being able to transfer BLOBs. http://www.firebirdfaq.org/fbexport.php It&#39;s a command line tool, specially built for tasks like the one you&#39;re describing. Regards, Milan Babuskov http://www.guacosoft.com

------------------------------------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Visit http://www.firebirdsql.org and click the Resources item
on the main (top) menu. Try Knowledgebase and FAQ links !

Also search the knowledgebases at http://www.ibphoenix.com

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/firebird-support/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/firebird-support/join
(Yahoo! ID required)

<*> To change settings via email:
firebird-support-***@yahoogroups.com
firebird-support-***@yahoogroups.com

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

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
W O
2013-08-31 14:35:04 UTC
Permalink
Thank you very much Milan, I shall try that.

Greetings.

Walter.
Post by m***@panonnet.net
**
Hello, It would probably be more efficient to use FBExport because it uses
a binary format, so file to transfer would be smaller. And you also get a
benefit of being able to transfer BLOBs.
http://www.firebirdfaq.org/fbexport.php It's a command line tool,
specially built for tasks like the one you're describing. Regards, Milan
Babuskov http://www.guacosoft.com
[Non-text portions of this message have been removed]



------------------------------------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Visit http://www.firebirdsql.org and click the Resources item
on the main (top) menu. Try Knowledgebase and FAQ links !

Also search the knowledgebases at http://www.ibphoenix.com

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/firebird-support/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/firebird-support/join
(Yahoo! ID required)

<*> To change settings via email:
firebird-support-***@yahoogroups.com
firebird-support-***@yahoogroups.com

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

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

Loading...