Home » SQL & PL/SQL » SQL & PL/SQL » Executing OS commands from PL?
Executing OS commands from PL? [message #35967] Fri, 26 October 2001 04:41 Go to next message
patrick
Messages: 83
Registered: December 2000
Member
From SQL*plus I can execute "$dir c:*.* > files.txt".
Is it possible to do this within a stored procedure?

----------------------------------------------------------------------
Re: Executing OS commands from PL? [message #35969 is a reply to message #35967] Fri, 26 October 2001 07:02 Go to previous messageGo to next message
Phenoracle
Messages: 35
Registered: March 2001
Member
Hi,
We have a open source package that enables you
to call OS commands from within PL/SQL.
Have a look at it.

http://www.phenoracle.co.uk

Have fun

Rae



----------------------------------------------------------------------
Re: Executing OS commands from PL? [message #35975 is a reply to message #35967] Sat, 27 October 2001 07:27 Go to previous message
Milan Kumar Barui
Messages: 16
Registered: October 2001
Junior Member
For executing OS command from PL/SQL,

Step 1: Write pl/sql program what sends commands to oracle shared memory by using DBMS_PIPE.PACK_MESSAGE('command') and DBMS_PIPE.SEND_MESSAGE('pipe').

step 2: write one pro*c program which recieves this command by
DBMS_PIPE.RECIEVE_MESSAGE('pipe') and DBMS_PIPE.UNPACK_MESSAGE('command').
write execute(command) in this program.

STEP 3: compile pro*c program and run in back end as detached process in loop.

step 4: run pl/sql and send message to pro*c and it will execute.

Just try, it must work. Give me feedback.
Milan

----------------------------------------------------------------------
Previous Topic: Concatenation alternatives
Next Topic: Re: to create a table structure from an existing structure
Goto Forum:
  


Current Time: Tue Apr 16 17:43:08 CDT 2024