Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Can one execute an operating system command from PL/SQL?

0
Posted

Can one execute an operating system command from PL/SQL?

0

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.

0

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”.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.