1

In ORACLE SQL Developer, this gets execute when am trying to run procedure call with its output.

create or replace
procedure allparam_proc(name varchar2,nestedtable_param VARCHAR2_TT)
is
begin
   DBMS_OUTPUT.PUT_LINE('allparam_proc');
    FOR i IN nestedtable_param.FIRST..nestedtable_param.LAST LOOP
        DBMS_OUTPUT.PUT_LINE(nestedtable_param(i));
    END LOOP;
end;

Problem :

set serveroutput on;
declare
fruits VARCHAR2_TT := VARCHAR2_TT('Orange','Kumquat','Grape','Banana');
begin
    allparam_proc('leo',fruits);
end;

Output :

line 1: SQLPLUS Command Skipped: set serveroutput on;

sunleo
  • 10,589
  • 35
  • 116
  • 196
  • Can you mention the version of `SQL Developer` you use ? Enabling serveroutput can be done via `View -> Dbms Output`; Semicolon is fine. Select what ever requires to be executed, and `F5` would be enough. Good Practice, is to end every `PL/SQL` block with a `/` though sometimes, the tool do it implicitly sometimes. – Maheswaran Ravisankar Jun 24 '14 at 07:10
  • yes it works make it as answer. – sunleo Jun 24 '14 at 11:04
  • Great, posted answer with few extra information and references. Thanks! – Maheswaran Ravisankar Jun 24 '14 at 11:22

1 Answers1

3

In SQL Developer, Enabling serveroutput can be done via View -> Dbms Output

Using Semicolon is fine. But, Select what ever requires to be executed, and F5 (Execute as a Script) would be enough.

Good Practice, is to end every PL/SQL block with a / though the tool do it implicitly sometimes. Atleast it improves readability and continuity when the IDE has multiple anonymous PL/SQL blocks.

Answers here have great explanations in detail.

enter image description here

Community
  • 1
  • 1
Maheswaran Ravisankar
  • 17,652
  • 6
  • 47
  • 69