Unix Technical Forum

Linux fgl_getenv

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 ...


Go Back   Unix Technical Forum > Database Server Software > Informix

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-19-2008, 08:27 PM
Glen Johnson
 
Posts: n/a
Default Linux fgl_getenv

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.


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-19-2008, 08:27 PM
John Carlson
 
Posts: n/a
Default Re: Linux fgl_getenv

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...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-19-2008, 08:28 PM
Jonathan Leffler
 
Posts: n/a
Default Re: Linux fgl_getenv

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/

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-19-2008, 08:28 PM
Glen Johnson
 
Posts: n/a
Default Re: Linux fgl_getenv


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/
>



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-19-2008, 08:29 PM
Jonathan Leffler
 
Posts: n/a
Default Re: Linux fgl_getenv

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/

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 04-19-2008, 08:29 PM
Glen Johnson
 
Posts: n/a
Default Re: Linux fgl_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.


I want to set a variable to selectively turn various trace statements on and
off in stored procedures.


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 04-19-2008, 08:30 PM
Jonathan Leffler
 
Posts: n/a
Default Re: Linux fgl_getenv

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/

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:34 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com