0
votes

I am totally new to PLSQL and I am struggling to execute a procedure in PLSQL Developer. I have created a procedure named as 'employee' as follows:

CREATE OR REPLACE PROCEDURE employee IS
    var_name VARCHAR2(20) := 'Parkavi';
    var_web VARCHAR2(20) := 'parkavi.com';
BEGIN
    DBMS_OUTPUT.PUT_LINE('Hi! I am ' ||var_name|| 'from' ||var_web);
END employee;

Now I need to execute this procedure so that I can view the output. Please help me out. Thanks in advance!!

1
If you need to test this procedure, just open new sql window and invoke it, like "begin employee; end;". The output can be seen in "Output" tab. Or you can right click on the procedure and select "Test". By the way, try to stick with "good naming" practice. - Ychdziu
@Ychdziu Still my output tab is empty and my procedure looks empty as well - Parkavi

1 Answers

1
votes

In PL/SQL Developer, you execute PL/SQL blocks in the Test Window.

File > New > Test Window will provide a template block something like this:

declare 
begin

end;

You just need to add your procedure name (and remove the unneeded declare section as you have no variables), so it's:

begin
    employee;
end;

Alternatively, right-click on the procedure name and select 'Test' from the pop-up menu, and it will generate the above block for you.

If the expected dbms_output text is not displayed in the 'Output' tab, the first thing to check is that the 'Enabled' checkbox is checked.

enter image description here

To diagnose dbms_output, the simplest test case would be just:

begin
    dbms_output.put_line('Hello');
end;