INFORMIXSERVER and DBD::Informix
Posted in 1998
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL
One thing's puzzled me about DBD::Informix and probably ESQLC too. To make a connection to the database one runs: DBI->connect($dbserver,$user',$passwd,'Informix'); But in addition, one has to also set the environment variable, INFORMIXSERVER, too. Why is this? Let's weigh the possibilities. Let's suppose INFORMIXSERVER is set differently to the database server referred to in dbserver, that is the name after the '@' if it exists. If INFORMIXSERVER is not responding, I get a failure. Now Let's say that INFORMIXSERVER is always set set to the same thing as the database server when it is given. We've reduced the possibility some other possibly different database server failing causing me to make a connection to the database where I want to connect to. Thus, in the perl code that I write using DBD::Informix, I always set the INFORMIXSERVER environment variable to be the name of the database server. Can I get into trouble here? Finally, it occurs to me that this kind of thing should probably be done in the driver code, especially in situations where a database server *has* been specifed but INFORMIXSERVER *has not* been specified. Code-wise it's just a simple getenv() and putenv(). What am I missing? What are the complications?