If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > Perl to Informix

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-30-03, 19:23
islamabadi islamabadi is offline
Registered User
 
Join Date: Apr 2003
Posts: 20
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!
Reply With Quote
  #2 (permalink)  
Old 05-01-03, 18:16
DoomDog DoomDog is offline
Registered User
 
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!
Reply With Quote
  #3 (permalink)  
Old 05-02-03, 17:04
islamabadi islamabadi is offline
Registered User
 
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?
Reply With Quote
  #4 (permalink)  
Old 05-05-03, 14:02
DoomDog DoomDog is offline
Registered User
 
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.
Reply With Quote
  #5 (permalink)  
Old 05-19-03, 05:32
Emmon Emmon is offline
Registered User
 
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
Reply With Quote
  #6 (permalink)  
Old 01-22-12, 15:50
begooden-it begooden-it is offline
Registered User
 
Join Date: Sep 2011
Location: Pont l'Abbé, Brittany, France
Posts: 183
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
Reply With Quote
  #7 (permalink)  
Old 01-22-12, 15:56
begooden-it begooden-it is offline
Registered User
 
Join Date: Sep 2011
Location: Pont l'Abbé, Brittany, France
Posts: 183
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On