Jump to content

Archived

This topic is now archived and is closed to further replies.

Conjurer

Load data from file into table that has autonum primary key

Recommended Posts

How can I update the autonum file when I am loading data from a csv text file?

 

I have Field 2, Field 3, Field 4, etc. in my text file.

 

In the table Field 1 is set up as an autonum Primary key. When I tell it to load the data file using columns 2 - 4 it loads the rows but leaves the first field blank. What would I need to add to the syntax to have it also populate the primary key with the autonum values? :roll:

Share this post


Link to post
Share on other sites

Make the field auto increment

 

Here is an example taken from the manual

 

CREATE TABLE animals (

            id MEDIUMINT NOT NULL AUTO_INCREMENT,

            name CHAR(30) NOT NULL,

            PRIMARY KEY (id)

            );

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.