Hi Peter,

Thanks to your response. Send to the DBI user group as this group is more
likely to know about what sqlplus may be.

Am trying to convert UNIX scripts to Perl scripts. It just so happen that I
have two servers that runs Oracle on Windows, so I've decided to test what I
can or I cannot do on Windows, i.e. EOF/EOL wise. I know this is possibe on
DOS/Windows, just can't find where I've seen it before. I know there is this
one website dedicated to DOS scripting with an example of using EOF/EOL and
<< syntax. Still Googling ... :-)

If all else fails, will use DBI like you suggested, needs a lot of practice
though ... will be good in the long run I suppose

On Tue, Apr 20, 2010 at 12:11 AM, Peter J. Holzer <h...@wsr.ac.at> wrote:

> On 2010-04-19 21:21:45 +1200, newbie01 perl wrote:
> > I need to convert a lot of UNIX scripts into Perl.
>
> No, you are trying to convert a Perl script written for Unix into a Perl
> script which runs on Windows.
>
> > Most of them uses the
> > UNIX's EOF/EOL functionality. These scripts are mostly used to connect to
> > Oracle databases. At the moment, installing a DBI is not an option.
>
> Then why do you ask on the DBI mailing list?
>
> > The scripts will be running locally on the servers so technically it
> > should be able to connect to the database without using a password.
>
> I don't see what that has to do with your problem.
>
>
> > Example of a very simple test script is as below. If I run the script on
> > UNIX, it is all good. But on Windows, it gives the error "<< was
> unexpected
> > at this time."
>
> I assume that error comes from cmd.exe when it tries to execute
> the line
>
> >    sqlplus -S "/as sysdba" <<SQLEND
>
> It has been a long time since I wrote DOS/Windows style batch files, but
> I doubt that cmd.exe has learned about here documents since then.
>
>
> > Can anyone please advise what I needed to change to get both
> > running for UNIX and Windows?
>
> Use DBI. Seriously. use DBI.
>
> If you really can't, you could write the input to sqlplus into a
> temporary file and then invoke it like
> sqlplus -S "/as sysdba" <$tmpfile.
> Or you could use IPC::Open2 (but I'm not sure whether that works on
> Windows).
>
>        hp
>
> --
>   _  | Peter J. Holzer    | Auf jedem Computer sollte der Satz Ludwigs II
> |_|_) | Sysadmin WSR       | eingeprägt stehen: "Ein ewig Rätsel will ich
> | |   | h...@wsr.ac.at      | bleiben, mir und andern."
> __/   | http://www.hjp.at/ |    -- Wolfram Heinrich in desd
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
>
> iD8DBQFLzEhaMdFfQa64PCwRAvu6AKCVMUHb2djozBd2PQtF0hiXXhfusACfZFBs
> t7D8j9iGysdE+H7C79DNrfU=
> =9SyN
> -----END PGP SIGNATURE-----
>
>

Reply via email to