Re: [sqlite] Import at first unhappy - then happy after all

2012-09-21 Thread Udi Karni
Kevin - thanks. I've been experimenting - my code would also fail when, for
example, I spooled to a file called c:\red.txt where the \r was stripped
and used as an escape character.

Switching to linux notation even while on Windows - .output c:/red.txt
solved the problem !

Much appreciated.

On Sun, Aug 26, 2012 at 2:14 PM, Kevin Benson kevin.m.ben...@gmail.comwrote:

 On Sun, Aug 26, 2012 at 11:30 AM, Udi Karni uka...@gmail.com wrote:

  The following scenario happens occasionally.
 
  At first the import fails on mismatched columns - as if the end-of-line
  marker is off.
 
  You run it again right away and everything completes successfully.
 
  ?
 
  Is there some kind of tracing that can be turned on so that when this
  happens we can gather some clues?
 
  As an aside - not a big deal - this is on Windows - the file
 specifications
  in the .import and .read commands require 2 back slashes in the
 syntax
  - can that be fixed?
 
  Thanks !
 

 Perhaps
 http://www.sqlite.org/uri.html  3.1 The URI Path
 will help you

 --
--
   --
  --Ô¿Ô--
 K e V i N



 
  Z:\sqlite3 z:\xyz.db3
  SQLite version 3.7.11 2012-03-20 11:35:50
  Enter .help for instructions
  Enter SQL statements terminated with a ;
  sqlite pragma page_size=4096;
  sqlite pragma journal_mode=off;
  off
  sqlite pragma temp_store=memory;
  sqlite .timer on
  sqlite .separator ','
  sqlite .read c:\\create_table\\create_table_xyz.sql
  CPU Time: user 0.00 sys 0.00
  sqlite .import c:\\data_csv\\xyz.csv xyz
  Error: c:\data_csv\xyz.csv line 12: expected 59 columns of data but found
  99
  sqlite select count (*) from xyz;
  0
  CPU Time: user 0.00 sys 0.00
  sqlite .import c:\\data_csv\\xyz.csv xyz
  sqlite select count (*) from xyz;
  97744059
 ___
 sqlite-users mailing list
 sqlite-users@sqlite.org
 http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Import at first unhappy - then happy after all

2012-08-26 Thread Kevin Benson
 On Sun, Aug 26, 2012 at 11:30 AM, Udi Karni uka...@gmail.com wrote:

***SNIP***



 As an aside - not a big deal - this is on Windows - the file specifications
 in the .import and .read commands require 2 back slashes in the syntax
 - can that be fixed?

 Thanks !


The explanation for this behavior is here

http://www.sqlite.org/cvstrac/tktview?tn=1073
--
   --
 --
   --Ô¿Ô--
  K e V i N
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Import at first unhappy - then happy after all

2012-08-26 Thread Udi Karni
Thanks for the explanation.

Is there a way to change the Sqlite escape character globaly? Chose some
out-of-the-way character that would allow backward quotes to be used
normally?

Something like -

.escape [
.read c:\path\file.sql

???

On Sun, Aug 26, 2012 at 9:41 AM, Kevin Benson kevin.m.ben...@gmail.comwrote:

  On Sun, Aug 26, 2012 at 11:30 AM, Udi Karni uka...@gmail.com wrote:

 ***SNIP***


 
  As an aside - not a big deal - this is on Windows - the file
 specifications
  in the .import and .read commands require 2 back slashes in the
 syntax
  - can that be fixed?
 
  Thanks !
 
 
 The explanation for this behavior is here

 http://www.sqlite.org/cvstrac/tktview?tn=1073
 --
--
  --
--Ô¿Ô--
   K e V i N
 ___
 sqlite-users mailing list
 sqlite-users@sqlite.org
 http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Import at first unhappy - then happy after all

2012-08-26 Thread Kevin Benson
On Sun, Aug 26, 2012 at 11:30 AM, Udi Karni uka...@gmail.com wrote:

 The following scenario happens occasionally.

 At first the import fails on mismatched columns - as if the end-of-line
 marker is off.

 You run it again right away and everything completes successfully.

 ?

 Is there some kind of tracing that can be turned on so that when this
 happens we can gather some clues?

 As an aside - not a big deal - this is on Windows - the file specifications
 in the .import and .read commands require 2 back slashes in the syntax
 - can that be fixed?

 Thanks !


Perhaps
http://www.sqlite.org/uri.html  3.1 The URI Path
will help you

--
   --
  --
 --Ô¿Ô--
K e V i N




 Z:\sqlite3 z:\xyz.db3
 SQLite version 3.7.11 2012-03-20 11:35:50
 Enter .help for instructions
 Enter SQL statements terminated with a ;
 sqlite pragma page_size=4096;
 sqlite pragma journal_mode=off;
 off
 sqlite pragma temp_store=memory;
 sqlite .timer on
 sqlite .separator ','
 sqlite .read c:\\create_table\\create_table_xyz.sql
 CPU Time: user 0.00 sys 0.00
 sqlite .import c:\\data_csv\\xyz.csv xyz
 Error: c:\data_csv\xyz.csv line 12: expected 59 columns of data but found
 99
 sqlite select count (*) from xyz;
 0
 CPU Time: user 0.00 sys 0.00
 sqlite .import c:\\data_csv\\xyz.csv xyz
 sqlite select count (*) from xyz;
 97744059
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users