On 30 April 2010 16:56, ecforu <ecforus...@gmail.com> wrote:
> this was my first thought so I did a dump to a file and looked at in hex -
> there were no extra characters.  I even tried looking at the db file with a
> hex editor and I could see the PSM text and no extra characters around it
> (except the NULLs on either side which I assume separates the columns).
>
>

.dump does not preserve nulls in text fields:

SQLite version 3.6.11
Enter ".help" for instructions
sqlite>
sqlite> create table tst( t timestamp, resType text );
sqlite> insert into tst values( datetime( 'now' ), 'PSM' );
sqlite> insert into tst values( datetime( 'now' ), 'PSM'||X'00' );
sqlite>
sqlite> insert into tst values( datetime( 'now' ), 'PSM'||X'00'||'more text' );
sqlite>
sqlite> .dump
BEGIN TRANSACTION;
CREATE TABLE tst( t timestamp, resType text );
INSERT INTO "tst" VALUES('2010-04-30 16:01:07','PSM');
INSERT INTO "tst" VALUES('2010-04-30 16:01:07','PSM');
INSERT INTO "tst" VALUES('2010-04-30 16:03:40','PSM');
COMMIT;
sqlite>
sqlite> select hex( resType ) from tst;
50534D
50534D00
50534D006D6F72652074657874
sqlite>

try
SELECT hex( resType ) FROM MyTable;

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

Reply via email to