On 3/6/07, RohitPatel9999 <[EMAIL PROTECTED]> wrote:

/* SQLite 3.3.8 (Windows) used */

/* table t1 */
/* only two columns are given because other columns are irrelevant here */
create table t1 (id INTEGER PRIMARY KEY, name TEXT);

/* few sample records from csv file data.csv */
1,'name_text_1'
2,'name_text_2'
3,'name_text_3'
4,'name_text_4'

/* import statement */
.import imp3.csv t1

I must have proper primary key valures in csv file.
And when table already has records, and importing more from csv file, I need
to edit primary key valures again to avoid error. (It becomes cumbersome
when csv file has thousands of records)


How to achieve import operation - primary key values should be automatically
incremented by SQLite and not to be used from csv file ?



I don't think there is anyway around it. You are providing SQLite the
values to import, you are asking it to import it, but you really don't
want to import it. And, of course, SQLite is complaining because PKs
are conflicting. Well, SQLite is doing its job and precisely what you
would want it to do. It doesn't know any better that you intentionally
want to circumvent something you yourself have laid down as a rule.

--
Puneet Kishor http://punkish.eidesis.org/
Nelson Inst. for Env. Studies, UW-Madison http://www.nelson.wisc.edu/
Open Source Geospatial Foundation http://www.osgeo.org/education/
---------------------------------------------------------------------
collaborate, communicate, compete
=====================================================================

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

Reply via email to