Hi All,
CR8.5, SQL2k
I've been using CR for about 2 years using tables and views. But I've never used a SP as a data source.
I have a performance issue with a report that needs a parameter passed to a subquery. Subreports are too slow, I don't believe its possible to use a view because of the parameter, so that leaves a SP.
the query is someting like
Select itemno, qty from tblItem t1 left outer join (select ItemNo, qty from tblTransaction t2 where trandate >=PARAMATERDate1 and trandate <=PARAMETERDate2) t3 on t1.itemno = t3.itemno
anyway..
1) How do you avoid for the SP promting for values. Ideally I want the std CR prompts to pass the values to the SP. How is this possible?
2) If a parameter has multi values, how do you pass it to a parameter in the SP. (I'm dreading that a csv string will need to be passed to the sp(assuming question 1 is possible), and then the sp will need to unpack the string. Does anyone have any example on how to do it?
How do you pass a multi value paramter in CR to the SP?
here is a test sp that I am learning on ...
Create sp_Test @minItem varchar(10), @minItem Varchar(10) as
select ItemNo from ItemMaster
where ItemNo>=@minItem and ItemNo<=@maxItem
Any other tips on SP's?
ta
Fred
CR8.5, SQL2k
I've been using CR for about 2 years using tables and views. But I've never used a SP as a data source.
I have a performance issue with a report that needs a parameter passed to a subquery. Subreports are too slow, I don't believe its possible to use a view because of the parameter, so that leaves a SP.
the query is someting like
Select itemno, qty from tblItem t1 left outer join (select ItemNo, qty from tblTransaction t2 where trandate >=PARAMATERDate1 and trandate <=PARAMETERDate2) t3 on t1.itemno = t3.itemno
anyway..
1) How do you avoid for the SP promting for values. Ideally I want the std CR prompts to pass the values to the SP. How is this possible?
2) If a parameter has multi values, how do you pass it to a parameter in the SP. (I'm dreading that a csv string will need to be passed to the sp(assuming question 1 is possible), and then the sp will need to unpack the string. Does anyone have any example on how to do it?
How do you pass a multi value paramter in CR to the SP?
here is a test sp that I am learning on ...
Create sp_Test @minItem varchar(10), @minItem Varchar(10) as
select ItemNo from ItemMaster
where ItemNo>=@minItem and ItemNo<=@maxItem
Any other tips on SP's?
ta
Fred