luis montes wrote:
> I'm trying to do a simple database update from a bash script. It seems
> to me that I should be able to do something like this from the command
> line:
>
> cat file.xml|sqlite3 database.db 'update table1 set column3=? where 
> column1="some name";'

Escaping arbitrary data in a file would not be easy, so this converts
the file contents into hex, creates a blob literal from that, and then
converts the blob back into a string in SQL:

sqlite3 database.db "UPDATE table1 SET column3 = CAST(x'$(hexdump -v -e '1/1 
"%02x"' file.xml)' AS TEXT) WHERE column1 = 'some name';"


Regards,
Clemens
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to