Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Perl DBI Informix

by Marshall (Canon)
on Aug 24, 2009 at 05:32 UTC ( [id://790734]=note: print w/replies, xml ) Need Help??


in reply to Perl DBI Informix

INFORMIXDIR is an environment variable that needs to be set for informix to find some parts of itself.

You are on Windows it appears. Look at this link for "how to" set a durable ENV variable: http://support.microsoft.com/kb/310519

You will have to consult your DB documentation for tips on what needs to be in INFORMIXDIR, but once you figure that out the above link should help you set it. Update: I would start by setting INFORMIXDIR to the FULL PATH of the directory in which you have installed your informix product.

On Windows to see what is in current ENVIRONMENT, type: env at the command prompt. You will be added something new to this list. Once done like above, it will persist between reboots, etc.

it is possible to set an env variable like : set x=2, but will not persist between reboots nor will it apply to other shell sessions. Hey got ahead and open a command window and try that just so that you are clear about what you are doing, set x=2, then env to see that x=2 is there for only this shell instance.

Anyway, just go ahead and set this env variable for all shells (see above MS link) and hopefully it will become a distant memory of something that you had to do last year...

Replies are listed 'Best First'.
Re^2: Perl DBI Informix
by Sun751 (Beadle) on Aug 24, 2009 at 06:10 UTC
    I Did set INFORMIXDIR and now I am with another problem, C:\perlJunk>perl DBItestdb.pl DBI connect('testdb','',...) failed: SQL: -25596: <<Failed to locate SQL error m essage> at DBItestdb.pl line 11 Can't call method "prepare" on an undefined value at DBItestdb.pl line 13. Any Idea?Please Cheers
      This is good...you are listening and working on your own and making progress! That approach will generate lots of help on Monk's!

      I suspect that something is wrong in the connect.

      my $dbh = DBI->connect("dbi:Informix:testdb");
      I would think that the argument to "connect" should be a file name that is valid on Windows. I would also suspect that $dbh is "undefined".

      See if you can find some "test DB" provided in the Informix package, then supply full path name to that to see if you can connect to it with a defined, non-zero $dbh. Update: or perhaps, just modify name to be "Informix.testdb".

      Update: I'm not a super DB guru, but I do know that sometimes there are some steps that you have to go through to "get the db started", meaning that you can't just start with an "empty db file". To set up even a simple table with just say "date", "city" or whatever, the DB has to "learn" what "date" and "city" mean. As I said, I am not an Informix guy, but look in the documentation for how to get a DB started. There is probably a readable DB already set up as a demo that you can play with. I am guessing, but I suspect that this is true.

      Two potential problems:
      Is testdb really installed?
      Could it be the stores db?
      I would use dbacces or something similar to check the SQL first.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://790734]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2024-04-19 01:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found