On 12/2/08, Jerry Krinock <[EMAIL PROTECTED]> wrote: > > On 2008 Dec, 02, at 19:44, Thomas Briggs wrote: > > > Put both commands (the pragma and the read) into a file (e.g. > > foo.txt) and then do: > > > > sqlite3 newDatabase.sqlite '.read foo.txt' > > > Looked like a great idea, Thomas but it doesn't work for me: > > jk$ echo 'PRAGMA page_size=4096 ;' > twoLiner.sh > jk$ echo '.read placesDump.txt ;' >> twoLiner.sh > jk$ sqlite3 places.sqlite '.read twoLiner.sh' > unknown command or invalid arguments: "read". > > The file twoLiner.sh does have the expected contents: > > PRAGMA page_size=4096 ; > .read placesDump.txt ; > > I get the same error if I delete the PRAGMA line and just have > the .read in the file. > > In the man page for sqlite3, .read will "Execute SQL in [a file]". > The problem is probably that .read itself is a meta-command, not > "SQL"; hence .read cannot be nested. > > Any other ideas?
Add the PRAGMA line to the start of your dump file so it looks like so... PRAGMA page_size=4096; <whatever the heck is being done in the dump file> Then run your $ sqlite3 dbname '.read dumpfile_with_pragma_added.sh' > > Thanks, > > > Jerry > > > > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > -- Puneet Kishor http://www.punkish.org/ Nelson Institute for Environmental Studies http://www.nelson.wisc.edu/ Open Source Geospatial Foundation (OSGeo) http://www.osgeo.org/ _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users