Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Cannot connect informix database

by chennaiite (Sexton)
on Aug 30, 2005 at 07:49 UTC ( #487668=perlquestion: print w/replies, xml ) Need Help??

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 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
      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');

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://487668]
Approved by Roger
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2023-12-10 01:50 GMT
Find Nodes?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?

    Results (38 votes). Check out past polls.