http://www.perlmonks.org?node_id=487668

chennaiite has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks,
I need to connect a Informix database server in windows.I downloaded DBD::Informix from cpan...
But it is not installing,giving error of cannot locate ppd file..
Also i can't find the ppd file....
Is there any other way to connect the informix server,can i use ODBC.... If so please provide the code if you know anybody....Since i am very new to informix.... Is this is correct way to connect.please confirm....
use DBI; $host="localhost"; $base="India_C"; $dbpath = "DBI:Informix:database=$base;host=$host"; $dbh = DBI->connect($dbpath, "", "") or die "Can't open database DB +I::errstr"; print "Successful Informix DB Connection";
Thanks in advance for your reply..........

Replies are listed 'Best First'.
Re: Cannot connect informix database
by Roger (Parson) on Aug 30, 2005 at 09:09 UTC
    1. Yes you can certainly use ODBC, if you have the ODBC driver for the informix database, and also you need to install DBD::ODBC if it is not there already.

    2. As for the ppd, you just need to find a ppm repository that has more pre-compiled modules than ActivePerl's PPM. ActivePerl's PPM has too few pre-compiled binary packages. But if you were to use ODBC, then you don't need to install DBD::Informix at all.

    3. Your code looks Ok. You create the connection first, then prepare your statement, then execute the statement, then fetch the results. Pretty standard database programming techniques for Perl & DBI.

Re: Cannot connect informix database
by kprasanna_79 (Hermit) on Aug 30, 2005 at 09:33 UTC
    Hi [id://chennaiite],
    1.Search for ppd in active state site
    2.Go thr This help
    3.Its very easy to install ppd in windows rather than compiling from source.
    4.see also ppd
    -prasanna.k
      Hi Monks... Thanks Roger and Prasanna(pandruti monk)...... Thank you very much for your reply.....
      I successfully connected to the informix database using DBD::ODBC......
      But Now i got one more issue.....that
      I have to execute the procedure "syncmodifs"...
      The "synmodifs" is an stored producer name and how execute this.......
      I will be more pleased if you solve this toooooooo.......
        dbh->do('execute procedure syncmodifs');