in reply to Re: Caching and inserting big number of records
in thread Caching and inserting big number of records

Is there a clean way to do this with placeholders (i.e., without having 50 "(?, ?, ?)," lines) or does inserting multiple VALUES lines necessarily condemn you to putting the data directly into the SQL statement?
  • Comment on Re^2: Caching and inserting big number of records

Replies are listed 'Best First'.
Re^3: Caching and inserting big number of records
by clinton (Priest) on Aug 21, 2007 at 15:16 UTC
    No - you have to put in the ? unfortunately. You could minimise it to:
    $sql = 'insert into my_table (x,y,z) values ' . join (',', ('values (' . join(',',('?') x $rows) . ')') x $colum +ns )