Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Equivalent of UNIX hear document on Windows NT
dbaplusplus_at_hotmail.com wrote:
> Simon:
>
> I have seen something similar in RMAN backup scripts provided by
> Netbackup on Windows where they do echo bunch of commands and pipe to
> rman, but I had trouble making that work. I do not undertstand what is
> the purpose of goto in your examale and why one needs this_script.cmd
> when one is echoing sql statements.
>
> Thanks in advance.
>
The idea is you run the script, it executes a few commands doing whatever - then starts sql*plus and loads the *same* script into sqlplus.
the goto :eof jumps to the end and the script finishes
When sql*plus loads the script, the first few lines are commented out with /* ...
... */
so sql*plus will just execute the SQL at the end of the file
An alternative and probably easier to follow method is to do
echo command1 >script.sql
echo command2 >>script.sql
but that will fail if the commands include anything like < > or |
-
Simon Sheppard, SS64.com
Received on Thu Mar 09 2006 - 17:14:37 CST