On Sat, 10 Feb 2007 12:09:12 -0800 (PST), you wrote:

>On Thu, 28 Sep 2006, Dennis Cote wrote:
>
>> I suspect you may have trailing spaces at the ends of your lines. The
>> .import command isn't very smart about things like that. Your separator is
>> set to one space, not arbitrary whitespace. It there is another separator
>> after the last field it assumes there is another field there (which might
>> be an empty string) as well.
>
>   Well, I'm back with the same problem, but a trailing space at the end of a
>record is not the problem.
>
>   I wrote data from a table using 'insert' mode so I could drop and recreate
>the table without having to manually re-enter the data. That part worked
>just fine: the new table schema matches the number and type of fields in the
>data file.
>
>   However, when I try to import the data into the table I see this error
>message:
>
>sqlite> .import variable.sql variable
>variable.sql line 1: expected 14 columns of data but found 16
>
>   The editor is configured like this:
>
>sqlite> .show
>      echo: off
>   explain: off
>   headers: off
>      mode: insert
>nullvalue: ""
>    output: stdout
>separator: ","
>     width:
>
>and the first line of data is:
>
>INSERT INTO variable VALUES('Vegetation','Amounts, types, and uses of plant
>cover.','Habitats','','External','x
>100','Centroid',0,100,0.2,'Strong','Fuzzy Space','Minimum','Min-max');
>
>   There are 14 fields and no extra space trailing the final ';'. The schema
>is attached for reference.
>
>   What have I gotten wrong this time, please?

This is not a comma delimited values file like .import could
process, but an SQL script. You can execute it like:
sqlite3 databasefilename <variable.sql

Or from within sqlite3:

sqlite> .read variable.sql

>Rich
-- 
  (  Kees Nuyt
  )
c[_]

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

Reply via email to