Re: Functions

From: Bobby Z. <vladimir.zakharychev_at_gmail.com>
Date: Wed, 25 Feb 2009 12:39:34 -0800 (PST)
Message-ID: <a71623fc-389e-42ea-8044-acef35d47e22_at_j35g2000yqh.googlegroups.com>



On Feb 23, 8:02 pm, Robert Klemme <shortcut..._at_googlemail.com> wrote:
>
> Right, the local variable is visible - the function is not.  The
> difference is there only for direct usage of both - when using EXECUTE
> IMMEDIATE you're lost in both cases.
>

Not really: you can still reference your PL/SQL variables with EXECUTE IMMEDIATE - but you need to explicitly bind them yourself (which PL/ SQL does for you automatically with native SQL):

declare
  v sys.dual.dummy%type;
  x sys.dual.dummy%type := 'X';
begin
  execute immediate 'select dummy from sys.dual where dummy=:x'

     INTO v
    USING x;
  dbms_output.put_line(v);
end;
/

Regards,

   Vladimir M. Zakharychev
   N-Networks, makers of Dynamic PSP(tm)    http://www.dynamicpsp.com Received on Wed Feb 25 2009 - 14:39:34 CST

Original text of this message