Re: OS command from Stored Procedure

From: Barry Meltzer <barry_meltzer_at_wearguard.com>
Date: 2000/06/15
Message-ID: <3948D9E0.BFFB0D3B_at_wearguard.com>#1/1


Rayfil Cheung wrote:

> How can I run OS command inside a stored procedure. Thanks in advance.

There is no easy, direct way.

If you need to have a proceedure queue up a Unix command to be run whenever, the solution is not too bad. The way I have done it is to have the stored procedure write (actually append to) a shell script with a specific name in a specific location. I then have another shell script, which is scheduled to run every 15 minutese, whose function is to look for the generated one and execute it, if it exists. Any proceedure that needs to be followed up with a Unix command appends to this same predefined script. The mechanics of writing are done with the UTL_FILE package and the process is encapsulated in a proceedure I wrote and put in our general utilities package.

If you want to run an OS command in line with the rest of a procedure, well, that is another problem entirely that I, thankfully, have not had to tackle.

--

Barry
Speaking only for myself, to do otherwise would be presumptuous.
Received on Thu Jun 15 2000 - 00:00:00 CEST

Original text of this message