At 5:39 PM -0400 7/16/01, Simon Lee wrote:
>Hi:
>
>I have a process that will be receiving a bulk of data, say, every 5
>minutes.
>
>In the program, I can:
>
>1. Use the "Insert into" command to put the data into the table one at a
>time,
>    (Drawback: it would be very slow for each query to put in the data). Or
>
>2. Save the whole data into a file, then use "load data infile".
>    (Drawback: put the data in a file, then "load", is one step extra too.)
>
>Is there a way (or a command) that I can just put the data into the table,
>from the process memory?

You have to use a SQL statement of some kind.  You might want to use approach
1, but write a single INSERT statement that loads multiple rows.

INSERT INTO tbl_name (col_names
        VALUES
                (values for row 1),
                (values for row 2),
                (values for row 3),
        etc.

This is much more efficient than a set of single-row INSERTs.

More information:
http://www.mysql.com/doc/I/N/INSERT.html

>
>You help is appreciated.
>
>Simon Lee
>Wide Area Network Design Lab
>732-868-0100 ext 267


-- 
Paul DuBois, [EMAIL PROTECTED]

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to