Click to See Complete Forum and Search --> : still excel...


sundogro
07-16-2001, 03:09 AM
ok, i understood, but i am having difficulties exporting the csv file. i have tried a script for auto conversion, jack\'s csv2sql , and it outputs an sql query batch file, about 6 megs. when i try to load it into mysql for execution, i get errors. i am running win95 with winsock2, apache1.3, php4
and mysql.the csv file is \";\" delimited. if someone knows the commands for importing i would be grateful.thanks in advance,andrei( a lousy beginner)

sundogro
07-16-2001, 03:28 AM
the script looks like this
--------------cut test.csv-----------------------
CREATE TABLE test (
ORGANISMEENTREPRISE CHAR(225);
CODE CHAR(225);
THEME CHAR(225);
ACTIVITE CHAR(225);
PRODUITSSERVICES CHAR(225);
ADRESSE CHAR(225);
PAYS CHAR(225);
Ville CHAR(225);
ADRESSEWEB CHAR(225);
TEL CHAR(225);
PARTENAIRESCLIENTS CHAR(225);
REMARQUESTHEMEDESARTICLES CHAR(225);
DATE CHAR(225);
Evnement CHAR(225);
);

INSERT INTO test (ORGANISMEENTREPRISE; CODE; THEME; ACTIVITE; PRODUITSSERVICES; ADRESSE; PAYS; Ville; ADRESSEWEB; TEL; PARTENAIRESCLIENTS; REMARQUESTHEMEDESARTICLES; DATE; Evnement)<br> &nbsp; VALUES ('<font color="#000BA">@GP</font>'; '<font color="#000BA">41.02.03</font>'; '<font color="#000BA">EDI/EAI</font>'; '<font color="#000BA">Logiciels</font>'; '<font color="#000BA">Logiciels web EDI</font>'; '<font color="#000BA"></font>'; '<font color="#000BA"></font>'; '<font color="#000BA"></font>'; '<font color="#000BA"></font>'; '<font color="#000BA"></font>'; '<font color="#000BA"></font>'; '<font color="#000BA"></font>'; '<font color="#000BA"></font>'; '<font color="#000BA"></font>');
-----------cut test.csv--------------------
this is only one recod, ut the other lines are the same with "insert into test..."
i execute it with "mysql <test.csv" and it says "error 1064 at line 2 you have an error in your sql syntax near '' at line 2"

Anon
07-16-2001, 01:45 PM
Dont use semicolons. Use commas in between the fields on both your create and insert commands.