List:General Discussion« Previous MessageNext Message »
From:M Date:October 4 1999 3:18am
Subject:Is it faster to import (eg. DBname < filename.txt) or to hard code INSERTs
View as plain text  
Hi,

1. Is it faster to import a file with thousands of INSERT statements
like this eg.

% mysql -h myhost -u me -pmypassword myDB < fileWithInserts.txt

2. Or, to hard code the INSERT syntax into a C program, for example (I
have a C program to extract data from file with fixed length fields),
and insert the data straight into a table (with a loop)? I've done it
this way eg.

mysql_query(sock, "insert into temp (product_no, product_name, qty)
values (%s, '%s', %s)"


I don't have file privs in the 'user' grant table, so I cannot use LOAD
DATA INFILE. I'm trying to work out the quickest way of doing this.
Thanks for any help.


Michael
Thread
Is it faster to import (eg. DBname < filename.txt) or to hard code INSERTsM4 Oct
  • Re: Is it faster to import (eg. DBname < filename.txt) or to hard code INSERTsMartin Ramsch4 Oct
  • Re: Is it faster to import (eg. DBname < filename.txt) or to hard code INSERTs(Udo Stanja)5 Oct
    • Re: Is it faster to import (eg. DBname < filename.txt) or to hard code INSERTssinisa5 Oct