PL/SQL: call by value/reference?

From: Steffen Goeldner <sgoeldner_at_eurodata.de>
Date: Wed, 02 Dec 1998 10:23:39 +0100
Message-ID: <3665071B.934776F9_at_eurodata.de>



The Oracle Documentation says:

  To optimize execution, the PL/SQL compiler can choose different   methods of parameter passing (copy or reference) for different   parameters in the same subprogram call.

Is there any more information available?

It seems that in 'in out' mode the compiler chooses an expensive copy method!

In the following example, the execution time (0 - 200 seconds) depends on

  • typ und size of table records (Number, Varchar(20) vs. Varchar(2000))
  • size of the table (i in the first loop: 100 vs. 1000)
  • parameter mode (in vs. in out)

declare
  type tt is table of varchar(2000) index by BINARY_INTEGER;   t tt;
  procedure x(t_dummy in out tt) is begin null; end; begin
  for i in 1 .. 1000 -- 100
  loop
    t(i) := i;
  end loop;
  for i in 1 .. 1000
  loop
    x(t);
  end loop;
end;

Steffen Received on Wed Dec 02 1998 - 10:23:39 CET

Original text of this message