Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> HELP!!! Trying to execute a program from PL/SQL
I'm trying to run another program from inside a PL/SQL package. So far, I've managed to write the parameters for the program to a file using UTL_FILE, but I'm still having trouble calling the program. I've tried two approaches:
> PROCEDURE shell (sys_cmd IN VARCHAR2)
> IS
> DECLARE
> sys_file UTL_FILE.FILE_TYPE;
> BEGIN
> sys_file := UTL_FILE.FOPEN (' | /bin/', 'sh', 'W');
> UTL_FILE.PUT(sys_file, sys_cmd);
> UTL_FILE.NEWLINE(sys_file);
> UTL_FILE.FCLOSE(sys_file);
> END;
which, even after toying with it (moving the pipe around, changing the
write to append, etc.), I could not get to work. Any UNIX gurus have any
ideas on how it might be made to work? Or does anyone know of another
way to use UTL_FILE to run a executable?
Any help would be greatly appreciated!
Marianne Received on Wed Apr 30 1997 - 00:00:00 CDT