Jump to content
We've recently updated our Privacy Statement, available here ×
  • MULTIPLE RESULT SET FROM SQL SERVER STORED PROCEDURE


    naikniket.31
    • Version: v7 Product: Jaspersoft® Studio

     I am at a learning phase for Jasper reports. I am using SQL Server & Stored Procedures to create a jasper report. I have created a stored procedure that returns multiple results sets. Please check the below code,

     SET ANSI_NULLS ON
    GO
    
    SET QUOTED_IDENTIFIER ON
    GO
    
    CREATE PROCEDURE [dbo].[usp_test]
       
    AS
    BEGIN
    SET NOCOUNT ON;
         SELECT * FROM MEMBER WHERE ID =1;
         SELECT * FROM MEMBER_DTL WHERE FK_MEMBER = 1;
         SELECT * FROM MEMBER_BANK_DTL WHERE FK_MEMBER=1;
         
    
    END
    GO
    

    Now, when I execute the stored procedure using EXEC usp_test  into the query pane, it only generates fields from the first result set. I  don't want to create sub reports(if possible as there will be more than 10 results sets sometimes and also when I will create a subreport then also it will generate the same fields from 1st result set which is not feasible).  So, how can I generate multiple datasets from these result sets and display them one by one whenever I needed. 


    User Feedback

    Recommended Comments

    There are no comments to display.



    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

×
×
  • Create New...