开发者

Looking for a Toad for oracle feature in mysql [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.

We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.

Closed 7 years ago.

Improve this question

Does anyone know any free tools that will generate insert statements given a result set? I know TOAD for Oracle does it, i would need this for a mysql database.

For example, if I execute this query

select colA, colB from mytable where colC = 'numbers'; //returns many rows


|colA | colB  |
|1    | 'one' |
|2    | 'two' |
|3    | 'three|

I would be able to get

insert into mytable (开发者_如何学CcolA, colB) values (1,'one');
insert into mytable (colA, colB) values (2,'two');
insert into mytable (colA, colB) values (3,'three');


There is a MySQL version of TOAD. It probably has the same ability to export result sets.


For MySQL you cna use the LOAD DATA statement


What's wrong with using SQL?

SELECT CONCAT(
    'INSERT INTO mytable (colA, colB) VALUES (',
    colA,
    ',\'',
    colB,
    '\';'
) AS line
FROM mytable
WHERE colC = 'numbers';

Or just skip the temp file and:

INSERT INTO dest_table (colA, colB)
SELECT colA, colB
FROM mytable
WHERE colC = 'numbers';


http://squirrel-sql.sourceforge.net/ is another tool that will allow this. It is Java based and works well for multiple databases.


Try sqldeveloper . This page may help you do what exactly you are trying to do.


HeidiSQL allows you to export whole grid or only selected rows


IMO TOra is closet tool to TOAD. This is a very good alternative to Toad and FREE.

http://torasql.com/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜