Anton Kuznetsov wrote:
Hello, Manuel.
Install TCLSQLite3(http://sqlite.org/tclsqlite-3_2_7.zip) and try the
following script.
It will convert your database into the SQLite3 database.
##################################################
package require sqlite
package require sqlite3
sqlite pcdb pcdatabase
sqlite3 pcdb3 newpcdatabase
# creating tables in new DB:
pcdb eval {select sql from sqlite_master} {
pcdb3 eval $sql
}
pcdb3 close
# filling tables of the new DB:
pcdb eval {attach 'newpcdatabase' as newpcdb}
pcdb eval {select name from sqlite_master where type='table'} {
pcdb eval "insert into newpcdb.'$name' select * from '$name' "
}
pcdb eval {detach newpcdb}
pcdb close
exit
##################################################
Anton,
Are you sure this works? It looks to me as if it shouldn't.
The first part looks as if it will correctly create the schema in the
new sqlite3 file newpcdatabase, but the second part then seems to be
treating the new file as an sqlite 2 file.
Most of my recent comments to this list have been wrong (and I learned a
lot from the replies), but I just don't see how version 2 and version 3
files can be attached to the same TCL command [pcdb].
In the TCL/TK script I use for sqlite file manipulation (which does
work) I needed a fair amount more code than is in your example (and more
than that to go from V3 -> V2), so if your code really does the job I
can simplify a lot.
TIA for any comments,
Gerry
--
------------------
Gerry Snyder
American Iris Society Director, Symposium Chair
in warm, winterless Los Angeles -- USDA zone 9b, Sunset 18-19