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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

multiple data in stored procedure parameter

Status
Not open for further replies.

Charming

Programmer
Feb 2, 2001
4
US
Please suggest as to how to solve the following problem.

I have a stored procedure which accepts one STRING value as input parameter.

Crystal prompts me for this correctly. But user can enter only ONE value. Something like Chris or Robert or Alex. The user cannot select Chris and Robert. In essence I cannot get a string something like Chris:Robert assuming ':' as the delimiter.

Anyone has any idea how to get multiple values as input to the stored procedure where I can pass this to the stored procedure ?

If above step is not possible, then does anyone know how to set parameters for stored Procedures from a formula, which can be called when the OK button on the Parameter window is clicked.

-Thanks for your time and attention.
-Narahari.
 
You can pass multiple values as one string to the stored procedute with some delimiter, and break the values in the stored proc. I have done it successfully and my reports work fine.
 
Thanks for the response. I know it can be done inside of stored procedure.

But how do you gather info from Crystal to do that ?

Do I set up a normal parameter and then pass its value to the stored procedure ? If so how ?

-Narahari.
 
Pass the string as Chris;Robert;Alex to the input paramter of the stored procedure.
 
See thats exactly what I dont want to do. If you are the user and have to enter data would you rather have a combo box with the list of your employees first names that you can pick and choose or would you rather enter the employees in the fashion that you have suggested.

-Narahari.
 
Let user select from the list, get all the values and format them as one string...and you know the rest :) You may want to change the style property of listbox to checkbox.
 
Parnini,
How would you accomplish something like the one you have suggested ? Crystal allows you to pick only one value for a stored procedure parameter.

If you choose to do it as a normal parameter, then how do you send data to the stored procedure from the regular parameter that you obtained data from ?

-Narahari.
 
Unless you're willing to let the user type in "Tom, Bob, Sam" as the parameter value to the Crystal parameter, you're out of luck.

The flexible solution is a front-end application in VB, Delphi, etc., where you can build a text string from a multi-select listbox.
 
HELLO "Charming",
Did you solve the problem with multiple parameter values the way you want it? And if you did can you share info PLEASE.
I have the same problem and I don't know what to do about it.
Thank you
 
Did anyone find the solution? How can we pass a multiple value parameter to a stored procedure if one is not using any front end tool. We cannot format the parameter to a single string and passs it to the procedure as crystal doesnot allow that. Please let me know if anyone has the solution.
 
And how do i pass parameters to Oracle Stored Procedure which are multiple range.
Is there any way i can call a subreport from a main report.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top