Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing Parameters Into Stored Procedure

Status
Not open for further replies.

obryant32

IS-IT--Management
Feb 20, 2003
66
US
I'm extremely new to this...

So, I have some programmers here who developed a stored procedure that essentially pulls all the data that I need for my report. However, they've put into the SP some date parameters. When I go to add the SP to my report, it's asking me to enter the paramters. I'm not exactly sure what to do. I want to set up the report and then enter the parameters when I run it. Shouldn't it wait to ask for the paramters instead of asking me to enter the values right off the bat? Not sure how to do this. Any help is appreciated. Thanks

Matt
 
You are getting prompted for this once in the beginning so that it can make sure that the SP will run successfully, and return a valid set of records. You will still be able to enter different dates when you refresh the report.

~Brian
 
With Stored Procedures, you lose control of the parameters. When the data source is added to the report, Crystal must run it to determine that it's a valid data source, hence the prompt.

Another approach is to use a View, which will allow you a bit more flexibility over the parameters.

The advantage to a Stored Procedure in reporting can be minimal if the majority of the time is based on querying the database as an SP simply buys you a pre-compiled Execution Plan.

If the coders used advanced SP functionality (such as a cursor), this isn't a viable alternative.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top