Posted to tcl by mjanssen at Wed Aug 29 09:27:44 GMT 2007view raw

  1. package require sqlite3
  2. sqlite3 db c:/temp/db.sql
  3. db eval {create table test(i integer, t blob)}
  4. for {set i 0} {$i < 10000} {incr i} {append in [binary format c [expr {int(rand() * 256)}]]}
  5. db eval {INSERT INTO test VALUES(1,$in)}
  6. db eval {INSERT INTO test VALUES(1,@in)}
  7. string length $in ; # fill stringrep
  8. db eval {INSERT INTO test VALUES(1,$in)}
  9. db eval {select t from test} {} {puts [string equal $t $in]}