Inserting multiple lines into a sqlite column with bash script

Solution 1:

Somewhere on the internet I had found this solution some time ago:

sqlite3 $database <<EOF
ATTACH DATABASE "${example_db}" AS ref;
YOUR MULTILINE
SQLITE STATEMENT;
CREATE TEMPORARY TABLE...;
TEMPORARY TABLE STILL THERE;
EOF

Not sure what happens when you do multiple SELECT statements.