Can one execute an operating system command from PL/SQL?
There is no direct way to execute operating system commands from PL/SQL. PL/SQL doesn’t have a “host” command, as with SQL*Plus, that allows users to call OS commands. Nevertheless, the following workarounds can be used: Database Pipes Write an external program (using one of the precompiler languages, OCI or Perl with Oracle access modules) to act as a listener on a database pipe (SYS.DBMS_PIPE). Your PL/SQL program then put requests to run commands in the pipe, the listener picks it up and run the requests. Results are passed back on a different database pipe. For an Pro*C example, see chapter 8 of the Oracle Application Developers Guide.
In Oracle7 there is no direct way to execute an operating system command from PL/SQL. However, one can write an external program (using one of the precompiler languages,OCI or Perl with Oracle access modules) to act as a listener on a DBMS_PIPE. You PL/SQL then places requests to run commands in the pipe, the listener picks it up and runs them. Results are passes back on a different pipe. For an Pro*C example, see chapter 8 of the Oracle Application Developers Guide. This example is also on the Support Notes CD-ROM that all supported customers should be getting quarterly. Just search on “DBMS_PIPE”.