Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2003
    Location
    India
    Posts
    9

    Arrow Unanswered: Calling stored procedure

    Hai all,


    How do I call a stored procedure from a stored procedure and populate a ref cursor with the results of that call?

    Thanks in advance

    Angu

  2. #2
    Join Date
    Dec 2003
    Location
    Oklahoma, USA
    Posts
    354
    It is very easy to do. As long as you have the string built that you want to execute using the REF CUSOR before you OPEN it, add whatever results from other procedures you want. So you would have something like this:

    Code:
    ...
    my_var := my_Function();
    
    my_sql_var := 'SELECT something, ' || my_var || ' FROM my_table';
    
    OPEN my_cur FOR my_sql_var;
    LOOP
       FETCH my_cur INTO ...
    END LOOP;
    CLOSE my_cur;
    JoeB

Posting Permissions

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