Calling function in Dynamic sql
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: Calling function in Dynamic sql

  1. #1
    Join Date
    Apr 2002
    Posts
    135

    Calling function in Dynamic sql

    hi all,

    using dynamic sql i want to call a function returning a number


    help please
    Good Judgement comes from Experience.
    Experience comes from Bad Judgement

  2. #2
    Join Date
    Apr 2001
    Location
    Czechia
    Posts
    712
    Code:
    scott@oracle> create or replace function twice(a in number) return number
      2  as
      3  begin
      4    return (a*2);
      5  end;
      6  /
    
    Function created.
    
    scott@oracle> declare
      2  b number;
      3  begin
      4    execute immediate 'begin :b:=twice(7); end;' using out b;
      5    dbms_output.put_line(b);
      6  end;
      7  /
    14
    
    PL/SQL procedure successfully completed.
    See http://download-west.oracle.com/docs...ynam.htm#13131
    Ales
    The whole difference between a little boy and an adult man is the price of toys

  3. #3
    Join Date
    Apr 2002
    Posts
    135
    here is another one that i got after posting

    declare
    i number(10);
    begin
    execute immediate 'select twice(7) from dual' into i;
    end;
    /
    Good Judgement comes from Experience.
    Experience comes from Bad Judgement

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width