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 -> Re: Writing shell scripts for nt and sqlplus?

Re: Writing shell scripts for nt and sqlplus?

From: Walter T Rejuney <BlueSax_at_Unforgetable.com>
Date: Mon, 04 Dec 2000 09:05:48 -0500
Message-ID: <3A2BA4BC.F07120E6@Unforgetable.com>

kevinoleniczak_at_my-deja.com wrote:

> I'm trying to write a windows batch file that will do several things,
> one of which is to login to oracle via sqlplus and execute a few
> commands. In unix this was easy.
>
> You would write a shell script to do something, then login oracle via
> sqlplus, do something there, and then exit. To do this you would do
> something like...
>
> the above script would login with the account info and then execute
> everything between the "eof" or whatever tag name you wanted. This
> worked well and allowed variables or constants to be shared between the
> shell part of the script and the oracle / sqlplus part of the script.
>
> How do you replicate this functionality for windows nt 4? Ultilamtely I
> need a batch file that can do something like sql-load a file, and then
> do something special if an error was encountered. Any clues would be
> appreciated.

One solution would be to get the MKS Toolkit. I used this to port some shell scripts on UNIX to use with a database on an NT system. It was essentially glitch free once I learned how to use the toolkit. The cost is about $369 for the "developer" version.

There are other freeware or shareware toolkits as well. I haven't tested any of them so I cannot vouch for how well-behaved they are. Most of them offer a shell capability.

There is apparently some shell capability built into the NT resource kit. Unfortunately on the one box where I installed the NT resource kit I also installed the MKS Toolkit so it is difficult to separate the two. I think the resource kit version has some limitations, but it might be good enough to do here-documents.

Another choice is to learn Windows Script Host and re-write your shell scripts into VBScript or JScript. This is a bit more of a pain then just being able to port the shell scripts, but once you do it a couple times you'll start to develop techniques that you'll reuse. Received on Mon Dec 04 2000 - 08:05:48 CST

Original text of this message

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