Anton Kuznetsov wrote:
Yes. That script works with versions 2.8.16 and 3.2.7.

----- Original Message ----- From: "Gerry Snyder" <[EMAIL PROTECTED]>
To: <sqlite-users@sqlite.org>
Sent: Tuesday, November 08, 2005 2:03 AM
Subject: Re: [sqlite] sqlite 2.0 database


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,

Sorry, but I still don't see it.

1) First of all, according to Dr. Hipp, "You have to load version 3 of the TCL bindings first, then version 2."

Your script does it in the other order.

2) Second, your [pcdb] command generated by version 2 seems to need either one argument (the SQL) or three (SQL, ARRAY-NAME, and CODE).

Your script has two arguments in the "creating tables" section (I got it to work by adding a blank array name).

3) But still, after getting past these trivialities, your script has one command simultaneously working with both version 2 and version 3 files. The file formats are incompatible.

Something is very, very wrong here. What makes you think it is working?

Based on the second point, I suspect [pcdb] somehow got set up as version 3, probably because of the first point.

You need to carefully examine what is going on. Your script is not doing what you seem to think it is.

Gerry

Reply via email to