Skip to Main Content

SQL Developer

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to execute/run a Stored Procedure within a package with a cursor?

3145368Mar 7 2017 — edited Mar 9 2017

Hello

I'm a relative newbie to Oracle and need to run/execute a Stored Procedure within a package within a SQL Developer worksheet (not from a 3rd party app).  I know how to run it in MS SQL.  For example, if I were to run a Procedure in SQL MGMT STUDIO, I would simply enter the following syntax:

Exec [Stored Procedure name] [parameter1] , [parameter2]

Let's say I have the following Procedure in Oracle:

PROCEDURE FetchSomething( vCursor OUT T_Cur, vReportDate IN VARCHAR2 )

    AS

        vMonthEnd     DATE         := LAST_DAY( TO_DATE( vReportDate, 'MON-YYYY' ) );

        vMonthStart   DATE         := ADD_MONTHS( LAST_DAY( TO_DATE( vReportDate, 'MON-YYYY' ) ), -1 ) + 1;

        Something   NUMBER(15,2) := BigPkg.FetchTotalSomething( vMonthStart, vMonthEnd );

    BEGIN

        OPEN vCursor FOR

        SELECT

         blah blah

        FROM

            DUAL;

    END;

What is the syntax to run the above?  (IN SQL DEVELOPER)... Reason is that when we ran a Crystal report that queries this Stored Procedure, we got an error and we need to troubleshoot further.

thx!

This post has been answered by Peter vd Zwan on Mar 9 2017
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 6 2017
Added on Mar 7 2017
21 comments
33,611 views