Stored procedure parameter for in condition

Hi,
Is it possible to use a parameter for the following where Parameter should have a list of ids separated by commas and contained with in parenthesis..
Select * from table
where id in Parameter
If so, what should be the type for the Parameter variable ? because in parameter expects a number but our value should be 1,2,3 contained with in parenthesis
Select * from table
where id in (1,2,3)
Thanks,
RM

Consider inserting your list of IDs into a table.
Then you can do: WHERE id IN (select id from your table)

Similar Messages

  • Stored Procedure parameter (@Carrier) used in report and can't be set via code

    I have a report that has regular Crystal parameters that I am setting correctly via code.  However, one report actually uses one of the database parameters from the stored procedure that the report was created from.  It is the only report like this and I'm using the same code in an attempt to set it's value.  Although no error is thown, if I look at the parameter value in the IDE it is set correctly, but the field on the report just shows up blank.  I have changed the way the report is created.  Previously, I used the report.export method to create the actual file via a stored procedure.  Now, I'm running the stored procedure first and creating a datatable.  This allows me to execute the SP only once to see if it has data, because only then do I want to create the actual report.  I'm using the SetDataSource method to pass the datatable into Crystal and then using the report.export method to create the report with data.  Everything seems to work, except this stored procedure parameter (@Carrier) is not actually being populated to display on the report.
    Not sure what to look at.  Any suggestions?
    Thanks.

    crpe32.dll is version 13.0.5.891.  This was developed in VS2012 and VB.NET.  I'm using ADO.Net to connect to a MS SQL Server database.
    MainReport.SetDataSource(DTbl)
    bRC = PopulateAllSubReports(MainReport)
    If Not bRC Then Throw New Exception("Received an error in PopulateAllSubReports.")
    bRC = PopulateCrystalParameters(MainReport, SP)
    If Not bRC Then Throw New Exception("Received an error in PopulateCrystalParameters.")
    'Actually create the output file.
    bRC = ExportData(MainReport)
    Private Function PopulateCrystalParameters(myReportDocument As ReportDocument, SP As ReportStoredProcedureCrystal) As Boolean
         Dim myParameterFieldDefinitions As ParameterFieldDefinitions = Nothing
         Dim myParameterFieldDefinition As ParameterFieldDefinition = Nothing, ParamValue As String = ""
         Dim bRC As Boolean, Param As SqlParameter = Nothing
         Try
         myParameterFieldDefinitions = myReportDocument.DataDefinition.ParameterFields
    '*********************Report Parameters***************************
         For Each myParameterFieldDefinition In myParameterFieldDefinitions
              myParameterFieldDefinition.CurrentValues.Clear()
              Select Case myParameterFieldDefinition.ParameterFieldName.Trim.ToUpper
              Case "@CARRIER"
                   If SP.DBParameters.ContainsKey("@CARRIER") Then
                        Param = SP.DBParameters("@CARRIER")
                        ParamValue = NullS(Param.Value).Trim
                        bRC = SetCurrentValueForParameterField(myParameterFieldDefinition, ParamValue)
                        If Not bRC Then Return False
                   End If                           
              End Select
         Next
         Return True
         Catch ex As Exception
         GmcLog.Error("ReportKey = " & Me.ReportKey.ToString & ", " & ex.Message, ex)
         Return False
         End Try
    End Function
    Private Function SetCurrentValueForParameterField(myParameterFieldDefinition As ParameterFieldDefinition, submittedValue As Object) As Boolean
         Dim currentParameterValues As ParameterValues = Nothing
         Dim myParameterDiscreteValue As ParameterDiscreteValue = Nothing
         Try
         myParameterDiscreteValue = New ParameterDiscreteValue
         myParameterDiscreteValue.Value = NullS(submittedValue).Trim
         currentParameterValues = New ParameterValues
         currentParameterValues.Add(myParameterDiscreteValue)
         myParameterFieldDefinition.ApplyCurrentValues(currentParameterValues)
         Return True
         Catch ex As Exception
         GmcLog.Error("ReportKey = " & Me.ReportKey.ToString & ", " & ex.Message, ex)
         Return False
         Finally
         myParameterDiscreteValue = Nothing
         currentParameterValues = Nothing
         End Try
    End Function
    Private Function SetDBSourceForSubReport(mySubReport As ReportDocument) As Boolean
         Dim myTables As Tables = Nothing, myTable As Table = Nothing, DTbl As DataTable, SP As StoredProcedure = Nothing
         Try
         myTables = mySubReport.Database.Tables
         For Each myTable In myTables
              Dim SPName As String = myTable.Location.Substring(0, myTable.Location.IndexOf(";"c))
              SP = New StoredProcedure(ConnectionString, SPName, CommandType.StoredProcedure)
              DTbl = SP.FillTable
              mySubReport.SetDataSource(DTbl)
              SP = Nothing
         Next
         Return True
         Catch ex As Exception
         GmcLog.Error("ReportKey = " & Me.ReportKey.ToString & ", " & ex.Message, ex)
         Return False
         Finally
         If Not SP Is Nothing Then SP = Nothing
         If Not myTable Is Nothing Then myTable = Nothing
         If Not myTables Is Nothing Then myTables = Nothing
         End Try
    End Function
    Private Function PopulateAllSubReports(myReportDocument As ReportDocument) As Boolean
         Try
         Dim mySections As Sections = myReportDocument.ReportDefinition.Sections
         For Each mySection As Section In mySections
              Dim myReportObjects As ReportObjects = mySection.ReportObjects
              For Each myReportObject As ReportObject In myReportObjects
                   If myReportObject.Kind = ReportObjectKind.SubreportObject Then
                        Dim mySubreportObject As SubreportObject = CType(myReportObject, SubreportObject)
                        Dim subReportDocument As ReportDocument = mySubreportObject.OpenSubreport(mySubreportObject.SubreportName)
                        Dim bRC = SetDBSourceForSubReport(subReportDocument)
                        If Not bRC Then Return False
                   End If
              Next
         Next
         Return True
         Catch ex As Exception
         GmcLog.Error("ReportKey = " & Me.ReportKey.ToString & ", " & ex.Message, ex)
         Return False
         End Try
    End Function

  • Pivot table that uses a Stored Procedure parameter and filters the data based on it

    Hello, my 1st post.  I am lost.  Please help.
    I am trying to create an Excel Pivot Table that has data that comes from an ODC but needs to be filtered based on a parameter from a Stored Procedure.  This involves Project Server.  I need to filter the results based on the RBS value of the logged
    in user.  My Stored Procedure can return the RBS as long as the ResourceNTAccount value is given.  I cant figure out how to tie this all together.

    Hi,
    Based on your description,I think this issue should be  more related to Programming/coding, you can sumbit a new case to MSDN forum.
    As I'm not quite formular with Project Server, all I can tell you is that it is easy to running a Stored Procedure within Excel, however, if you have to pass dynamic parameters you’ll have to turn to VBA.For detailed information,please refer
    to:
    http://blogs.office.com/2010/06/07/running-a-sql-stored-procedure-from-excel-no-vba/
    Wind Zhang
    TechNet Community Support

  • Pass unicode data in SQL Server 2008 stored procedure parameter

    Hi,
    I want to pass unicode data in a SQL stored procedure. But I am not sure that how to append N with NVarchar datatype.
    For example I Create a table LocalizationTest and wants to insert a few records.
    Create table LocalizationTest
        Field1 NVarchar(255)
    INSERT INTO LocalizationTest
    VALUES(N'123 Illini Dr, 東皮奧里亞, 8989')
    the above given statement works.
    To explain it more , script A works but script B does not work.
    DECLARE @X NVARCHAR(255)
    [A]
    SET @X=N '123 Illini Dr, 東皮奧里亞, 8989'
    INSERT INTO LocalizationTest
    VALUES(@X)
    [B]
    SET @X= '123 Illini Dr, 東皮奧里亞, 8989'
    INSERT INTO LocalizationTest
    VALUES(@X)
    What is the correct way to execute script B because @X will be passed in a SQL Stored Procedure?
    Thanks
    Sharma M.

    If you do not pass the value as a Unicode value there is nothing left of the Unicode characters but question marks. Once this has happened, AFAIK there is no way to undo it (other than resetting the value as Unicode characters again).
    Affirmative.
    Demo - This is what happens if you convert UNICODE (nvarchar) to varchar with implicit conversion (try to force 2 bytes into one byte).
    3F hex is '?'.
    CREATE TABLE #LocalizationTest (Field1 VARCHAR(255))
    INSERT INTO #LocalizationTest
    VALUES(N'123 Illini Dr, 東皮奧里亞, 8989')
    DECLARE @X NVARCHAR(255), @dSQL NVARCHAR(MAX)
    SET @X=N'123 Illini Dr, 東皮奧里亞, 8989'
    INSERT INTO #LocalizationTest VALUES(CONVERT(NVARCHAR(255),@X))
    SET @dSQL = N'INSERT INTO #LocalizationTest VALUES(N'''+@X+''')'
    PRINT @dSQL
    EXEC sp_ExecuteSQL @dSQL
    SELECT *, Field1Bin=convert(binary(30), Field1) FROM #LocalizationTest
    DROP TABLE #LocalizationTest
    123 Illini Dr, ?????, 8989 0x31323320496C6C696E692044722C203F3F3F3F3F2C203839383900000000
    123 Illini Dr, ?????, 8989 0x31323320496C6C696E692044722C203F3F3F3F3F2C203839383900000000
    123 Illini Dr, ?????, 8989 0x31323320496C6C696E692044722C203F3F3F3F3F2C203839383900000000
    Kalman Toth Database & OLAP Architect
    SQL Server 2014 Design & Programming
    New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

  • JDev 9.0.3 can't generate stored procedure wrapper for ARRAY java type

    Hi,
    I have a java stored procedure which looks like this:
    public static void CurveFit(ARRAY in_x_y, ARRAY[] in_out_param) {
    I had no problem to generate a PL/SQL wrapper using JDev 3.2 mapping the ARRAY parameters to user-defined Oracle types. Here is the code JDev 3.2 generated:
    PROCEDURE curvefit(in_x_y IN fit_data, in_out_param IN OUT fit_params) AS
    LANGUAGE JAVA
    NAME 'CurveFitWrapper.CurveFit(oracle.sql.ARRAY, oracle.sql.ARRAY[])';
    Now I use JDev 9.0.3, but it refuses to add my function to the deployment profile. "Why not?" gives the following explanation: "Parameter #1 is of type oracle.sql.ARRAY which doesn't map to any PL/SQL data type". That's wrong! If I create the wrapper myself it works just fine.
    How to get around this situation? I don't want to go back to JDev 3.2...
    Regards,
    Plamen

    I have tried a disconnect/reconnect from within Jdev without success. First, I have to choose "disconnect" twice from the file->source control menu. (The first time I click it does nothing). Then during reconnect I choose my SCM connection, then I choose my workarea and get a pop up that says, "Failed to set my_workarea as the active workarea". I click "OK". Choose my workarea again and get another popup that is blank. Then I click "OK". Now I see a list of SCM connections. I keep getting the blank popup until I hit cancel. Now the overlay icons appear and it seems that I am in fact connected. But I still get the checkin/checkout exceptions. So I have to restart Jdev to get back to normal.
    I also tried executing the sql in the exception from SQL*Plus and it works perfectly.

  • Printing Stored Procedure, etc for SQL Developer

    Hi
    I've run into some issues trying to print stored procedure or package code from SQL Developer.
    1) The text printout comes out in enlarged font (size 20+)
    2) The printout does not completely print all code - only 1 page regardless if it fits to one page or not.
    I am running on Windows 2000 Service Pack 4. Printing to a HP Laser Jet 5M.
    Is anyone else have the same problems when printing?
    Thanks in advance.

    We do have an issue with printing. It is contained in our Release Notes -
    "Print prints only one page that is a truncation of the current tab."
    I would suggest saving to a file and printing from there for now -
    -- Sharon

  • GRPO Stored Procedure Block for Cost Discrepancy

    Dear Experts,
    I am in the process of writing a stored procedure to block a GRPO from posting if one of the items' prices has a 30% discrepancy on item cost.
    I couldn't use AvgPrice as the value in the table considers the transaction being processed. What I am trying to do is compare the price with the previous GRPO's price done for this item.
    Any other suggestions would be great.
    Now this works fine until I add a second item on the document or even the same item twice. It will only apply block to item on first row.
    SP will only block first row in example below:
    #1 Item A 50.00
    #2 Item B 100.00
    #3 Item A 10.00
    I was wondering how the block can look at the individual lines, alternatively has anyone done something similar that can help me.
    Query:
    --Block Goods Receipt PO with 30% Price Discrepancy
    declare @item nvarchar(255)
    select @item = NULL
    IF @TRANSACTION_TYPE = 'A' AND @OBJECT_TYPE = '20'
    BEGIN
    Select @item = A.ItemCode
    From
                   (SELECT 'itemcode' =
                        CASE --greater than
                             When (((T1.Price -
                                       --fetch prev price
                                       (SELECT max(b.price)
                                       from opdn a inner join pdn1 b on a.DocEntry = b.docentry
                                       where b.ItemCode = T1.itemcode AND
                                       a.DocNum =
                                       (SELECT MAX(a1.Docnum) from OPDN a1 inner join PDN1 b1 on a1.DocEntry = b1.DocEntry
                                       WHERE b1.ItemCode = b.ItemCode
                                       AND a1.docnum <
                                                 (SELECT MAX(a2.Docnum) from OPDN a2 inner join PDN1 b2 on a2.DocEntry = b2.DocEntry
                                                 WHERE b2.ItemCode = b1.ItemCode)
                                       --##fetch prev price     
                                       --fetch prev price
                                       (SELECT max(b.price)
                                       from opdn a inner join pdn1 b on a.DocEntry = b.docentry
                                       where b.ItemCode = T1.Itemcode AND
                                       a.DocNum =
                                            (SELECT MAX(a1.Docnum) from OPDN a1 inner join PDN1 b1 on a1.DocEntry = b1.DocEntry
                                            WHERE b1.ItemCode = b.ItemCode
                                            AND a1.DocNum < (
                                            (SELECT MAX(a2.Docnum) from OPDN a2 inner join PDN1 b2 on a2.DocEntry = b2.DocEntry
                                                 WHERE b2.ItemCode = b1.ItemCode)
                                       --##fetch prev price     
                                       ) * 100) >= 30
                                  Then T1.ItemCode
                                  --smaller than
                                  When (((T1.Price -
                                       --fetch prev price
                                       (SELECT max(b.price)
                                       from opdn a inner join pdn1 b on a.DocEntry = b.docentry
                                       where b.ItemCode = T1.itemcode AND
                                       a.DocNum =
                                       (SELECT MAX(a1.Docnum) from OPDN a1 inner join PDN1 b1 on a1.DocEntry = b1.DocEntry
                                       WHERE b1.ItemCode = b.ItemCode
                                       AND a1.docnum <
                                                 (SELECT MAX(a2.Docnum) from OPDN a2 inner join PDN1 b2 on a2.DocEntry = b2.DocEntry
                                                 WHERE b2.ItemCode = b1.ItemCode)
                                       --##fetch prev price     
                                       --fetch prev price
                                       (SELECT max(b.price)
                                       from opdn a inner join pdn1 b on a.DocEntry = b.docentry
                                       where b.ItemCode = T1.Itemcode AND
                                       a.DocNum =
                                            (SELECT MAX(a1.Docnum) from OPDN a1 inner join PDN1 b1 on a1.DocEntry = b1.DocEntry
                                            WHERE b1.ItemCode = b.ItemCode
                                            AND a1.DocNum < (
                                            (SELECT MAX(a2.Docnum) from OPDN a2 inner join PDN1 b2 on a2.DocEntry = b2.DocEntry
                                                 WHERE b2.ItemCode = b1.ItemCode)
                                       --##fetch prev price     
                                       ) * 100) <= -30
                                  Then T1.ItemCode
                                  end
                        FROM [DBO].[OPDN] T0 INNER JOIN [DBO].[PDN1] T1 ON T0.DocEntry = T1.DocEntry INNER JOIN OITM T2 on T1.ItemCode = T2.Itemcode     
                        --AND NOT T0.UserSign = 1 --Manager
                        AND T1.DOCENTRY = @LIST_OF_COLS_VAL_TAB_DEL) A
    IF EXISTS
    (Select @item where @item is not NULL)
         BEGIN
              SELECT @ERROR = 2, @ERROR_MESSAGE = 'Price Discrepancy too large. Please check item:' + ' ' + @item
         END
    END
    Thanks,
    Adriaan

    That's a really tough form to create.
    Here's a couple of dynamic forms you can try out:
    By Francois Degrelle:   "DYNAMIC_FORM.fmb".
    And my old dynamic matrix Form is here:   QA: Quick Access  An Oracle Forms dynamic utility form

  • PL/SQL Stored Procedure Parameter - structured XmlType - possible?

    [Posting here as recommended in another forum]
    Hi,
    Is it possible to have an SP parameter that is of XMLType - and refers to a registered XSD schema for validation? If it is possible, can someone point me to a sample?
    Thanks so much!
    MG

    Already replied on the other forum ;)
    Max
    [My Italian Oracle blog|http://oracleitalia.wordpress.com/2010/01/23/la-forza-del-foglio-di-calcolo-in-una-query-la-clausola-model/]

  • Does OraOLEDB support passing a Ref Cursor as an IN parameter of a Stored Procedure?

    We have a number of Stored Procedures that take a Cursor as an input parameter. Is it possible to call a Stored Procedure of this type with OraOLEDB? If so could you provide a quick sample using VC++/ATL?
    Thanks...

    Thank you for your reply, Yuancai. It would be very useful if the OLE DB team added such an interface to future versions of TCommand. However, for the time being what is the preferred technique for passing large amounts of data to a stored procedure? For instance we have a number of tables that have fifty or more columns. It would be awkward to call a stored procedure with this many parameters. Ideally, one would want to create a structure as a User Defined Type and pass that as a parameter.
    One approach we though of was to pass a XML string though a CLOB parameter and parse it in either a PL/SQL or Java stored procedure. However, while this approach is novel it is not standard. I've found it best to use standard techniques where possible. Any insight you could give would be appreciated.
    Thanks,
    Bryan Wood

  • Using Stored Procedure w/Parameter and adding another parameter via CR

    I have a situation where I am using a SQL Stored Procedure that contains one Date Parameter. 
    I am pulling that Stored Procedure fwd into a Crystal Report, but as soon as I add another Parameter via Crystal Reports (in addition to the Parameter that was pulled fwd from the Stored Procedure) Two parameters prompts now appear for the Stored Procedure Parameter.
    I need to have the Crystal Report display the Stored Procedure Parameter only once.

    I have a Parameter within the SP that is for a Date entry.  So I pass the SP Parameter through the Command to CR.
    Then I have added some other Parameters that I have the users populating but they are only used in formulas and I donu2019t have those in the Select Records.
    Then I add another Parameter that would be for Supplier Selection.  As soon as I add this 4th Parameter for the Supplier Select within the Select Record, is when I then encounter the duplicate display of the SP Parameter.
    The first prompt is a Date field but for some reason is displaying in the Right hand corner SUPNAME (which is my Supplier Name field)  Then the next set of Parameters display is properly showing in the right hand corner all of my actually Parameters.
    Why would the first occurrence be associated with the Supplier Name? 
    I have tried adding a Supplier parameter to the SP itself, but then I am limited to a single entry, it will not allow me to set it to Multiple Values. 
    Any additional suggestions or information would be greatly appreciated.

  • Passing Multi-Value Parameter to a Stored Procedure

    Has anyone experienced passing a Parameter (MultiValue) to a Stored Procedure? I am aware that Crystal Passes the Param as an Array. How would you go about handling this within a Stored Procedure???

    Hi Daniel
    Try as below:
    1. Create a Crystal report, and add a multi-value parameter.
    2. Since the multi-value parameter is treated as an array, create a formula that uses the JOIN function. Create a formula as below:
    //Formula: @JoinFormula
    Join ({?Multi-value parameter array},";")
    ====================
    NOTE:
    In the formula above, a semi-colon (";") is the delimiter.
    ====================
    3. Within the main report, create a subreport based on the stored procedure, and include the parameter to be populated with the multi-value list.
    4. Link the Join formula in the main report to the stored procedure parameter in the subreport.
    Doing so passes a multi-value parameter to the stored procedure.
    Hope this helps!!!!
    Regards
    Sourashree

  • Stored Procedure call from JDBC sender for Oracle Database

    Hi,
    I have a requirement to call stored procedure using JDBC sender adapter for retriving data from an Oracle database.
    I need to execute first stored procedure call from Querry SQL statement and then trigger second stored procedure call for confirming the succesful retrival of those records from the update SQL statement.
    Querries:
    1. Can we trigger stored procedure from Update statement of JDBC sender.
    2. Can we call stored procedure from Querry statement, since I have read on other sdn threads that stored procedure calls on Oracle database are not allowed. If not possible to have "Execute stored procedure" would the function call (select * from table(function name)) work same as stored procedure.
    3. In a JDBC sender the Querry statement and Update statement are executed in same session call and same database connection. What happens if the querry statement was not succesful, would the update be still triggered.
    Please note PI does not have direct access to main table and hence the need to have separate stored procedure calls.
    The PI version is PI 7.11 sp4.
    Appreciate your inputs.
    Thanks.
    Siddhesh S.Tawate

    >1. Can we trigger stored procedure from Update statement of JDBC sender.
    I think not possible using update statement.
    > Can we call stored procedure from Querry statement, since I have read on other sdn threads that stored procedure calls on Oracle database are not allowed. If not possible to have "Execute stored procedure" would the function call (select * from table(function name)) work same as stored procedure.
    Yes using select query you can call stored procedure.
    >. In a JDBC sender the Querry statement and Update statement are executed in same session call and same database connection. What happens if the querry statement was not succesful, would the update be still triggered.
    No select and update handles in the same session using the same thread so if one transaction fails update should not proceed.

  • Stored Procedures (what is it really used for?)

    So from a tutorial, I successfully created a stored procedure, stored it, and made code to use it. I think.
    If I run my code, it seems to work fine, regardless of whether or not I have entered that stored procedure into the database.
    Is my code suppose to work regardless? Is storing a procedure just meant to make my code, which repeats quite often, more efficient? Or are stored procedures created for different reasons? Are they there to let me run my java code from an sql query? I'm at my wits end trying to understand the significance of a stored procedure. I've posted my code, if it helps.
    public static void callSortTwo(Connection conn, CallList cl) {
            try {
                Timestamp ts = new Timestamp(System.currentTimeMillis() );
                System.out.println("Executed at: " + ts);
                String insert_query = "INSERT INTO SWEATY_BALLSAK.CALLS (" +
                        "beat," +
                        "call_descr," +
                        "priority," +
                        "date," +
                        "time," +
                        "call_num," +
                        "location," +
                        "status," +
                        "entry_id) " +
                        "VALUES(?,?,?,?,?,?,?,?,?)";
                PreparedStatement pstmt = conn.prepareStatement(insert_query);
                for (int counter = 0; counter < cl.getSize(); counter++) {
                    String current_event[] = cl.getElementArray(counter);
                    pstmt.setString(1,current_event[0]);
                    pstmt.setString(2,current_event[1]);
                    pstmt.setString(3,current_event[2]);
                    pstmt.setString(4,current_event[3]);
                    pstmt.setString(5,current_event[4]);
                    pstmt.setString(6,current_event[5]);
                    pstmt.setString(7,current_event[6]);
                    pstmt.setString(8,current_event[7]);
                    pstmt.setTimestamp(9, ts);
                    pstmt.executeUpdate();
            catch(SQLException sqle_callSort) {
                System.out.println("SQL Exception" + sqle_callSort.getMessage() );
            }

    Stored procedures use PL/SQL, not SQL, find and read something about it, it is very wide topic.
    Stored procedures are often used for efficiency reasons. Simple example: if stored procedure contains several embeded SQL statements, database has to parse and precompile these SQLs only once, during procedure's compilation. Second, database always optimizes each SQL query before execution - but in the stored procedure it is done only once, during compilation. When you execute SQL from your program, RDBMS must parse and optimize this SQL each time, so using stored procedure you could save some (little) time on parsing and optimizing.
    But when you want to do some kind of 'batch procesing' - execute one query to take some data from the table, analyze this data, prepare next SQLs based on retrieved data and so on, it's always better to do it in the stored procedure instead of the program, because you avoid transferring data through the network from database to program and back - you call simply stored procedure and all the processing is done in the database.
    Oracle from ver. 9, beside PL/SQL has something called "Java stored procedures', so .... yes, you could write stored procedures in Java too :)

  • Passing single/multiple values to stored proc parameter from crystal report

    I tried below solution posted on this forum to pass either a single value or multi-value to a sql server stored procedure parameter (varchar datatype) from crystal report XI R2.
    In my crystal report , I am displaying all the available parameter values to the user  and the user will select either a single value or multi value.
    This worked when I select single value and when I say show sql query in my subreport  I see the following:
    {CALL "XYZ"."dbo"."storedprocedurename";1('Product  1')}
    But this did not worked when I selected multiple values and when I say show sql query in my subreport  I see the following:
    {CALL "XYZ"."dbo"."storedprocedurename";1('Product 1,Product 2')}
    I think it might work if it is as below:*
    For multiple values:
    {CALL "xyz"."dbo"."storedprocedurename";1('Product 1', 'Product 2')}
    Please advise.
    Solution Posted on this forum is as follows:
    Hi,
    As you must be aware of that a crystal report created of a stored procedure will allow only a single value for inserting a multiple value as a parameter in your report and pass those values to your stored procedure please follow the below work around which will be helpful for you.
    Symptom
    In Crystal Reports, you want to pass a multi-value parameter to a stored procedure. The problem with doing so is that Crystal Reports considers the multi-value parameter to be an array.
    How can you pass a multi-value parameter to a stored procedure?
    Resolution
    Here are the steps to pass a multi-value parameter to a stored procedure:
    1. Create a Crystal report, and add a multi-value parameter.
    2. Since the multi-value parameter is treated as an array, create a formula that uses the JOIN function. Create a formula as below:
    //Formula: @JoinFormula
    Join ({?Multi-value parameter array},";")
    ====================
    NOTE:
    In the formula above, a semi-colon (";") is the delimiter.
    ====================
    3. Within the main report, create a subreport based on the stored procedure, and include the parameter to be populated with the multi-value list.
    4. Link the Join formula in the main report to the stored procedure parameter in the subreport.
    Doing so passes a multi-value parameter to the stored procedure.
    Regards,
    Vinay

    Hi Vinay,
    First you need to make sure the stored procedure accepts multiple values in the fashion 'a','b','c'.
    Then, create this formula in the Main Report:
    numbervar i;
    stringvar s;
    for i:= 1 to ubound({?Parameter}) do
        s := s + "'" + {?Parameter}<i> + "'" + ",";
    left(s,len(s)-1);
    Link this formula to the sub-report's parameter.
    Hope this helps!
    -Abhilash

  • Crystal Reports 2008 Stored Procedure and Parameters from LOVs

    Quite simple report using stored procedure as data source. When editing some of the parameters we get this error when clicking OK to close "This stored procedure parameter can only accept multiple values. Please ensure that Allow Multiple Values is true."
    As we all know stored procedure parameters do not access multiple values at all, so this message is very hard to debug. The report does work if we set the 'Allow Multiple Values' to true, but only when using exactly one value for the parameter. We have tried verify database and other things, but cannot find any way around this issue.
    All ideas are appreciated as this is stopping us from utilizing the dynamic parameters.
    Thanks, Stig

    We managed to work around the issue by creating a new stored procedure. First we used the same parameter names and changed the data source to the new stored procedure. After renaming the parameter with the issue the problem then was resolved.
    Note that another parameter that was earlier affected by this issue in the way that it could not be edited and saved due to the same error message now also works fine. This even if this parameter has not changed names.
    Quite a complex situation to debug this. Maybe if the source of the error message is found in the code we could help testing.
    Stig

Maybe you are looking for

  • 3G iPhone Problems with iTunes 9.2: synch problems

    About 3 days ago I started getting this error message when I tried to sync my iPhone 3G with my Outlook 2007: "iTunes could not sync calendars to the iPhone [name of phone] because the sync server failed to sync the iPhone." I tried various ways to t

  • I get error MSVCR80.dll and error 7 when i try to open itunes

    I'm trying to open itunes on my PC and it comes up with errorMSVCR80.dll and error 7 (windows error 126) and will not open. Any suggestions?

  • Access ABAP Table using Java (NWDS/JCO)

    All, I am trying to setup a jco connection from java program through NWDS to ECC abap table. However I am getting the following error in NWDS: Exception in thread "main" java.lang.ExceptionInInitializerError: JCO.classInitialize(): Could not load mid

  • Method of planning valuation

    Hello!!! I have a problem with transaction KEPM. When I execute the method of planning valuation, in the system appear the next message: The treatment to finished successfully.But the system does not assess the information. Does someone know because

  • FireWire non-functinal after 10.6.4 Update

    After installing the latest Mac OS X update (10.6.4), I wasn't able to connect my iMac (Nov. 2007) to my MacBook Pro (Jun. 2009) via FireWire. I used to be able to see the other Mac popup in the Sidebar of Finders. I tried using the Migration Assista