List:MySQL++« Previous MessageNext Message »
From:Adam Nielsen Date:January 28 2010 2:31am
Subject:Re: How to do a large template query?
View as plain text  
>> I'm writing a program to import some data into a MySQL database.  I
>> guessed that the most efficient way of doing this was to use
>> template queries
> 
> LOAD DATA INFILE is probably the most efficient way:
> 
> http://dev.mysql.com/doc/refman/5.1/en/load-data.html

Oh I didn't realise you could load a file locally, I thought it had to 
be on the server.  Is it possible to set a callback or something for 
each row/column being read so you can do everything on the fly?  (i.e. 
not worrying about creating a file on disk, escaping the data, etc.)

>> It looks like this is because it can only take up to 25 parameters,
>> but the table I am importing into has 40 fields.  Is there any way
>> I can work around this limit?
> 
> http://tangentsoft.net/mysql++/doc/html/userman/configuration.html#max-columns

Hmm, okay, that complicates things a bit if I can't rely on a machine's 
package management system to have installed mysql++ properly.  It says 
the reasoning behind the decision was so that it wasn't too complex for 
compilers.  Any possibility then of doing what Boost does and use 
#ifdefs to hide the extra definitions, so you can just #define something 
before including the header to get the number of parameters you need? 
That would still keep things small for 'simple' compilers.

Thanks,
Adam.
Thread
How to do a large template query?Adam Nielsen27 Jan
  • Re: How to do a large template query?Warren Young27 Jan
    • Re: How to do a large template query?Adam Nielsen28 Jan
      • Re: How to do a large template query?Joel Fielder28 Jan
        • Re: How to do a large template query?Warren Young28 Jan
          • Re: How to do a large template query?Adam Nielsen29 Jan
            • Re: How to do a large template query?Joel Fielder29 Jan
              • Re: How to do a large template query?Joel Fielder29 Jan
              • Re: How to do a large template query?Adam Nielsen1 Feb
            • Re: How to do a large template query?Warren Young29 Jan
              • Re: How to do a large template query?Adam Nielsen1 Feb
                • Re: How to do a large template query?Warren Young1 Feb
                  • Re: How to do a large template query?Warren Young7 Feb
          • Re: How to do a large template query?Warren Young7 Feb