I got this from asktom.com and I have explained below how to use this daemon in your pl/sql to get the file names.
I have tried it and it works like a charm !!!
hope this helps
-----------------------------
This is a quick and dirty daemon -- written in csh (the cool shell)..
Here is a PL/SQL subroutine you can install in your schema:
create or replace procedure host( cmd in varchar2 )
as
status number;
begin
dbms_pipe.pack_message( cmd );
status := dbms_pipe.send_message( 'HOST_PIPE' );
if ( status <> 0 ) then raise_application_error( -20001, 'Pipe error' );
end if;
end;
/
Here is a C-Shell script you can run in the background (use this shell script
make sure it is named host.csh)
Hi,
I tried the above..it doesnt seem to work for me:(
Hes how i went about!!
1.Created the procedure
2.created the script and started it in the background.and it created this tmp.csh file (an empty one)
3.executed the procedure
It just said procedure successfully completed...and the other window closed in which the background process was going on...and the tmp.csh was still empty
Can u please tell me as to where would i have gone wrong.
thank you
Did you give the correct username/password for sqlplus in host.csh. This will be the username under which you compiled the procedure.
Make sure the background process is always runing by
typing the unix command ps -ef | grep unix_user.
This is what you should be able to see if everything works fine.
sqlplus > exec host( 'ls -l' );
The output of ls -l will apprear in the inix window.
Hi
Thanx for the reply...
The background process is running continously
and when ina diff window i do
sql>exec host('ls');
it just says ..successfully xecutes..and shows no o/p int the wondow where i can c the backgorund process going on..
Thank you
Bookmarks