On Tue, 4 Apr 2006, Roman wrote:
[...]
I have tried
sqlite> select * from loc_configuration;
0|0|18|52|86|4|24|22|51|116|39|15|0|0|0|0|0|0|0|0|0|0|0|0
The blob is the one before the last one, and the length is the very last one
The serials are second, third , fourth and fifth columns.
sqlite> UPDATE loc_configuration SET loc_authorization_code_length = 18,
loc_authorization_code = X'000102030405060708' WHERE loc_serial_0=0 AND
loc_serial_1=18 AND loc_serial_2=52 AND loc_serial_3=86;
sqlite> select * from loc_configuration;
0|0|18|52|86|4|24|22|51|116|39|15|0|0|0|0|0|0|0|0|0|0||0
I get no response or error from sqlite3.
[...]
Hello Roman,
I wonder why your loc_authorization_code_length column still seems to be 0
after the update, but otherwise this behaviour looks normal and correct.
Here is what I did to check:
$ sqlite3
SQLite version 3.3.4
Enter ".help" for instructions
sqlite> CREATE TABLE loc_configuration(
...> loc_serial_0 INTEGER, loc_serial_1 INTEGER,
...> loc_serial_2 INTEGER, loc_serial_3 INTEGER,
...> loc_authorization_code BLOB,
...> loc_authorization_code_length INTEGER);
sqlite> INSERT INTO loc_configuration VALUES(0, 18, 52, 86, 0, 0);
sqlite> SELECT * FROM loc_configuration;
0|18|52|86|0|0
sqlite> UPDATE loc_configuration
...> SET loc_authorization_code_length = 18,
...> loc_authorization_code = X'000102030405060708'
...> WHERE loc_serial_0 = 0 AND loc_serial_1 = 18
...> AND loc_serial_2 = 52 AND loc_serial_3 = 86;
sqlite> SELECT * FROM loc_configuration;
0|18|52|86||18
sqlite> SELECT length(loc_authorization_code) FROM loc_configuration;
9
sqlite> SELECT quote(loc_authorization_code) FROM loc_configuration;
X'000102030405060708'
Note that the BLOB column does not contain printable characters and is
therefore output as an empty string in the normal output mode, but you can
always get a quoted version with the quote function. Anyway you should
not have any quoting problems if you are accessing your database from C or
C++.
cu,
Thomas