This is what it is showing. No output even after running the code block
SQL> DECLARE
2 message varchar2(20):= 'Hello, World!';
3 BEGIN
4 dbms_output.put_line(message);
5 END;
6 /
PL/SQL procedure successfully completed.
Try this:
set serveroutput on;
DECLARE
message varchar2(20):= 'Hello, World!';
BEGIN
dbms_output.put_line(message);
END;
/
This program I guess is a basic HelloWorld in a PL/SQL Block. There is an extra space between the variable message and it's datatype varchar. Just remove it. And also, while assigning the values, there mustn't be a space between a colon equal to(:=) and the single quotes(''). [It would work :) ]. For eg. in a PL/SQL block we use single quotes('') to declare a string.
Well I am new here. I don't know how Stack Overflow exactly works for a novice like me, but yes some gentlemen or lady has already commented about using the below command:
set serveroutput on;
Which is absolutely correct as far as my knowledge. It is necessary for executing PL/SQL Programs.
P.s. Do tell me if I am wrong anywhere. I am open to suggestions.
Additionally to this:
set serveroutput on;
try and run then whole script (F5) and not only the statement It worked for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With