Re: System call from Online stored procedure
Posted in 1997
Richard Woolfall wrote:
>
> Background
> ==========
>
> We have a client-server system using a HP T500 box running HP-UX 10.20
> and
> Informix Online 7.22.UC3.
>
> We've written an error handler executable and wish to be able to invoke
> this from
>
> The problem
> ===========
> We would like environment variables which have been set on the client's
> connection
> to the database, to be reflected in the environment of the error
> handler. This used
> to work with Online v5, but on 7.22.UC3 our environment variables are
> _not_
> reaching the error handler.
>
> What I'd really like is a way to get Informix to set a full environment
> on this
> system call from a stored procedure. Does anyone know a way of doing
> this?
This is a tough one. In 5.0x the stored procedure was being executed
by the sqlturbo which is the user's personal copy of the Informix
engine.
The sqlturbo inherited the environment from it's parent (your
application
or utility) which in turn inherited the user's environment.
However, in Informix 7.xx the stored procedure is being executed by an
sqlexec
thread in one of the oninit processes which inherited the environment of
the
user (usually informix or root) who started up the engine. The user's
environment is simply not available to the stored procedure or the
oninitexecuting it.
Solutions:
1) Pass those variables with which you are concerned to the stored
procedure as arguments.
2) Have the application, or the user's .profile, write out a file
containing the entire environment and read that file from the error
handler program.
Art S. Kagel