[MonetDB-users] COPY with AUTO_INCREMENT column

Hi, How can I use COPY to load data into a table with a AUTO_INCREMENT column? Just to clarify, the AUTO_INCREMENT column would be the PRIMARY KEY by default and doesn't have any corresponding data in the data file. Thanks,

Maybe some documentation will help you. To create the table with auto-increment column which is also a primary key: http://monetdb.cwi.nl/projects/monetdb/SQL/Documentation/Table-Definition.ht... To do the copy: http://monetdb.cwi.nl/projects/monetdb/SQL/Documentation/Data-Manipulation.h... There you have the syntax tree that will help you to construct correctly your queries ;) Regards, Romulo Venks wrote:

Please allow me to explain the problem in detail: Here is my table definition: CREATE TABLE test01 ( -- id INT AUTO_INCREMENT NOT NULL PRIMARY KEY, col1 INT, col2 VARCHAR(10), col3 DATE -- ) ; Here is my data: 11, aaa, 2007-12-01 12, bbb, 2007-12-02 11, ccc, 2007-12-03 12, ccc, 2007-12-04 15, ddd, 2007-12-02 I need to use COPY command to load the data. As you can see "id" is an AUTO_INCREMENT column which won't have any corresponding data in the data file. I tried the following syntax but didn't work. COPY 5 RECORDS INTO test01(col1, col2, col3) FROM 'test01.txt' USING DELIMITERS ',','\n' ; Thanks, On Dec 7, 2007 9:55 AM, Romulo Goncalves <R.A.Goncalves@cwi.nl> wrote:

On Fri, Dec 07, 2007 at 10:23:48AM -0500, Venks wrote:
Anyway we do not have these special version of copy into. Also because post processing isn't supposed to be slow. Niels
-- Niels Nes, Centre for Mathematics and Computer Science (CWI) Kruislaan 413, 1098 SJ Amsterdam, The Netherlands room C0.02, phone ++31 20 592-4098, fax ++31 20 592-4312 url: http://www.cwi.nl/~niels e-mail: Niels.Nes@cwi.nl
participants (3)
-
Niels Nes
-
Romulo Goncalves
-
Venks