web analytics

Start sqlplus in Windows .BAT script

Here is the example of emulating “HERE-documents” in Windows shell.


FIND "/*%none% some_label" <%0 |sqlplus USER/PASS@SERVER

GOTO end

: ----------- embedded SQL-------------------------

/* some_label */ select count(*) from dba_free_space;
/* some_label */ select tablespace_name from dba_tablespaces;

: ----------- end of embedded SQL-------------------------


It’s also possible to use procedures in .bat files.
%none% is replaced by empty string.
Spaces are mandadory in “/* some_label */” string.

Another possibility:

echo select global_name from global_name ;
) | sqlplus USER/PASS@SERVER


Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>




This site uses Akismet to reduce spam. Learn how your comment data is processed.


A sample text widget

Etiam pulvinar consectetur dolor sed malesuada. Ut convallis euismod dolor nec pretium. Nunc ut tristique massa.

Nam sodales mi vitae dolor ullamcorper et vulputate enim accumsan. Morbi orci magna, tincidunt vitae molestie nec, molestie at mi. Nulla nulla lorem, suscipit in posuere in, interdum non magna.