Re: PLSQL running a DOS command
From: <mcstock>
Date: Tue, 2 Dec 2003 18:57:20 -0500
Message-ID: <TOSdneeAPrCZulCiRVn-tA_at_comcast.com>
set echo off
set termout off
set feedback off
set serveroutput on size 500000
spool somefilename.cmd
Date: Tue, 2 Dec 2003 18:57:20 -0500
Message-ID: <TOSdneeAPrCZulCiRVn-tA_at_comcast.com>
that's because HOST is a SQL*Plus command, and SQL*Plus is a specific database interface tool
if you're running your PL/SQL procedure from SQL*Plus as an anonymous block, then you could user DBMS_OUTPUT to generate SQL*Plus commands to be spooled to a file, then run that file, ie
(for illustration only -- this is not a working bu script these commands would all be included in a SQL*Plus script file)
set echo off
set termout off
set feedback off
set serveroutput on size 500000
spool somefilename.cmd
begin
- some pl/sql stuff, for example for r1 in ( select file_name from dba_data_files order by file_name ) loop dbms_output.put_line('host copy ' || r1.file_name || ' z:\oracle\filebu'); end loop; end; /
spool off
set termout on
host somefilename.cmd
- mark c stock
- mcstock at enquery . com
- www.enquery.com
"Trevor Pearce" <trevor.pearce_at_ntlworld.com> wrote in message news:2q9zb.2052$ec6.649797_at_newsfep1-win.server.ntli.net...
| Hi, | | I am trying to create a PLSQL procedure that zips up the archive logs and | then deletes the originals. I cannot find how to run the wzzip command | inside a PLSQL procedure. The host command will work in SQL but I cannot | get it to work in PLSQL. | | Any assistance welcome | Trevor | |Received on Wed Dec 03 2003 - 00:57:20 CET