Re: o/s system calls - can it be done?

From: Marcus Reichardt <mr_at_diamanda.hh.eunet.de>
Date: Thu, 13 Aug 1998 13:41:50 +0200
Message-ID: <35D2D0FE.3C03_at_diamanda.hh.eunet.de>


johnvue_at_gte.net wrote:
>
> Is there any way to do system (shell) operations within PL/SQL?
>
> Let's say I had a PL/SQL block and I wanted to do a "ls -l" to get a
> directory listing. Is there any way to do that?
>
> In C Language, I can do
> {
> x = system("ls -l");
> }
>
> Thanks.

The way most people do that is to use the pipe facility of the DBMS kernel: set up a pipe for use by a sender (the PL/SQL program that needs to invoke a command) and a receiver, written in Pro*C, responsible for executing the command piped by the sender. Maybe there are some tools around so one doesn't need to code this, as it involves a listener and multiple server processes on your machine.

Alternatively I have a more complex solution, which uses a table to pass arguments and the command to execute - just as the DBMS_PIPE package does internally. You would insert a row into the table and the listener would execute a command, passing back succession status and indicating "in progress" on long-running commands. This tools allows for non-blocking execution of commands.

Marcus Reichardt
Consultant Received on Thu Aug 13 1998 - 13:41:50 CEST

Original text of this message