1

I am really new to SQLite. I want to update BLOBs in the Column "data" in my database and i got it working: UPDATE genp SET data= X'MyHexData' WHERE rowid=510849 As i want to update multiple BLOBs from the Column data i decited to write a .sh script:

sqlite3 my.db 'UPDATE genp SET data= X'MyHexData' WHERE rowid=510849'
When i execute this script i get the error message:
SQL error: no such column: XMyHexData

Why does SQLite think that my hex data is supposed to be the column? Where is my mistake? It works if i run this in the Command Line Shell of SQLite.

EDIT: I got it working.Like this:

sqlite3 my.db "UPDATE genp SET data= X'MyHexData' WHERE rowid= '510849'"

Thanks for all your help

1 Answer 1

1

You've already used single quotes to quote the argument. Escape them.

... '...\'...'
Sign up to request clarification or add additional context in comments.

2 Comments

Thank you for you reply. I see what you mean. I cant use single quotes within single quotes just like that. But can you please explain how to escape them in my code specificly? I dont really know how to... I have tried it like this: sqlite3 my.db 'UPDATE genp SET data= X\’MyHexData\’ WHERE rowid=510849' But it gives me a error: ./load.sh: line 13: syntax error: unexpected end of file I hope you can help me and thanks for your patience :-)
I got it working. See the edit in my question. Thanks for your help

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.