Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java JDBC/SQLite: Export tables to sql statements

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 "

like image 690
Rick Avatar asked Mar 10 '26 23:03

Rick


1 Answers

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.

like image 147
TheMP Avatar answered Mar 12 '26 11:03

TheMP