Sperick
Sperick

Reputation: 2761

First program in PL/SQL

I'm trying to learn some PL/SQL but I'm having an issue with my first program:

declare
    v_string_tx varchar2(256):='Hello World!';
begin  
    dbms_output.put_line(v_string_tx);
end;

When I run this in SQL Developer I just get a message saying 'anonymous block completed'. However I don't get the 'Hello World!' as expected. Anyone know what I'm missing?

I've tried placing the line 'set serveroutput on' before this code but when I do that and run it all, nothing happens(I don't even get the message telling me that the anonymous block has completed).

Upvotes: 1

Views: 1170

Answers (1)

Frank Schmitt
Frank Schmitt

Reputation: 30775

To see your output in SQL/Developer, you'll have to do this:

  • go to View -> DBMS Output (this will open a new tab called "DBMS Output")
  • click the green + sign
  • choose your connection from the drop-down box (this will add a new sub-tab to "DBMS Output")
  • run your script

Upvotes: 7

Related Questions