Jump to content

Bulk/Batch Many thousands of records into a Table


davidu

Recommended Posts

Hi there,

 

I am using MYSQL version 5.1

 

I need to be able to batch insert possibly many thousand of records into a single table.

I want to use PDO and have considered possibly binding the values with bind_param of bind_values.

 

However, surely it would be better for me to build up a string of either 1 or many records with parentheses as elements of an array and then pass to a user defined bulk insert record class. This would then use implode to separate the record with commas.

 

eg.

 

INSERT INTO TABLEA (Col1, Col2 ....)

VALUES

(record 1),

(record 2)

......

 

What is the essential difference between bind_param of bind_values ?

 

I can't use bind_param or bind values here can I because I would have to loop round the individual recs to bind the recs or can the values from multiple records be bound to the insert cols in 1 pass?

 

Many thanks for your help.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.