Subject Re: [firebird-support] extract as insert statement on unix
Author Martijn Tonies
Hello Nick,

> before I start thinking about writing something that does this, is anyone
> aware of one that already exists.
>
> I want to do "select a,b from mytable where c < 97" and have the output as
> insert statements, automatically, on unix (fedora 8 to be precise)

Well, a tool like Database Workbench could do that for you :-)

As a workaround, you could also write:

SELECT 'INSERT INTO mytable (a, b) VALUES (' || A || ', ' || B || ');'
from mytable where c < 97

Export the resultset to file and you should have your script.

Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, NexusDB, Oracle &
MS SQL Server
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com