0

I have bat script:

@echo off
cls
:start
sqlplus user/pass@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(Host=X.Y.Z.F)(Port=1521))
                               (CONNECT_DATA=(SID=some_sid))) @test.sql
goto end

:end
pause 0

and my test.sql

DECLARE
test varchar2(32000);
BEGIN
  test:='value';
  DBMS_OUTPUT.PUT_LINE('string test');
  DBMS_OUTPUT.PUT_LINE(test||' test');
END;

When I run it I got this:

enter image description here

What it means?

1
  • Unless it's executed automatically by your setup, you'll also need to do a SET SERVEROUTPUT ON before your DECLARE statement in order to show the output from DBMS_OUTPUT. Commented Jun 14, 2019 at 22:06

1 Answer 1

5

You need to enter a forward slash (/) to flush the buffer.

DECLARE
test varchar2(32000);
BEGIN
  test:='value';
  DBMS_OUTPUT.PUT_LINE('string test');
  DBMS_OUTPUT.PUT_LINE(test||' test');
END;
/   <<<<<<<<<<<<<----- forward slash
Sign up to request clarification or add additional context in comments.

2 Comments

You bet! Note that I added a comment to the original post as well.
Yeap. / is all you need.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.