pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
DBI
4+ messages / 3 participants
[nested] [flat]

* DBI
@ 2001-03-01 09:17 Ene Cosmin <cosmox@email.ro>
  2001-03-01 10:36 ` Re: DBI Anatoly K. Lasareff <tolik@aaanet.ru>
  2001-03-01 11:06 ` Re: DBI Stefan Huber <schweinsaug@crosswinds.net>
  0 siblings, 2 replies; 4+ messages in thread

From: Ene Cosmin @ 2001-03-01 09:17 UTC (permalink / raw)
  To: pgsql-admin




 Hi. I need to know if I configure my psql with perl library I also need
the DBI::Pg class for quering my database in psql?. The following example
will work?

------
use DBI;

$dbh = new DBI( 'dbi:Pg:database;host', 'user', 'secret' );
if( ! $dbh->dbh ){
  echo "Could not connect to the database.<br>\n";
  exit( );
}

$sth = $dbh->prepare( 'SELECT COUNT(*) FROM some_table' );

and sow on...

------

What else do I need to install for quering a database in this way?

I did not installed yet Psql to know if will works.
Sorry, but my english it's not so god.
Cosmin.

______________________________________________________________________
Do you want a free e-mail for life ? Get it at http://www.email.ro/





______________________________________________________________________
Do you want a free e-mail for life ? Get it at http://www.email.ro/




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: DBI
  2001-03-01 09:17 DBI Ene Cosmin <cosmox@email.ro>
@ 2001-03-01 10:36 ` Anatoly K. Lasareff <tolik@aaanet.ru>
  1 sibling, 0 replies; 4+ messages in thread

From: tolik@aaanet.ru @ 2001-03-01 10:36 UTC (permalink / raw)
  To: Ene Cosmin <cosmox@email.ro>; +Cc: pgsql-admin

>>>>> "EC" == Ene Cosmin <cosmox@email.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@aaanet.ru 
http://tolikus.hq.aaanet.ru:8080    Phone:      (8632)-710071



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: DBI
  2001-03-01 09:17 DBI Ene Cosmin <cosmox@email.ro>
@ 2001-03-01 11:06 ` Stefan Huber <schweinsaug@crosswinds.net>
  1 sibling, 0 replies; 4+ messages in thread

From: Stefan Huber @ 2001-03-01 11:06 UTC (permalink / raw)
  To: pgsql-admin


> Hi. I need to know if I configure my psql with perl library I also need
>the DBI::Pg class for quering my database in psql?. The following example
>will work?

if you vconfigure postgresql with --with-perl, the "native" Pg Module is built. This one differs a bit from DBI::Pg.
For me, I do not have DBI::Pg installed, but Pg, and I am using it successfully.

If you want do use DBI::Pg, you'll have to install it from CPAN.

Stefan




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Re: DBI
@ 2001-03-01 12:22 Ene Cosmin <cosmox@email.ro>
  0 siblings, 0 replies; 4+ messages in thread

From: Ene Cosmin @ 2001-03-01 12:22 UTC (permalink / raw)
  To: pgsql-admin


Thanks for the answer. 
Where can I find this modules: DBI and DBD::Pg are classes ...?>?
sorry.... i don't know how to do it...i really nead to know for
a university project!!


... and why can I acces your webpage?

> http://tolikus.hq.aaanet.ru:8080    

______________________________________________________________________
Do you want a free e-mail for life ? Get it at http://www.email.ro/




^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2001-03-01 12:22 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-03-01 09:17 DBI Ene Cosmin <cosmox@email.ro>
2001-03-01 10:36 ` Anatoly K. Lasareff <tolik@aaanet.ru>
2001-03-01 11:06 ` Stefan Huber <schweinsaug@crosswinds.net>
2001-03-01 12:22 Re: Re: DBI Ene Cosmin <cosmox@email.ro>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox