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 "
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.