Comunitatea PHP Romania
 

 
pg_put_line

pg_put_line

(PHP 4 >= 4.0.3, PHP 5)

pg_put_line -- Send a NULL-terminated string to PostgreSQL backend

Description

bool pg_put_line ( [resource connection, string data])

pg_put_line() sends a NULL-terminated string to the PostgreSQL backend server. This is useful for example for very high-speed inserting of data into a table, initiated by starting a PostgreSQL copy-operation. That final NULL-character is added automatically. Returnează TRUE în caz de succes, FALSE în caz contrar.

Notã: The application must explicitly send the two characters "\." on the last line to indicate to the backend that it has finished sending its data.

Exemplu 1. High-speed insertion of data into a table

<?php
    $conn
= pg_pconnect("dbname=foo");
    
pg_query($conn, "create table bar (a int4, b char(16), d float8)");
    
pg_query($conn, "copy bar from stdin");
    
pg_put_line($conn, "3\thello world\t4.5\n");
    
pg_put_line($conn, "4\tgoodbye world\t7.11\n");
    
pg_put_line($conn, "\\.\n");
    
pg_end_copy($conn);
?>

See also pg_end_copy().

Ultimele discutii in forum RSS Forum

Ultimele articole Ultimele articole

Top membri

Pirahna Pirahna
la birou
carco carco
Bucuresti
Birkoff Birkoff
Bucuresti
mihaitha mihaitha
Sibiu
Mascka Mascka
Braila
gabysolomon gabysolomon
Bacau
whooper whooper
Toronto ON
raul_ raul_
dechim dechim
Drobeta Turnu Severin
Amenthes Amenthes

Newsletter


Email:
 inscriere
 renuntare
 
 Arhiva newsletter

Parteneriat

Copyright © 2001-2008 PHP Romania Add PHPRomania to Google Add PHPRomania to Del.icio.us Add PHPRomania to Stumbleupon Add PHPRomania to Yahoo! Add PHPRomania to Digg Add PHPRomania to Blink Loans | Loans | Mortgages | Free Credit Score | Debt Consolidation
Ads: Partener Way2Web Nework: gazduire web | inregistrare domenii | web design | imobiliare | web hosting
Powered by Simplis