Preston, Brian wrote:
I'm trying to import a .sql file into a db on Windows.  I'm doing a
migration.  I was able to create the .sql file from the old sqlite3 db
with the dump command.  But I cannot figure out the syntax/format of the
import command for Windows.  The examples on the sqlite3 site are for
*nix, and seem to use the 'zcat' command instead of import.  I searched
the archives for this and the only response said to look at the docs for
the 'copy' command, but I couldn't find any documentation for the copy
command.  Or the import command, for that matter.  The .help for .import
only says ".import FILE TABLE" but apparently that's not complete
either.
Does anyone have an example of doing an import from a .sql file into an
existing sqlite3 db?  I've tried:
sqlite3 .import <pathToSQLFile> <pathToDB> sqlite3 .import <pathToSQLFile> | <pathToDB> sqlite3 <pathToSQLFile> <pathToDB> .import sqlite3 <pathToSQLFile> | <pathToDB> .import and various other permutations. It usually give me an error saying
'syntax error at' the start of my <pathToSQLFile>
Try

   sqlite3 DBfile.db3 <SQLfile.sql

The .sql file contains SQL commands that must be executed by sqlite to create the database, not data to be imported into the database.

HTH
Dennis Cote


-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to