Subject | Re: [firebird-support] extract as insert statement on unix |
---|---|
Author | Martijn Tonies |
Post date | 2008-07-31T12:18:22Z |
Hello Nick,
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
> before I start thinking about writing something that does this, is anyoneWell, a tool like Database Workbench could do that for you :-)
> 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)
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