Re: [sqlite] Can't load sqlite 3.75 under tcl 8.4.4.0

2011-04-11 Thread mweiguo
于 2011-4-10 12:43, thoselai...@shaw.ca 写道:
> % package require sqlite
> couldn't load library "C:/Tcl/lib/sqlite3/sqlite3/.dll": this library or a 
> dependent library could not be found in library path
>
> What is sqlite3/.dll ?
> Where did that "/" come from?
>
> The pkgindex file contains -
>
> package ifneeded sqlite 3.7.5 [list load [file join $dir \
> sqlite3[info sharedlibextension]] sqlite3]
>
> (I'm using 8.4 because I want to continue using BLT - so don't ask me to 
> upgrade to 8.5)
>
> Any help gratefully received
>
> Richard Laing
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
hi Richard
it seems your sqlite.dll do not export the Sqlite_Init function, you can
check it's exported functions use Depends.Exe if you are in windows.

good luck
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] how to read schema file into database with tcl

2011-03-08 Thread mweiguo
于 2011-3-8 23:37, Gary_Gabriel 写道:
> Hi mweiguo,
>> hi all:
>> i am writing a tcl script, it will create a empty database and read a
>> schema file into database ...
>> in command line, it works when i use
>>   
>>>> .read schema.sql
>>>>   
>> but in tcl script enviroment, how can i do that ?
>>   
> This script reads the *.sql file as a transaction and executes it in 
> Tcl. It reliably works and has been tested with a > 500 line .sql 
> transaction.
>
> proc tssScript { } {
>  variable tssfile ; # database defined schema in sql file
>  
> set fid [open $tssfile]
>  set tsscontent [read $fid]
> close $fid
>
> # Open process db1 connection
> sqlite3 db1 $dbfile
>
> # Read the SQLExe file contents to exec the SQL in the file. 
> Write the SQL statements to the file delimited by semicolon
> sqlite3 db $dbfile
> db1 eval [subst {$tsscontent}] {
> }
> # test reading the file   
> set tempq [db1 eval {SELECT * FROM SearchIndex_temp;}]
> puts "tempq $tempq"
>
>db1 eval {INSERT INTO TABLE (VALUES);}
> db1 eval {INSERT INTO TABLE (VALUES_2);}   
>   
> set tempq1 [db1 eval {SELECT * FROM TABLE;}]
> puts "tempq1 $tempq"
>
> db1 close
> }
>
> A Tcl equivalent to .read schema.sql.
>
> Good luck- Gary
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
thanks, it works for me.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] how to read schema file into database with tcl

2011-03-07 Thread mweiguo
hi all:
i am writing a tcl script, it will create a empty database and read a
schema file into database ...
in command line, it works when i use
>> .read schema.sql
but in tcl script enviroment, how can i do that ?

thanks
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users