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!

How to pass a multiple value paramter to an Oracle stored procedure 1

Status
Not open for further replies.

sathipatla

Programmer
Jul 26, 2002
7
US
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 ?

I know this can be done if one is using a front end tool by building a string from the paramter. But can this be done directly from Crystal?

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.
.
 
This is a way to convert a multiple selection parameter to a concatenated string which you can pass to your stored procedure:

Create a dummy main report which uses a one-record data set (anything simple will do). Create a multiple-selection parameter for this report. Add a formula in the report header which concatenates the multiple parameter values -- they are in an array -- into a string with any delimiter you choose (you can use the "Join" function).

Import your original report into the dummy report, in a section below the formula. Use the formula as "Field to link to" and link it to the stored-procedure parameter in the "Subreport Links" dialog. Be sure to click on the dropdown arrow in the "Subreport parameter field" box and scroll to find the true stored-proc parameter and NOT the new parameter CR wants to put in for you!

Page headers in the imported subreport will be converted to print-once report headers. You can probaby move the original page headers from the subreport into the dummy report and suppress the rest of the dummy report.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top