Viewing blob data as a hexdump with ASCII in the sqlite3 console

The sqlite3 shell cannot display ASCII values in a binary data dump.

You have to pipe its output into a separate tool:

sqlite3 test.db "SELECT MyBlob FROM MyTable WHERE ID = 42;" | hexdump -C
sqlite3 test.db "SELECT MyBlob FROM MyTable WHERE ID = 42;" | xxd -g1

However, sqlite3 converts the blob into a string to display it, so this will not work if the blob contains zero bytes.

You have to output the blob as hex, then convert it back into binary, so that you can then display it in the format you want:

sqlite3 test.db "SELECT quote(MyBlob) FROM MyTable WHERE id = 42;"  \
| cut -d\' -f2                                                      \
| xxd -r -p                                                         \
| xxd -g1

You can run the below script in the command.

sqlite3 test.db "select hex(obj) from data where rowid=1" >> hexdump

:) I'm not sure if it's what you need.