Pdo\Pgsql::copyFromArray
PHP の配列から、データをテーブルにコピーする
説明
public bool Pdo\Pgsql::copyFromArray(
string $tableName,
array $rows,
string $separator = "\t",
string $nullAs = "\\\\N",
stringnull $fields = null
)
rows 配列からデータをテーブル
tableName にコピーします。その際、separator を
フィールドのデリミタ、そして fields のリストを使います。
パラメータ
-
tableName
-
テーブル名を含む文字列
-
rows
-
separator で区切られたフィールドの文字列の配列
-
separator
-
rows 配列の各要素の中で
フィールドを分割するためのデリミタ
-
nullAs
-
SQLの
NULL 値をどのように扱うかを指定します
-
fields
-
挿入するフィールドの一覧
戻り値
成功した場合に true を、失敗した場合に false を返します。
参考
- Pdo\Pgsql::copyToArray
- Pdo\Pgsql::copyFromFile
- Pdo\Pgsql::copyToFile