मैं शायद script.sql
नामक स्क्रिप्ट (या आवश्यकताओं के आधार पर सशर्त) लिखूंगा स्वयं।
उदाहरण के लिए, निम्न script.sql
एक .bat फ़ाइल बनाता है windows_commands.bat
:
set feedback off
set echo off
set trimspool on
set termout off
set serveroutput on size 100000 format wrapped
set lines 500
set pages 0
-- create the bat file to be executed later:
spool windows_commands.bat
declare
c number;
begin
select count(*) into c from dual;
-- depending on a conditional, write the stuff to be executed into the
-- bat file (windows_commands.bat)
if c = 1 then
dbms_output.put_line('@echo everthing ok with dual');
else
dbms_output.put_line('@echo something terribly wrong with dual');
end if;
end;
/
spool off
exit
फिर आप script.sql
. पर कॉल कर सकते हैं एक और .bat फ़ाइल . से इस तरह:
@rem create oracle session, call script.sql
sqlplus %user%/%password%@%db% @script.sql
@rem script.sql has created windows_commands.bat.
@rem call this newly created bat file:
call windows_commands.bat