Thursday, April 2, 2009

Execute stored procedure or function in TOAD

Question:
How do you execute a stored procedure or function and display the result in TOAD?

Answer:
Navigate to the sp or function in schema browser and highlight it. There is a thunder button "Execute Procedure" up there. Click on it to bring up the dialog where you can provide input parameters.

To see output, you need to do things. First, . First, open a output window by View > DBMS Ouput. Second, in the execute dialog, click "Output Options" link and check "Print OUT arguments/RETURN values to DBMS Output". Now the result will be disaplyed in the DBMS Ouput window after you click OK to execute the sp or function.

2 comments:

  1. Thank you SO much for providing this answer. I have been pulling my hair out trying to view DBMS output from a stored procedure in TOAD. Thank you again for creating this page! Avern

    ReplyDelete
  2. DECLARE
    CUR_REC SYS_REFCURSOR;
    CUR_REC_row CUR_REC%ROWTYPE;

    BEGIN
    -- CUR_REC := NULL; Modify the code to initialize this parameter

    HR.USP_GRADE_COMBOFILL ( CUR_REC );

    -- Unable to resolve fields for REF CURSOR CUR_REC

    COMMIT;
    END;


    i get error

    11:43:51 Error: ORA-06550: line 3, column 15:
    PLS-00320: the declaration of the type of this expression is incomplete or malformed
    ORA-06550: line 3, column 15:
    PL/SQL: Item ignored

    ReplyDelete