read unix env. variables from stored procedure ...
Posted in 2000
Topics: Stored Procedures & SPL
Hi All I faced unexpected problem before moment before we have to send our project to customers. I use Stored Procedure that calls executable. I though that this executable will locate in one place all the time, and I hardcoded its path is Stored Procedure. But turned out , that our customers can put this executable in different directories.There is env. variable that hold this path. Is that possible to read this path from Stored Procedure ? Regards Igor
Igor wrote: > I faced unexpected problem before moment before we have to send our > project to customers. > I use Stored Procedure that calls executable. > I though that this executable will locate in one place all the time, > and I hardcoded its path is Stored Procedure. > But turned out , that our customers can put this executable in > different directories.There is env. variable that hold this path. > Is that possible to read this path from Stored Procedure ? Not reliably -- in fact, probably not at all. The environment variable probably won't be available to the server even if it is set in the client's environment. Will the script be in the same place for all client's on a given machine, or could ClientA have it in LocationA and ClientB have it in LocationB? The most reliable technique is likely to be a configuration table, possibly keyed by user, possibly keyed by machine, which contains information for each relevant group of users or machines. Your code in the SP will pull the location from the configuration table to build the pathname -- a table instead of the environment. -- Jonathan Leffler (jleffler@informix.com, jleffler@earthlink.net) Guardian of DBD::Informix v0.95 -- see http://www.perl.com/CPAN #include <disclaimer.h>