From: | tolik(at)aaanet(dot)ru (Anatoly K(dot) Lasareff) |
---|---|
To: | Ene Cosmin <cosmox(at)email(dot)ro> |
Cc: | pgsql-admin(at)postgresql(dot)org |
Subject: | Re: DBI |
Date: | 2001-03-01 10:36:55 |
Message-ID: | 86hf1dg4hk.fsf@tolikus.hq.aaanet.ru |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-admin |
>>>>> "EC" == Ene Cosmin <cosmox(at)email(dot)ro> writes:
EC> Hi. I need to know if I configure my psql with perl library I also need
EC> the DBI::Pg class for quering my database in psql?. The following example
EC> will work?
EC> ------
EC> use DBI;
EC> $dbh = new DBI( 'dbi:Pg:database;host', 'user', 'secret' );
EC> if( ! $dbh->dbh ){
EC> echo "Could not connect to the database.<br>\n";
EC> exit( );
EC> }
EC> $sth = $dbh->prepare( 'SELECT COUNT(*) FROM some_table' );
EC> and sow on...
EC> ------
EC> What else do I need to install for quering a database in this
way?
It seems to me your example is right.
So you need modules: Pg (installs together with postgresql), DBI and
DBD::Pg.
--
Anatoly K. Lasareff Email: tolik(at)aaanet(dot)ru
http://tolikus.hq.aaanet.ru:8080 Phone: (8632)-710071
From | Date | Subject | |
---|---|---|---|
Next Message | Stefan Huber | 2001-03-01 11:06:36 | Re: DBI |
Previous Message | Enrico Mangano | 2001-03-01 09:48:36 | something more about my question about performance |