JavaBits
JavaBits

Reputation: 2055

Cant print result in CMD with PL/SQL

I am new to PL/SQL, I have ran a simple command of Hello world in my command prompt.

DECLARE 
message varchar2(20):= 'Hello, World!'; 
BEGIN 
dbms_output.put_line(message);
END;
/

But The hello world did not get displayed in CMD although I am getting the message PL/SQL procedure successfully completed message. Please help out!

Upvotes: 1

Views: 1070

Answers (3)

Manish chourasia
Manish chourasia

Reputation: 1

We can write pl/SQL in workspace and execute easy. Example hello world

 Set serveroutput on
     Declare
    message varchar 2(20):='Hello world';
    Begin
   dbms_output.put_line(message);
    End;
    /

Result will give Hello world Pl/SQL procedure successfully completed .

Upvotes: 0

psaraj12
psaraj12

Reputation: 5072

use the below sqlplus command to display the output of dbms_output.put_line

 set serveroutput on 

before running the anonymous block

Upvotes: 0

NiiL
NiiL

Reputation: 2827

SET SERVEROUTPUT ON

will help you to print messages from buffer to your CMD...

so try,

SET SERVEROUTPUT ON

DECLARE 
message varchar2(20):= 'Hello, World!'; 
BEGIN 
dbms_output.put_line(message);
END;
/

Upvotes: 5

Related Questions