Java JDBC/SQLite: Export tables to sql statements

2019-07-22 00:59发布

I'm currently working with a SQLite database in java. But I would like to export all the tables and their data to SQL statements.

I've tried using:

"SELECT * FROM TABLENAMES INTO OUTFILE '...'

But that gives me an error: " near "INTO": syntax error "

1条回答
【Aperson】
2楼-- · 2019-07-22 01:49

To achieve that, you can use outer software, such as SQLDeveloper or SQLAdministrator. IntelliJ in Ultimate edition also supports exporting table data.

UPDATE:

If you want to export it using only sql you can use

sqlite3 db .dump

See also this info if you want to export only selected tables.

查看更多
登录 后发表回答