System call from Online stored procedure
Posted in 1997
Topics: Stored Procedures & SPL, Error Codes & Troubleshooting, Server Administration, Platform-Specific Issues
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 any server- or client-based application on the system, in the event of an error. We're doing this by declaring an Informix stored procedure, which contains a system call to invoke the error handler executable. So any client or server app which encounters an error while connected to Informix, can call the stored procedure which will invoke the error handler (the numerical error code is passed as a parameter). I've neatly (?) summarised this as follows... |--client--| |-----Informix server-----| |------------Unix---------------| APPLICATION -> STORED PROC -> SYSTEM CALL -> ERRORHANDLER.EXE -> error logfile Ok so far? So get yourself a coffee, then we'll continue... 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. The Informix response has been that there is no environment set up on this system call (except perhaps by chance?). They will not guarantee the value of any environment variable ( even $ONCONFIG !). Of course there are other methods we could try for invoking the error handler, but most which I've thought of are not ideal for other reasons. 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? Any help would be greatly appreciated! Richard Woolfall Syntegra