🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.perl
Article #766

Re: Dokumentacja i przyklady do postgresql-perl5

#766
From: Piotr Piatkowski
Date: Wed, 10 Dec 1997 16:52
34 lines
1915 bytes
Filip Byrski <byry@o7.mak.polsl.gliwice.pl> wrote:
: Piotr Piatkowski (kompas@galaxy.uci.agh.edu.pl) wrote:
: : Filip Byrski <byry@o7.mak.polsl.gliwice.pl> wrote:
: : : Jezeli ktos ma lub zna jakis adres to prosze o maila
: : 
: : perldoc pg

: Wlasciwie to chodzilo mi o jakies dodatkowe przyklady:

: z man-a:
: For examples of how to use this module, look at the file test.pl. 
: For further examples look at the Libpq applications in
:  ../src/test/examples and ../src/test/regress.

Ale ta biblioteka jest prosta jak budowa cepa... Zwykle używa się 
tego tak:

use Pg;

my $sql = new Pg::connectdb("dbname = zzz");
die "Postgress: " . $sql->errorMessage 
  if $sql->status != PGRES_CONNECTION_OK;

my $result = $sql->exec( "SELECT x, txt FROM test WHERE x > 5");

for my $i ( 0..$result->ntuples-1) {
  print $result->getvalues( $i, 0 ) . " = " . $result->getvalues( $i, 1 );
}

I w zasadzie do 90% zastosowań te funkcje wystarczą. Chyba że masz 
jakieś specjalne zapotrzebowania?

-- 
Piotr Piątkowski, Uczelniane Centrum Informatyki, AGH Krakow, POLAND
Technical Details
Message-ID: <66mhbt$mq5$1@galaxy.uci.agh.edu.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!pingwin.icm.edu.pl!mat.uni.torun.pl!news.man.torun.pl!news.icm.edu.pl!uucp-gw.cyf.gov.pl!news.wnaft.agh.edu.pl!agh.edu.pl!agh.edu.pl!not-for-mail
References: <66f7qd$2jh@ondraszek-gw.mak.polsl.gliwice.pl> <66grev$66j$1@galaxy.uci.agh.edu.pl> <66h4uc$dcv@ondraszek-gw.mak.polsl.gliwice.pl>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!pingwin.icm.edu.pl!mat.uni.torun.pl!news.man.torun.pl!news.icm.edu.pl!uucp-gw.cyf.gov.pl!news.wnaft.agh.edu.pl!agh.edu.pl!agh.edu.pl!not-for-mail
From: Piotr Piatkowski <kompas@galaxy.uci.agh.edu.pl>
Newsgroups: pl.comp.lang.perl
Subject: Re: Dokumentacja i przyklady do postgresql-perl5
Date: 10 Dec 1997 17:52:13 +0100
Organization: University of Mining & Metallurgy
Lines: 34
Message-ID: <66mhbt$mq5$1@galaxy.uci.agh.edu.pl>
References: <66f7qd$2jh@ondraszek-gw.mak.polsl.gliwice.pl> <66grev$66j$1@galaxy.uci.agh.edu.pl> <66h4uc$dcv@ondraszek-gw.mak.polsl.gliwice.pl>
NNTP-Posting-Host: galaxy.uci.agh.edu.pl
Mime-Version: 1.0
X-Newsreader: TIN [UNIX 1.3 unoff BETA 971018; sun4m SunOS 5.5.1]
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit