|
|
|
|
Re: executing a stored procedure from batch file [message #194339 is a reply to message #194289] |
Thu, 21 September 2006 10:19  |
rigatonip
Messages: 50 Registered: December 2005
|
Member |
|
|
Here's another example showing how to run a sql statement from a batch file.
http://orafaq.cs.rmit.edu.au/scripts/win/runsql.txt
You could modify it to something like this to take a procedure name as an argument.
@echo off
rem ----------------------------------------------------------
rem Filename: RunSql.bat
rem Purpose: Run SQL*Plus script from DOS batch file
rem Date: 05-Mar-2002
rem Author: Frank Naude, Oracle FAQ
rem ----------------------------------------------------------
rem Purpose: Run SQL*Plus script from DOS batch file
rem -- Accept command line arguments --
rem Note: %1 is the first command line argument, %2 the second, etc.
if "%1" == "" goto Usage
set PNAME=%1
echo Command Line Argument: %PNAME%
rem -- Create sql script
echo connect scott/tiger@amsaa >%0.tmp
echo begin >>%0.tmp
echo %PNAME%; >>%0.tmp
echo end; >>%0.tmp
echo / >>%0.tmp
echo exit >>%0.tmp
rem -- Run sql script --
sqlplus /nolog @%0.tmp
rem -- Cleanup --
del %0.tmp
goto End
:Usage
echo Usage: %0 procedure_name
:End
|
|
|