RE: Instream SQL in an NT Batch script

  • From: "Gene Sais" <Gsais@xxxxxxxxxxxxxxxxxxx>
  • To: <oracle-l@xxxxxxxxxxxxx>
  • Date: Fri, 23 Jul 2004 16:27:41 -0400

Another good reason to use perl :).  Works on all OS's.
>>> BranimirP@xxxxxxxx 7/23/2004 4:23:22 PM >>>
> I am trying to move a couple of Unix scripts to an NT server.  I
know
> just about everything needs to change but the scripts use in 
> stream SQL
> commands and for some reason NT doesn't like the syntax.
> 
> The code is simple just like:
> sqlplus / <<EOF
> select something from somewhere;
> EOF
> 
> It complains and says <<EOF not expected here. =20
> Works on Unix and Linux.
> 
> What am I missing?

What you are missing on NT is decent scripting language (and no,
VB Script aint it either). 

Sooner you shake off DOS-batch-ing from your mind, sooner you'll 
be able to "do stuff" you want or need to do... 

By default - anything you try to do via DOS batch will be:

Ugly:    read as "unreadable and hard to maintain"

Kludgey: to get DOS batch to do lots of things - you'll have to 
        wrap your mind around insane constructs

Unreliable: there are ahem, slight but very gotcha differences 
             between DOS shells across various Win platforms

What I'd do if I had lots of "streamed" scripts I'd want to share
between Unix and Windows - I'd rewrite 'em all in Python (or Perl
if only I knew it;-) and run one and same set of scripts on both 
"ends", or write small Python (or Perl) parser and stream existing 
sql stuff into Python/Perl script that will do the job.

Branimir
----------------------------------------------------------------
Please see the official ORACLE-L FAQ: http://www.orafaq.com
----------------------------------------------------------------
To unsubscribe send email to:  oracle-l-request@xxxxxxxxxxxxx
put 'unsubscribe' in the subject line.
--
Archives are at //www.freelists.org/archives/oracle-l/
FAQ is at //www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------



----------------------------------------------------------------
Please see the official ORACLE-L FAQ: http://www.orafaq.com
----------------------------------------------------------------
To unsubscribe send email to:  oracle-l-request@xxxxxxxxxxxxx
put 'unsubscribe' in the subject line.
--
Archives are at //www.freelists.org/archives/oracle-l/
FAQ is at //www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------

Other related posts: