Hi All,

 

We are currently developing an application where we need to insert a big
amount of data (thousands of records), we are connecting to a PostgreSQL
(8.1.6) database through PDO (pdo_pgsql ) the query looks pretty much like
this:

 

INSERT INTO myTable ( id, field_1, date ) VALUES 

    ( 301, 40971, '2007-10-04 04:00:19' ), 

    ( 301, 40972, '2007-10-04 04:00:19' ), 

    ( 301, 40973, '2007-10-04 04:00:19' ), 

    ( 301, 40974, '2007-10-04 04:00:19' ), 

    ....

    ....

    ....

    ....

    ( 301, 40990, '2007-10-04 04:00:19' );

 

It works when we execute the query directly on the database, but when
using the _db methods like query, insert or even fetchRow, we always get
the same error:  Syntax error: 7 ERROR:  syntax error at or near "," LINE
1: ...ate ) VALUES ( 303, 41471, '2007-10-04 04:30:45' ), ( 303, 4...

 

So the question is, what would be the best option to insert this
information? Seems that the insert method does not support associative
arrays to load all of the info there.

 

Thanks a lot for the help!

 

Camilo

 

 

Reply via email to