Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Host command within PL/SQL Proc!

Host command within PL/SQL Proc!

From: Richard Fairbairn <rfairbairnNOrfSPAM_at_uk.intasys.com.invalid>
Date: 2000/07/25
Message-ID: <08f8557c.412f9092@usw-ex0105-038.remarq.com>#1/1

Hi,
I am trying to use DBMS_SQL to initiate Unix scripts from my PL/SQL. I have tried the following to start a script called banana.sh but it hasn't worked.

CREATE OR REPLACE procedure rwf_test as
 CURSOR$$ INTEGER;
 TMP_STR VARCHAR2(300);
 EXECUTE_SHELL INTEGER;
BEGIN
 TMP_STR := '! banana.sh';
 CURSOR$$ := DBMS_SQL.OPEN_CURSOR;
 DBMS_SQL.PARSE(CURSOR$$,TMP_STR,DBMS_SQL.V7);  EXECUTE_SHELL := DBMS_SQL.EXECUTE(CURSOR$$);  DBMS_SQL.CLOSE_CURSOR(CURSOR$$);
 DBMS_OUTPUT.PUT_LINE('Successfully Executed, We Hope!'); END;
/
Error message produced =
ERROR at line 1:

ORA-00900: invalid SQL statement
ORA-06512: at "SYS.DBMS_SYS_SQL", line 491
ORA-06512: at "SYS.DBMS_SQL", line 32
ORA-06512: at "RICHARDF.RWF_TEST", line 8
ORA-06512: at line 1


-----------------------------------------------------------

Got questions? Get answers over the phone at Keen.com. Up to 100 minutes free!
http://www.keen.com Received on Tue Jul 25 2000 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US