Question: How To execute "All Platforms (Advanced)" section????
I have a question about how to execute the "All Platforms (Advanced)" section of "Manual Zotero Database Repair Instructions" at https://www.zotero.org/utils/dbfix/manual.
This section consists of a series of SQL statements, which I assume to be an SQL script to be invoked from the sqlite prompt. The primary purpose of the script appears to be to delete "Child" rows from specified tables for which the "Parent" table does not contain the "Child" row's foreign key.
Having copied all the SQL statements to MS Notepad, I assume I can change the extension to .sql if necessary.
The closest "solution" I have come across for executing the "Advanced..." section is the "The Tcl interface to the SQLite library" http://www.sqlite.org/tclsqlite.html#transaction. The closest dbcmd may be "eval". The examples for "eval" appear to be line by line, although one mentions "SCRIPT".
Could someone kindly tell me how to execute the "Advanced..." section? The "closest solution" above is too mired in ignorance (mine) and uncertainty to let rip against a live database. Even if it works technically, I have no idea what landmines might remain if I execute it in the wrong way. (I have not noticed a "log" function.)
Thank you for any help you can give.
Environment: Windows XP SP3, Firefox 10.0.1, Zotero 3.0.2
This section consists of a series of SQL statements, which I assume to be an SQL script to be invoked from the sqlite prompt. The primary purpose of the script appears to be to delete "Child" rows from specified tables for which the "Parent" table does not contain the "Child" row's foreign key.
Having copied all the SQL statements to MS Notepad, I assume I can change the extension to .sql if necessary.
The closest "solution" I have come across for executing the "Advanced..." section is the "The Tcl interface to the SQLite library" http://www.sqlite.org/tclsqlite.html#transaction. The closest dbcmd may be "eval". The examples for "eval" appear to be line by line, although one mentions "SCRIPT".
Could someone kindly tell me how to execute the "Advanced..." section? The "closest solution" above is too mired in ignorance (mine) and uncertainty to let rip against a live database. Even if it works technically, I have no idea what landmines might remain if I execute it in the wrong way. (I have not noticed a "log" function.)
Thank you for any help you can give.
Environment: Windows XP SP3, Firefox 10.0.1, Zotero 3.0.2
http://forums.zotero.org/discussion/2607/
What I need to find out is how to execute the block of SQL statements in "All Platforms (Advanced)". I suspect it can be done through the dbcmd within sqlite, referencing the SQL statements as a script.
But I am uncertain, and would like some expert advice. Thanks again.
You are exactly right about dbcmd ?SCRIPT?. Your suggestion prompted me to think about the discovery below:
Late last evening, I found that the Windows "cmd" window had a right-click context menu from the top border, in which a "paste" command was to be found in the sub-menu of "Edit".
sqlite client for windows
You will find several software that you can use. You do not need the windows command prompt or the Sqlite programming interfaces.
(But yes, there are plenty of GUI alternatives.)
Your suggestion worked. The SQL statements in "All Platforms (Advanced)"
were pasted into the Windows command shell window using Edit->Paste command under the context menu (right-click the top border of the command window).
"Check Database Integrity" under Preferences - Advanced reported no problems. It had been dirty up to this point.
The sequence was:
Disable Zotero Add-on and close Firefox.
Backup zotero.sqlite and zotero.sqlite.bak
Start-Run-"cmd" (w/o quotes)
>CD {path to Zotero storage where sqlite3.exe, zotero.sqlite and zotero.sqlite.bak} in quotes as necessary.
>sqlite3.exe zotero.sqlite
Copy the SQL statements in "All Platforms (Advanced) as one block.
sqlite> {Context Menu Edit->Paste}, {enter}
This will take a couple of minutes for ~250 MB.
Hearty thanks to all!
Environment: Windows XP SP3, Firefox 10.0.1, Zotero 3.0.2, sqlite3.exe in Zotero storage.