Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
PHP: pg_copy_to - Manual
[go: Go Back, main page]

PHP  
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
search for in the  
<pg_copy_frompg_dbname" width="11" height="7"/>
view the version of this page
Last updated: Sun, 07 May 2006

pg_copy_to

(PHP 4 >= 4.2.0, PHP 5)

pg_copy_to --  配列にテーブルをコピーする

説明

array pg_copy_to ( resource connection, string table_name [, string delimiter [, string null_as]] )

pg_copy_to() は、テーブルを配列にコピーします。 レコードを取得するために、内部では COPY TO SQL コマンドを発行します。

パラメータ

connection

PostgreSQL データベースの接続リソース。

table_name

データを rows にコピーするテーブルの名前。

delimiter

rows の要素内で、各フィールドに対応する値を 区切る文字。デフォルトは TAB です。

null_as

rows の中で、SQL の NULL をどのように表現するか。デフォルトは \N ("\\N") です。

返り値

COPY されたデータが 1 行ごとにひとつの要素と なっている配列を返します。失敗した場合には FALSE を返します。

例 1. pg_copy_to() の例

<?php
   $db
= pg_connect("dbname=publisher") or die("Could not connect");
  
  
$rows = pg_copy_to($db, $table_name);
  
  
pg_query($db, "DELETE FROM $table_name");
  
  
pg_copy_from($db, $table_name, $rows);
?>



add a note add a note User Contributed Notes
pg_copy_to
setantae at submonkey dot net
28-Nov-2002 03:50
"It issues COPY TO SQL command internally to insert records"

I suspect this statement is incorrect, or that s/insert/retrieve/ is appropriate.

<pg_copy_frompg_dbname" width="11" height="7"/>
 Last updated: Sun, 07 May 2006
show source | credits | sitemap | contact | advertising | mirror sites 
Copyright © 2001-2006 The PHP Group
All rights reserved.
This mirror generously provided by: PacketBusiness, Inc.
Last updated: Wed Jun 28 13:19:26 2006 JST