IBM Database Add-Ins for Visual Studio  

Defining Result Sets for SQL and SPL Procedures

With the IBM® Database Add-Ins for Visual Studio, you can view the result sets for an SQL or SPL procedure and define new result sets. A result set is the set of rows that an SQL or SPL procedure returns for a SELECT statement. You can either discover result set definitions by specifying values for the input values, or you manually define a result set and its columns.

For an IDS database Defining result sets for overloaded procedures that are based on data type produces undefined results.

To define a result set for an SQL or SPL procedure:

  1. In the Server Explorer under your IBM data connection, right-click the procedure, and then select Open Result Set Definition on the shortcut menu.

    The Result Set Definitions window opens.

  2. Optional: Discover a result set.
    1. Click Discover.

      The Run Options window opens.

    2. Specify the values for the input parameters of the result set that you want to discover.
    3. Click Discover.

      The Run Options window closes and the result set for the input parameter values that you specified is shown in the Result set definitions tree.

  3. Optional: Define a result set manually.
    1. Select the Result set definitions node in the tree, and then click Add.

      A new result set is added to the tree.

    2. Add columns to the new result set. With the new result set selected in the tree, do one or both of the following steps:
      • Click Import to open the Import window, where you can select the columns that you want to add to the result set.
      • Click Add to add a new column to the result set, and then specify values for the properties of the column in the Result set definition properties grid.
  4. Optional: Delete a result set or a column. Select it in the Result set definitions tree, and then click Remove.
  5. Optional: Change the order of the result sets or the columns in a result set. Select a result set or a column in a result set and then click Move Up or Move Down repeatedly until the result set or the column is ordered in the position that you want.
  6. Click OK.

See Also

Managing Procedures, Functions, and Objects | Developing IBM Database SQL and SPL Procedures


.NET Development Forum   DB2 FAQs   IDS FAQs

© Copyright IBM Corporation 2002, 2019. All Rights Reserved.