This is a discussion on Linux fgl_getenv within the Informix forums, part of the Database Server Software category; --> Informix Dynamic Server Version 9.30.UC3 on Linux. Do I have to do something before I can use the fgl_getenv ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| On Tue, 18 Nov 2003 18:26:17 GMT, "Glen Johnson" <glen@csisoft.com> wrote: >Informix Dynamic Server Version 9.30.UC3 on Linux. Do I have to do >something before I can use the fgl_getenv call in a stored procedure? When >I try I get 674: Routine (fgl_getenv) can not be resolved. > fgl_getenv is a built-in 4gl function, I believe... |
| |||
| Glen Johnson wrote: > Informix Dynamic Server Version 9.30.UC3 on Linux. Do I have to do > something before I can use the fgl_getenv call in a stored procedure? When > I try I get 674: Routine (fgl_getenv) can not be resolved. As John Carlson said, fgl_getenv() is an I4GL function. So, to be able to call it from a stored procedure, you'd have to create a (C or Java) UDR which does the right job. Of course, even if you had it, you'd only get a weird mixture of the server's own environment and some small portions of the user's environment - at best. Most likely, you'd only see what the server had in its environment. -- Jonathan Leffler #include <disclaimer.h> Email: jleffler@earthlink.net, jleffler@us.ibm.com Guardian of DBD::Informix v2003.04 -- http://dbi.perl.org/ |
| |||
| Thanks, what do I use within a stored procedure to get environmental variables then? A system call to getenv? "Jonathan Leffler" <jleffler@earthlink.net> wrote in message news:fIDub.6590$n56.5976@newsread1.news.pas.earthl ink.net... > Glen Johnson wrote: > > > Informix Dynamic Server Version 9.30.UC3 on Linux. Do I have to do > > something before I can use the fgl_getenv call in a stored procedure? When > > I try I get 674: Routine (fgl_getenv) can not be resolved. > > As John Carlson said, fgl_getenv() is an I4GL function. So, to be > able to call it from a stored procedure, you'd have to create a (C or > Java) UDR which does the right job. > > Of course, even if you had it, you'd only get a weird mixture of the > server's own environment and some small portions of the user's > environment - at best. Most likely, you'd only see what the server > had in its environment. > > -- > Jonathan Leffler #include <disclaimer.h> > Email: jleffler@earthlink.net, jleffler@us.ibm.com > Guardian of DBD::Informix v2003.04 -- http://dbi.perl.org/ > |
| |||
| Glen Johnson wrote: > Thanks, what do I use within a stored procedure to get environmental > variables then? A system call to getenv? Usually, you don't get environment variables at all. Which one(s) do you think you need access to, and why? As I at least hinted, any environment found by something run by the server is primarily the server's own environment. Anything else is unreliable. -- Jonathan Leffler #include <disclaimer.h> Email: jleffler@earthlink.net, jleffler@us.ibm.com Guardian of DBD::Informix v2003.04 -- http://dbi.perl.org/ |
| |||
| > Usually, you don't get environment variables at all. Which one(s) do > you think you need access to, and why? As I at least hinted, any > environment found by something run by the server is primarily the > server's own environment. Anything else is unreliable. I want to set a variable to selectively turn various trace statements on and off in stored procedures. |
| ||||
| Glen Johnson wrote: >>Usually, you don't get environment variables at all. Which one(s) do >>you think you need access to, and why? As I at least hinted, any >>environment found by something run by the server is primarily the >>server's own environment. Anything else is unreliable. > > I want to set a variable to selectively turn various trace statements on and > off in stored procedures. Yes - I was afraid of something like that. For session A, you want it on; for session B, you want it off. Per-session environment variables are not supported - there basically isn't a way to get them from your client to the server. Yes, some variables are transferred during a connection. No, you can't control which ones. Further, the variables that are sent are stashed in a session control block, and not placed in the environment of the server - not in the sense of getenv(). So, there is no simple way to achieve what you are after. Maybe your best bet is a global variable which can be manipulated by a stored procedure which you call to adjust things. You'd have to review how the SPs being traced know what to do - is that a global setting or is it a per-procedure setting. -- Jonathan Leffler #include <disclaimer.h> Email: jleffler@earthlink.net, jleffler@us.ibm.com Guardian of DBD::Informix v2003.04 -- http://dbi.perl.org/ |