Executing a Shell Script from within a Stored Procedure
Posted in 2000
Topics: Stored Procedures & SPL
Does anyone know of any limitations when trying to run a Shell Script from within a stored procedure? I'm using the following System command: system 'sh LoadExpData.sql'; I can run the Shell Script from the Unix prompt, but when I execute the procedure, I'm getting a ISAM -127 (no primary key defined) error. Any input would be appreciated. Thanks, Buck Eskew
Please reply to my work e-mail: beskew@dsgtech.net Thanks, Buck Buck Eskew <BEskew@gte.net> wrote in message news:QhTx4.399$n.127927@dfiatx1-snr1.gtei.net... > Does anyone know of any limitations when trying to run a Shell Script from > within a stored procedure? > > I'm using the following System command: > > system 'sh LoadExpData.sql'; > > I can run the Shell Script from the Unix prompt, but when I execute the > procedure, I'm getting a ISAM -127 (no primary key defined) error. > > Any input would be appreciated. > > Thanks, > Buck Eskew > >
Buck Eskew wrote: > Does anyone know of any limitations when trying to run a Shell Script from > within a stored procedure? > > I'm using the following System command: > > system 'sh LoadExpData.sql'; > > I can run the Shell Script from the Unix prompt, but when I execute the > procedure, I'm getting a ISAM -127 (no primary key defined) error. Which directory is your shell script in? Which directory is the database server running in? Given that -127 is likely to correspond to an error exit status from the shell, I deduce that the two are different. Note, too, that the environment for the shell script will be different from your environment unless you happen to start the server and have not changed anything since you did that. So, use: system 'sh /some/absolute/path/to/LoadExpData.sql'; We'll discuss your choice of extensions for shell scripts later, but .sql is not the conventional one! -- Jonathan Leffler (jleffler@informix.com, jleffler@earthlink.net) Guardian of DBD::Informix v0.95 -- see http://www.perl.com/CPAN #include <disclaimer.h>