Results 1 to 7 of 7
  1. #1
    Join Date
    Apr 2003
    Posts
    20

    Unanswered: Perl to Informix

    My system admin has just installed Informix module that I am trying to connect to through Perl via Unix. Please keep in mind that I have been successful in connecting via ODBC and run the queries.

    Here is my code:

    #! /usr/bin/perl

    use DBI;
    $dbh = DBI->connect('dbi:Informix:testdb@testserver','user',' password'
    ,{ AutoCommit => 0, PrintError => 1 });
    $dbh->disconnect;

    I get the following error:

    DBI connect('db_dg@gsmdg1.cig.mot.com','omcadmin',...) failed: SQL: -1829: <<Failed to locate SQL error message>

    Can someone tell me what I or the system admin need to do to get this going. I saw some reference to INFORMIXDIR, INFORMIXSERVER, etc to be set. Where do these env need to be set? USer running the Perl script??

    Also, a document references sqlhosts file. Where is this other than the Informix server itself, which is there and is functional.

    What is different in UNIX world that I can't figure out? Help!

  2. #2
    Join Date
    Mar 2003
    Location
    Palmer, Alaska USA
    Posts
    13

    Re: Perl to Informix

    try adding in your perl script before your DBI connect statement:

    # Set Informix DB environment variables.
    $ENV{INFORMIXDIR} = '/informix930';
    $ENV{INFORMIXSERVER} = 'ak0779_gcdb';
    $ENV{PATH} = '/informix930/bin:/bin:/usr/bin';

    of course your specific paths and server name will most likely be different!

    hope that it helps!
    Don't take my word for it ... trial and error is my methodology (mostly error)...and then I forget and go thru it all again!

  3. #3
    Join Date
    Apr 2003
    Posts
    20
    $ENV{INFORMIXDIR} = '/informix930';
    $ENV{INFORMIXSERVER} = 'ak0779_gcdb';
    $ENV{PATH} = '/informix930/bin:/bin:/usr/bin';

    Is this information on the server that I am connecting to. For example, is the INFORMIXDIR the INFORMIXDIR that I have on the connecting server?

  4. #4
    Join Date
    Mar 2003
    Location
    Palmer, Alaska USA
    Posts
    13
    It is the information for the machine you are trying to connect from, i.e., the one you are trying to run perl on.

  5. #5
    Join Date
    Nov 2002
    Location
    London
    Posts
    47
    Hi

    I'm not sure which ODBC driver you're using here to connect but you'll find a step by step walkthrough on getting an ODBC connection with Perl including a script to return records at www.iodbc.org

    HTH
    Emmon

  6. #6
    Join Date
    Sep 2011
    Location
    Pont l'Abbé, Brittany, France
    Posts
    381
    Provided Answers: 1
    Well

    7 years after... sorry for exhumating this post, but a new release of the Perl DBD::Informix module has been released on 06/12/2011, and it works great if you meet the (easier than ever ) requirements.

    You need an up to date CSDK ( 3.XX ) and ideally perl 5.14 ( 5.12 works fine though ), have sa running informix instance and the stores database available

    Easy install with Linux, more tricky with Windows 32, and more more tricky with
    windows 64.

    to install, run
    perl -MCPAN -e "install Bundle:BI::Informix" and you get it!

    Regards
    Eric

  7. #7
    Join Date
    Sep 2011
    Location
    Pont l'Abbé, Brittany, France
    Posts
    381
    Provided Answers: 1
    Well

    7 years after... sorry for exhumating this post, but a new release of the Perl DBD::Informix module has been released on 06/12/2011, and it works great if you meet the (easier than ever ) requirements.

    You need an up to date CSDK ( 3.XX ) and ideally perl 5.14 ( 5.12 works fine though ), have a running informix instance and the stores database available

    Easy install with Linux, more tricky with Windows 32, and more more tricky with
    windows 64.

    to install, run
    Code:
    perl -MCPAN -e "install Bundle::DBD::Informix" and you get it!
    Regards
    Eric

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •