Re: Informix SPL SYSTEM Command Question
Posted in 1996
Topics: Stored Procedures & SPL, Connectivity: ESQL/C, 4GL & Embedded SQL
Hi Jonathan, About the email servers, I don't know if there is a problem since are email servers are located in Boise and I'm the in SF Bay Area but you're right, even from the inside out, I noticed delays in delivery. It probably has something to do with the power outage but I haven't heard anything "official" from the system administrators. On to more interesting matters: I tried what you suggested and the good, no GREAT news is : I found the problem and fixed it. The bad news is, I still don't know what caused it or where it was coming from. Let me explain: Running a stored procedure with the SYSTEM command that you suggested gave me SOMEBODY's env setting wherein the INFORMIXSERVER parameter was set to garbage. But the weird thing is, I don't know who's env the stored procedure was reading -- I ran the env command from the UNIX command line as the person I was logged on as (the same person who executed the stored procedure and for that matter, created the stored procedure), and the result on the env was COMPLETELY DIFFERENT from the one I got by executing the SP. I also checked the env of informix and root and they didn't match either. So who's env was that?!? Because I couldn't figure out where the env was being read, I asked the UNIX sys admin to bring the instance down and back up. Now, running the same stored procedure revealed that the INFORMIXSERVER was set to the correct value. And sure enough, the whole thing works again. On the SYSTEM fglgo ... command, that was just a test, and I just wrote that to demonstrate that I was calling the 4GL script directly from the shell script. In the real stored procedure, I call the shell script and one of the first things that that shell script does is read a file (called .informix_env) which sets the correct informix environment. Is that what you were referring to? Please let me know if it was something different because I want to do everything possible to avoid a situation like this one! But, THANKYOU for that suggestion, I would've hated to end this week without fixing this problem! Relieved but confused (okay, this is the last one!) Anisha anisha_vaswani@hp.com ______________________________ Reply Separator _________________________________ Subject: Re: Informix SPL SYSTEM Command Question Author: Non-HP-johnl (johnl@informix.com) at HP-Boise,shargw4 Date: 8/15/96 10:23 AM Anisha, I am getting notifications from the HP mailers that email is not getting through after 4 hours, but they will keep on trying for 5 days, and the mail does get through some time later. This has affected emails I've sent to you and to other people within HP. I wonder if the power outage at the weekend upset something... > SYSTEM "fglgo script_name arg1 arg2 arg3 ..." I never run a program like that. I specify a path name (painful, but necessary in my book, to avoid the problems you are having), and the pathname is of a shell script that sets the correct environment. To find out what your trouble is, I'd modify the SP to run a test program: SYSTEM("{ echo;date;env; } >>/tmp/env.log"); on both systems -- this will tell us what the environments are for the commands run by the SPs. They'll be radically different, I think -- one is more or less complete and has INFORMIXDIR set and PATH contains $INFORMIXDIR/bin, and the other doesn't. Yours, Jonathan Leffler (johnl@informix.com) #include <disclaimer.h> >From: ANISHA_VASWANI@HP-SanJose-om1.om.hp.com >Date: Thu, 15 Aug 96 10:02:32 -0700 > > First of all, thanks to everyone who responded to my question. But, it > still doesn't work :( > > Several of you suggested to check the permissions on this file -- they > seem to be set correctly. The file has the follwing permissions: > -rwxr-xr-x > In other words, it is readable and executable by all. I called > informix tech support and they suggested that I change the group to > informix from users and this didn't help either. I also make sure that > I'm in the right directory by doing another SYSTEM command that does a > cd using absolute pathnames before I call the shell script. > > Jonathan, > > You and I suspect the same thing that something critical has changed > in the environment -- BUT WHAT?!? On first pass, the environments on > the test and production systems appear to be similar. Do you have any > pointers on where or what I should look for? > > Still frustrated, > > Anisha > anisha_vaswani@hp.com >______________________________ Reply Separator ________________________________ _ >Subject: Informix SPL SYSTEM Command Question >HP-Boise,shargw4 >Date: 8/14/96 2:28 PM > >Item Subject: cc:Mail Text > > Hi Informix Gurus, > > I'm struggling with the following problem and any tips would be > greatly appreciated: > > Environment > =========== > > OS: HP UX 10.X > Informix Online Version: 7.12.UC1 > Informix 4GL Version: 6.02.UD1 > > Problem > ======= > I have a stored procedure that uses the SYSTEM Command to call a shell > script which eventually calls a 4GL script. The problem is that this > is not working anymore. I keep getting SQL Error -668 which is that a > SYSTEM Command failed. The reason I said anymore is that it used to > work before and it just stopped working and I'm not sure why. It gets > even crazier -- I have the exact same setup on the test system and it > works fine over there! > > So to find out what the problem was, I created a simple stored > procedure that calls a shell script using the SYSTEM Command and all > this shell script does, is echo a string to a debug file. This does > not work! However, if I do the echo to the debug file directly from > the stored procedure, it works just fine. I also tried the following: > SYSTEM "fglgo script_name arg1 arg2 arg3 ..." > > i.e. execute the 4GL script directly from the stored procedure > This also gives me the -668 error. > > Anyone have any explanations for this behaviour? Also, is anyone aware > of any environment variables or issues that might be relevant? I ask > this because the darn thing runs on one system with the identical > setup and not that other! > > Extremely frustrated, > Anisha > anisha_vaswani@hp.com >