[newbie] How to do "batch insert"?

Поиск
Список
Период
Сортировка
От 李彦 Ian Li
Тема [newbie] How to do "batch insert"?
Дата
Msg-id 466916DA.2080903@gmail.com
обсуждение исходный текст
Ответы Re: [newbie] How to do "batch insert"?  (Mihail Mihailov <Mihail.Mihailov@uta.fi>)
Список pgsql-php
Hi all.
In the scene I want to insert all elements of an array in to a
table, how can I do to commit them as a whole?
currently I do like this:

<?php
$result = pg_prepare($dbconn, "ins_acl", 'INSERT INTO
acls(oid,uid,gid,mod) VALUES($1,$2,$3,$4)');
for($i=0;$i<count($p["acls"]);$i++){
    pg_execute($dbconn, "ins_lgs",$p["acls"][i]);
}
?>

I wonder while doing so, will it commit in each LOOP or just ONCE?

Thanks and Regards,

Ian

В списке pgsql-php по дате отправления:

Предыдущее
От: Chris
Дата:
Сообщение: Re: Get Extension in Bytea Type
Следующее
От: Mihail Mihailov
Дата:
Сообщение: Re: [newbie] How to do "batch insert"?