Java JDBC/SQLite: Export tables to sql statements

十年热恋 提交于 2019-12-24 00:38:28

问题


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:


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.



来源:https://stackoverflow.com/questions/23766462/java-jdbc-sqlite-export-tables-to-sql-statements

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!