Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Stored Procedure with Multiple Selects!

Hi,

I have a stored procedure that will return some selects.

When I use this code:

TableName:
SQL
EXEC [sp_name];

It will load the first select of the procedure into the TableName table.

But I have another select on the procedure, how can I associate the other select to another table into qlikview?

BR,

Cassiano Sanches

3 Replies
danielrozental
Master II
Master II

Hi Cassiano, did you ever got this to work?

Not applicable
Author

SP's can return multiple result sets, but the receiver must be able to get them. So:

1. Join the result sets, if their structure is identical

2. Create a separate SP for the second result set

Not applicable
Author

Hi Cassiano,

I had the same issue this week with a project. My solution is to extend your stored procedures with a parameter and let every Select statement react to a certain value of that parameter. In your QV code you should build a table for every Select statement within your stored procedure. Next to that you have to extend the EXEC part with the parameter value it has to react to.

E.g.:

Table1:

SQL

EXEC [dbo].[SP.Name] @parameter = 'Value1'

Table2:

SQL

EXEC [dbo].[SP.Name] @parameter = 'Value2'