I have (test.batch) a batch file that calls (gett.sql) sql file and executes it.
The problem is how to display the output of sql file on the screen to user.
test.batch file:
@echo off
set mypath=%cd%
@ECHO Counter...
set user_name=hr
set password=hr
set net_service_name=ORCL
echo exit | sqlplus -s %user_name%/%password%@%net_service_name% @%mypath%\gett.sql
pause
gett.sql file:
SET ECHO ON
DECLARE
BEGIN
FOR i IN 1..5 LOOP
DBMS_OUTPUT.PUT_LINE('Message# '||i);
END LOOP;
END;
PAUSE