Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am utilizing a small sqlite database to keep track of some jobs that run on a linux box. Most of them have small (less than 50 lines) log files... I'd like to store those log files as a record in my database....

How can I get a text log file into my sqlite database? I want it stored as text in the record, not as a file.

share|improve this question

For me your last line contradicts the subject (blob vs text), so probably I mistook your idea. But what about making your log file an INSERT statement on the fly? Then feed that into your desired sqlite database. I mean something like this:

$ cat test.sql
SELECT 'something

$ sqlite3 test < test.sql

$ sqlite3 test
SQLite version 3.6.22
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> SELECT * FROM test;
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.