Re: Execute a Shell script command from a stored procedure

From: Steve Phelan <stevep_at_toneline.demon.co.uk>
Date: 1997/07/28
Message-ID: <870077297.9807.0.nnrp-2.c2de712e_at_news.demon.co.uk>#1/1


bvdao wrote in article <01bc9a0a$b48e33e0$ca41ddcf_at_tb257>...

>Hi:
>
>I have a stored procedure which creates a number of flat files on an UNIX
>platform. I need to be able to zip up all these files once the stored
>procedure is done creating these flat files. How can I do this? Is there
>a way that I can call a shell script from within my stored procedure? This
>store procedure is a background process which is scheduled to run at a
>specific time interval and I use DBMS_JOB to do this.
>
>Please help...Thank you

There is no way to *directly* call an external command from a stored procedure. You should look at 'pipes' for communicating to an outside process (C or shell script) that is waiting for a message to be sent to it across a pipe.

Having said all of that, it might just be easier to schedule your 'compress' job to run via cron at a time that is suitable - i.e., if your jobs run at 10:00 and are always finished by 11:00, then just seup a cron job to run at 11:00. You could also create a 'control file' of commands/status with you stored procedure code to drive the external compress cron'ed script actions.

Steve Phelan. Received on Mon Jul 28 1997 - 00:00:00 CEST

Original text of this message