DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: Calling a stored procedure through a view/query/etc

  1. #1
    Join Date
    Aug 2005
    Posts
    1

    Question Calling a stored procedure through a view/query/etc

    Hello!

    I'm using Crytal Reports to generate reports out of our Oracle-backed app. The problem that I've run into is that one of our stored procedures needs to be executed before a particular report will return accurate data.

    Typically, one would simply configure Crystal Reports to execute the query. Unfortunately, due to special circumstances (or a misconfiguration), this is not possible.

    I need to execute the stored procedure indirectly, via a view, query, or something else. Thanks for any suggestions!

    -Rich

  2. #2
    Join Date
    Aug 2002
    Location
    Colorado Springs
    Posts
    5,253
    David Aldridge,
    "The Oracle Sponge"

    Senior Manager, Business Intelligence Development
    XM Satellite Radio
    Washington, DC

    Oracle ACE

  3. #3
    Join Date
    Feb 2005
    Posts
    158
    A stored proceudre cannot be called from a SELECT, but a function can be.
    Wrap your stored procedure in a dummy function and a
    SELECT dummy FROM dual will execute it.
    Almost certainly you'll need to define the function as an AUTONOMOUS_TRANSACTION since otherwise Oracle wouldn't allow any stored procedure called by it to update the database.

    FUNCTION dummy RETURN VARCHAR2 IS
    PRAGMA AUTONOMOUS_TRANSACTION;
    BEGIN
    procedure_call_here;
    COMMIT;
    RETURN NULL;
    END dummy;

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