IMPORT DATA INTO DB TABLE

Dear all,

I need to IMPORT data from external CSV files into tables of connected database.
Is there an easy way that end user can do using a button or something similar within a form?
How have I to develop the application who reads a csv file ?

The application is about fixed Assets management and, sometime, user has huge quantities of data to upload into database.
Avoiding the use of manual entry (i.e. 50 PCs with similar data but different inventory serial number) I have to propose a way to select with a combo box the DB table and then a browse field on where to select the csv o txt file to upload.

Many thanks
Giovanni

Re: IMPORT DATA INTO DB TABLE

Hi Giovanni,

look at MySQLs Load Data: http://dev.mysql.com/doc/refman/5.1/en/load-data.html

LOAD DATA LOCAL
    INFILE '/home/www/servers/www.servername.de/tmp/import.csv'
    REPLACE
    INTO TABLE tablename
    FIELDS
        TERMINATED BY ';'
        OPTIONALLY ENCLOSED BY '"';
1 Like

Re: IMPORT DATA INTO DB TABLE

Many thanks
Giovanni