Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2003
    Posts
    3

    Cool Unanswered: executing a function dynamically

    Hi All,
    I have to execute a pl/sql function. The function is returning a ref cursor. But the function name will be known only at the runtime i.e. i have to execute using dynamic sql. The dynamic sql string will be like following.........

    vc_str:='begin ' ||
    ':x :=' || variable_containing_function_name || ';' ||
    'end;';

    What i want to do is execute the function and get thereturn value in host variable x.

    The function is returning ref cursor. So i am not able to use dbms_sql. Since dbms_sql.bind_variable can not bind a ref cursor.

    Any idea how to achieve this.
    regds,
    Bhaskar

  2. #2
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1

    Re: executing a function dynamically

    You can so this with NDS instead of DBMS_SQL:

    execute immediate vc_str using out v_rc;

    where v_rc is a ref cursor variable.

Posting Permissions

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