Lesson 3: Run a stored procedure

In this lesson, you will learn how to use Sybase WorkSpace to run (execute) a stored procedure for an Adaptive Server Enterprise server database.�

NoteBefore you can complete this tutorial, you must create the play_proc stored procedure, as described in the previous lesson, “Lesson 2: Create a stored procedure”.

  1. If necessary, select Window|Open Perspective|Database Development from the main menu bar to open the Database Development perspective.

  2. In the Database Explorer view, open the Procedures & Functions folder under the appropriate sample database.

    Look for the play_proc stored procedure that you created in the previous tutorial, “Lesson 2: Create a stored procedure”. You can run the stored procedure in one of two ways:

    Once you run the stored procedure, the Configure Parameters dialog box displays.

    Next, enter the values for the stored procedure invocation.

  3. Enter any values you like for the stored procedure invocation.

    Enter values the first time you run a stored procedure. On subsequent runs, you can use the values you previously entered or enter new values.

  4. Click OK to run the procedure.

    Sybase WorkSpace executes the stored procedure and places the results in the SQL Results view.

    Click the Result History line in the left pane of the SQL Results view to display the results in the right pane.

  5. Review the different tables and results that the stored procedure returns in the the SQL Results view.

  6. Select File|Close on the main menu bar to close the SQL Editor.

    You can easily make changes to the stored procedure and save it back to the server.