HELP!!! Trying to execute a program from PL/SQL

From: Marianne McKenzie <mmckenzi_at_erols.com>
Date: 1997/04/30
Message-ID: <3367F187.2E3_at_erols.com>#1/1


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:

  1. Using the DBMS_PIPE/Pro*C daemon method. Unfortuantely, my GCC compiler is not compatable with the Pro*C pre-processed code, and I don't want to shell out the $995 for the Solaris 4.5 C compiler license. Any ideas?
  2. Using this code segment that someone posted a while back

> 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 CEST

Original text of this message