I am trying to add single quotes into my DB but when i double up the single quotes in the DB i dont get a single quote to appear? Reading this document: How to properly escape a single quote for a SQLite database?
I was not able to successfully add the single quote. I am logged in via SSH so i am not sure if this is the cause? Perhaps there is something else involved to accomplish this?
My Insert command:
sqlite3 /db.sql 'insert into `custqueue` values ("2", "take''that", "2")';
My select (Read) response:
2|takethat|2
I dont have my single quote in takethat?
bash
does not allow a single quote between single quotes; any single quote ends the quoted string. So to get a single quote into SQL, you have to use a single quote to end the string, write an escaped quote, and then use another single quote to start the remaining quoted string:
sqlite3 dbfile 'INSERT INTO tab VALUES(2, "take'\''that", 2);'