DBMS_Random.VALUE parameters

Please can anyone describe de DBMS_RANDOM.VALUE(p1, p2) parameters(p1, p2)?

can't random just generate single numbers like:Sure
SQL> r
  1  select trunc(DBMS_RANDOM.VALUE(1,10))
  2* from (select rownum from dual connect by rownum < 20)
TRUNC(DBMS_RANDOM.VALUE(1,10))
                             6
                             3
                             2
                             9
                             1
                             1
                             8
                             2
                             5
                             9
                             7
                             5
                             7
                             8
                             1
                             2
                             1
                             9
                             2
19 rows selected.
SQL>

Similar Messages

  • How to pass Multi and Singlr value Parameters to DB2 query, which is using in SSRS report for ODBC connection

    Hi Guys,
    I am using DB2 database in SSRS. I have to pass Single Value and Multi Value Parameters. I tried with Select * From DB2Table Where
    Column=@PRM_Name Or Select * From DB2Table Where
    Column=:PRM_Name . It is not working and throwing error. Please help me out.
    Connection Details: ODBC
    Thanks Shiven:)

    Hi SKM,
    So you mean to say that Go to DataSource->Add Dataset-> Query Type-Text-> Under Query:
    click on fx (Expression)-> Write this expression
    For Single Value Parameter:
    ="SELECT customer_name, telephone_number, address1, address2, city from MyTable
    WHERE city = '" + Parameters!City.Value + "'"
    OR
    ="SELECT customer_name, telephone_number, address1, address2, city from MyTable
    WHERE city =  '" & Parameters!City.Value & "'"
    Keep it in mind if Parameter is String then
    It should be in Single quote ''.
     Like
    ="SELECT customer_name, telephone_number, address1, address2, city from MyTable WHERE city
    ='Hyderabad' "
    For Multivalu Parameter:
    ="SELECT EmployeeID, FirstName, LastName, LoginID FROM SHIVEN.AUDIT Where FirstName
    in ('" + REPLACE(JOIN(Parameters!City.Value,","),",","','") + "')"
    NOTE:
    If your Parameter is Single Value Parameter and You want to enter string values with Coma (,)
    separated (Like Hyderabad, Chennai, Delhi).
    In this case, you have to use below expression.
    ="SELECT customer_name, telephone_number, address1, address2, city from MyTable
    WHERE city IN ('" + REPLACE(Parameters!City.Value ,",","','") + "')"
    OR
    ="SELECT customer_name, telephone_number, address1, address2, city from MyTable
    WHERE city IN  ('" & REPLACE(Parameters!City.Value ,",","','") & "')"
    In above expression: Replace will replace all , with ‘,’ and city IN (‘Hyderabad’, ‘Chennai’,
    ‘Delhi’) will not throw any error.
     Note: You have to write expression in one line in Expression editor for dataset
    query
    Thanks It is working fine but it is tough job if query is big.
    Hi S kumar,
    The above approach we use when we have source like DB2, becasue DB2 has some syntactical differences to pass multivalue paramaeter. I tested and it works good, if i am mentioning the query in above format by using Fx button while creating dataset.
    but if we want fetch data from view which exist in DB2 and we need to call db2 view in SSRS and pass multivalue parameter in a way we did above then could you please mention the steps and way to achieve this.
    Thanks in advance!

  • [Forum FAQ] How to configure a Data Driven Subscription which get multi-value parameters from one column of a database table?

    Introduction
    In SQL Server Reporting Services, we can define a mapping between the fields that are returned in the query to specific delivery options and to report parameters in a data-driven subscription.
    For a report with a parameter (such as YEAR) that allow multiple values, when creating a data-driven subscription, how can we pass a record like below to show correct data (data for year 2012, 2013 and 2014).
    EmailAddress                             Parameter                      
    Comment
    [email protected]              2012,2013,2014               NULL
    In this article, I will demonstrate how to configure a Data Driven Subscription which get multi-value parameters from one column of a database table
    Workaround
    Generally, if we pass the “Parameter” column to report directly in the step 5 when creating data-driven subscription.
    The value “2012,2013,2014” will be regarded as a single value, Reporting Services will use “2012,2013,2014” to filter data. However, there are no any records that YEAR filed equal to “2012,2013,2014”, and we will get an error when the subscription executed
    on the log. (C:\Program Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting Services\LogFiles)
    Microsoft.ReportingServices.Diagnostics.Utilities.InvalidReportParameterException: Default value or value provided for the report parameter 'Name' is not a valid value.
    This means that there is no such a value on parameter’s available value list, this is an invalid parameter value. If we change the parameter records like below.
    EmailAddress                        Parameter             Comment
    [email protected]         2012                     NULL
    [email protected]         2013                     NULL
    [email protected]         2014                     NULL
    In this case, Reporting Services will generate 3 reports for one data-driven subscription. Each report for only one year which cannot fit the requirement obviously.
    Currently, there is no a solution to solve this issue. The workaround for it is that create two report, one is used for view report for end users, another one is used for create data-driven subscription.
    On the report that used create data-driven subscription, uncheck “Allow multiple values” option for the parameter, do not specify and available values and default values for this parameter. Then change the Filter
    From
    Expression:[ParameterName]
    Operator   :In
    Value         :[@ParameterName]
    To
    Expression:[ParameterName]
    Operator   :In
    Value         :Split(Parameters!ParameterName.Value,",")
    In this case, we can specify a value like "2012,2013,2014" from database to the data-driven subscription.
    Applies to
    Microsoft SQL Server 2005
    Microsoft SQL Server 2008
    Microsoft SQL Server 2008 R2
    Microsoft SQL Server 2012
    Please click to vote if the post helps you. This can be beneficial to other community members reading the thread.

    For every Auftrag, there are multiple Position entries.
    Rest of the blocks don't seems to have any relation.
    So you can check this code to see how internal table lt_str is built whose first 3 fields have data contained in Auftrag, and next 3 fields have Position data. The structure is flat, assuming that every Position record is related to preceding Auftrag.
    Try out this snippet.
    DATA lt_data TYPE TABLE OF string.
    DATA lv_data TYPE string.
    CALL METHOD cl_gui_frontend_services=>gui_upload
      EXPORTING
        filename = 'C:\temp\test.txt'
      CHANGING
        data_tab = lt_data
      EXCEPTIONS
        OTHERS   = 19.
    CHECK sy-subrc EQ 0.
    TYPES:
    BEGIN OF ty_str,
      a1 TYPE string,
      a2 TYPE string,
      a3 TYPE string,
      p1 TYPE string,
      p2 TYPE string,
      p3 TYPE string,
    END OF ty_str.
    DATA: lt_str TYPE TABLE OF ty_str,
          ls_str TYPE ty_str,
          lv_block TYPE string,
          lv_flag TYPE boolean.
    LOOP AT lt_data INTO lv_data.
      CASE lv_data.
        WHEN '[Version]' OR '[StdSatz]' OR '[Arbeitstag]' OR '[Pecunia]'
             OR '[Mita]' OR '[Kunde]' OR '[Auftrag]' OR '[Position]'.
          lv_block = lv_data.
          lv_flag = abap_false.
        WHEN OTHERS.
          lv_flag = abap_true.
      ENDCASE.
      CHECK lv_flag EQ abap_true.
      CASE lv_block.
        WHEN '[Auftrag]'.
          SPLIT lv_data AT ';' INTO ls_str-a1 ls_str-a2 ls_str-a3.
        WHEN '[Position]'.
          SPLIT lv_data AT ';' INTO ls_str-p1 ls_str-p2 ls_str-p3.
          APPEND ls_str TO lt_str.
      ENDCASE.
    ENDLOOP.

  • Table value parameters Question

    I would like to use a table valued parameter to create an invoice. It will insert into the invoice header data table the header and then it will insert the invoice detail all with different tables. The problem is that until now I was doing this using 2 separate
    procedures
    1. insert into invoice header
    2. insert into invoice detail - this was done with a foreach loop 
    foreach row in the invoice insert into invoice detail and it was also adjusting the inventory like so:
    USE [Trial]
    GO
    /****** Object:  StoredProcedure [dbo].[ARD_Insert]    Script Date: 02/25/2014 15:23:22 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    -- =============================================
    -- Author: Debra
    -- Create date: January 28, 2013
    -- Description: Insert into the ARD table
    -- =============================================
    ALTER PROCEDURE [dbo].[ARD_Insert]
    -- Add the parameters for the stored procedure here
    @InvoiceARD int,
    @Item int,
    @Description nvarchar(50),
    @Qty int,
    @Price decimal(10,2), 
    @TempWOID nvarchar(5),
    @InventoryQuantityAddSubtract int 
    AS
    BEGIN
    -- SET NOCOUNT ON added to prevent extra result sets from
    -- interfering with SELECT statements.
    SET NOCOUNT ON;
        -- Insert statements for procedure here
           --BEGIN TRAN
        INSERT INTO ARD(INVOICE,ITEM,[DESC],QTY,PRICE,TEMPWOID)
        VALUES(@InvoiceARD, @Item, @Description, @Qty, @Price, @TempWOID)
        DECLARE @Type nvarchar(3)
        SET @Type = (SELECT TYPE FROM INV WHERE ITEM = @Item)
        IF(@InventoryQuantityAddSubtract = 0) --Add
        BEGIN
        EXEC InventoryQuantityAdd_Update @Type,@Qty,@Item
        END
        ELSE IF(@InventoryQuantityAddSubtract = 1)--Subtract
        BEGIN
        EXEC InventoryQuantitySubtract_Update @Type,@Qty,@Item
        END
        --COMMIT TRAN
    END
    how would I be able to do this using table valued parameters
    Debra has a question

    This is the iventoryquantity stored procedure
    USE [Trial]
    GO
    /****** Object:  StoredProcedure [dbo].[InventoryQuantityAdd_Update]    Script Date: 02/25/2014 15:43:40 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    -- =============================================
    -- Author: Debra
    -- Create date: October 30, 2013
    -- Description: Add quantity to inventory.
    -- =============================================
    ALTER PROCEDURE [dbo].[InventoryQuantityAdd_Update] 
    -- Add the parameters for the stored procedure here
    @Type nvarchar(3),
    @Qty int,
    @Item int
    AS
    BEGIN
    -- SET NOCOUNT ON added to prevent extra result sets from
    -- interfering with SELECT statements.
    SET NOCOUNT ON;
        -- Insert statements for procedure here
       UPDATE INV SET ONHAND = ONHAND + @Qty,STAMPED = CASE WHEN @Type = 'CIG' THEN STAMPED + @Qty ELSE 0 END, 
    LASTDATE = CONVERT(DATE, GETDATE()) WHERE ITEM = @Item
    END
    Debra has a question

  • Multi-value parameters and strings with leading zeros

    I have invoice number as a multi-value parameter. Invoice is a string,10 (VBRP.VBELN) .
    Invoice number is my group. If I enter invoices 100 and 200 as parms, then I only get data for invoice #100 (the lowest value entered). But if I enter 100, 0000000100, 200, 0000000200 as parms, then I get data for both invoices. Is there a way to get around having to enter the invoice number in both formats. BTW, if I only enter 0000000100 and 0000000200 then I get no data.
    Selection criteria is (VBRP.VBELN) = ?invoiceno --- parms are defined as allow muliple values and allow discrete values.

    Oops, that's not gonna work with multi-value parameters.  How about:
    if IsNumeric((VBRP.VBELN)) then
      ToText(Val((VBRP.VBELN)), "0") in {?invoiceno}
    else
      (VBRP.VBELN) in {?invoiceno}
    end if
    BTW, the reason why your original formula didn't work was because the "=" should have been "in".  The above is needed only if the (VBRP.VBELN) field might contain leading zeroes.
    HTH,
    Carl

  • Dbms_random.value

    SELECT value
    into xxxx
    FROM
    ( SELECT value FROM a
    ORDER BY dbms_random.value )
    WHERE rownum = 1;
    When it picks value 123, how can code it to not pick value123 at least for a year?

    Hi,
    When it picks value 123, how can code it to not pick value123 at least for a year?You're asking for a random value, and yet you want it to be (albeit temporarily) unique ?
    bells ringin'
    That's an oxymoron ;-)
    See:
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:831827028200

  • Change format date TO_DATE(TRUNC(DBMS_RANDOM.VALUE...

    Hi all...
    I am trying dbms_random like this :
    **Type data :
    AAAA VARCHAR2(35)
    BBBB VARCHAR2(6)
    DDDD VARCHAR2(20)
    E_DATE VARCHAR2(14)
    **store procedur :
    BEGIN
    FOR X IN 0..3 LOOP
    INSERT INTO TEST VALUES (
    'AAAA--'|| dbms_random.string('X', 28),
    'BBBB' || TO_CHAR (TRUNC(dbms_random.value(0,10))),
    'CCCC--'|| dbms_random.string('X', 12),
    TO_DATE(TRUNC(DBMS_RANDOM.VALUE(2455532,2455563+3)),'J')
    END LOOP;
    END;
    Output :
    AAAA BBBB DDDD E_DATE
    AAAA--RTL2OWN8RVOMY1IUD93RP91RWOQA BBBB1 CCCC--JCWAXRO3TMP0 12-DEC-10
    AAAA--629F3A4AIW5E4OHCDVFZ41SFB2U4 BBBB5 CCCC--DLAUZO511Y97 12-DEC-10
    AAAA--XHKR95JISQRTRH54KNOQKDVUJ6QF BBBB6 CCCC--K7CHOT2KULNV 10-DEC-10
    AAAA--7DRZ38SPRIN26HNA7VPQV9FKWCCQ BBBB7 CCCC--FXV3CCY3BWHY 09-DEC-10i want format E_DATE to DD-MM-YYYY without change type data and still use dbms_random...
    Could you pls solve me out ?
    Thank you
    -newbie-pl/sql-

    Hi,
    Sorry, I'm not sure I uderstand the problem.
    Are you getting the date correctly, but you want to store it in a VARCHAR2 column? That's not a very good idea: dates belong in DATE columns, but if you ever want to convert a DATE into a string, use TO_CHAR:
    TO_CHAR ( TO_DATE ( TRUNC ( DBMS_RANDOM.VALUE (2455532, 2455563+3)
                , 'J'
         , 'DD-MM-YYYY'
         )or equivalently:
    TO_CHAR ( DATE '2010-12-01' + dbms_random.value (0, 34)
         , 'DD-MM-YYYY'
         )Since you're not displaying the hours, minutes or seconds, there's no point in using TRUNC just to set them to 00:00:00.
    Edited by: Frank Kulash on Feb 9, 2011 10:32 PM

  • Programmatically set Multi-value parameters

    Hi, I hope someone can help.
    I have a .net web application written in VS2008.  I display reports within a report viewer object.  I currently set report parameters within code using the SetParameterValue property within the report document object before passing the document to the viewer.
    This works fine for single value parameters, but I have a report which accepts multi value parameters and I am having problems trying to find any information about if this can be done within my code.  I understand the parameter is an array, therefore am I right in thinking I can pass an array into the SetParameterValue property?
    Any help would be much appreciated.
    Thanks

    Hello Julie
    You do not mention what version of CR you are using in .NET or what version of CR the reports were written in.
    There is a fair number of good threads on this issue in the forum, see if searching comes up with anything.
    Also, use the search box at the top right corner. That will search KBases, articles, Blogs, wikis, etc., etc.
    Oh and sample apps are here:
    https://wiki.sdn.sap.com/wiki/display/BOBJ/CrystalReportsfor.NETSDK+Samples
    and the [Crystal Reports for Visual Studio 2005 Walkthroughs|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/2081b4d9-6864-2b10-f49d-918baefc7a23] is a great article to go through.
    - Ludek
    Follow us on Twitter http://twitter.com/SAPCRNetSup
    Got Enhancement ideas? Try the [SAP Idea Place|https://ideas.sap.com/community/products_and_solutions/crystalreports]

  • Setting multi-value parameters using ReportExecutionService

    Does anyone know how to set multi-value parameters using ReportExecutionService in C#?
    If I have
    rsExec = new ReportExecutionService2005.ReportExecutionService();
    ReportExecutionService2005.ParameterValue[] parameters = new ReportExecutionService2005.ParameterValue[2];
    parameters[0] = new ReportExecutionService2005.ParameterValue();
    parameters[0].Label = "Report_Begin_Date";
    parameters[0].Name = "Report_Begin_Date";
    parameters[0].Value = "4/15/2007";
    parameters[1] = new ReportExecutionService2005.ParameterValue();
    parameters[1].Label = "SalesID";
    parameters[1].Name = "SalesID";
    parameters[1].Value = ???  //Here, this parameter should accept multiple values like 200, 201, 202, etc.
    rsExec.SetExecutionParameters(parameters, "en-us");
    How would I set the SalesID to take multiple values?

    hi
    how to set dynamic parameters values.
    please help me.
    reportexe.
    ParameterValue[] parameters =
    new reportexe.ParameterValue[5];
    if (_parameters.Length > 0)
    parameters[0] =
    new reportexe.ParameterValue();
    parameters[0].Label =
    "mgrid";
    parameters[0].Name =
    "mgrid";
    parameters[0].Value =
    "[DMMGR001MT].[MGR ID].&[10]";
    parameters[1] =
    new reportexe.ParameterValue();
    parameters[1].Label =
    "locid";
    parameters[1].Name =
    "locid";
    parameters[1].Value =
    "[DMDPT001MT].[DPT ID].&[700]";
    //[DMDPT001MT].[DPT ID].&[700] 
    parameters[2] =
    new reportexe.ParameterValue();
    parameters[2].Label =
    "usrid";
    parameters[2].Name =
    "usrid";
    parameters[2].Value =
    "[FILLED BY USER].[USER ID].&[yshah]";
    //[FILLED BY USER].[USER ID].&[yshah] 
    parameters[3] =
    new reportexe.ParameterValue();
    parameters[3].Label =
    "fromdate";
    parameters[3].Name =
    "fromdate";
    parameters[3].Value =
    "[FIRST DOSE DATE].[Date Key].&[20100101]";
    //[FIRST DOSE DATE].[Date Key].&[20100101] 
    parameters[4] =
    new reportexe.ParameterValue();
    parameters[4].Label =
    "todate";
    parameters[4].Name =
    "todate";
    parameters[4].Value =
    "[FIRST DOSE DATE].[Date Key].&[20100131]";
    // [FIRST DOSE DATE].[Date Key].&[20100131]
    this is my code.
    indu

  • Is there any post 2008R2 information available on Table Valued Parameters being usable for writes?

    The last I heard on the efforts to make TVPs writable was that they were on the roadmap for the 2008 R2 release but that it didn't make the cut.  
    Srini Acharya commented in the connect item associated with this feature that...
    Allowing table valued parameters to be read/write involves quite a bit of work on the SQL Engine
    side as well as client protocols. Due to time/resource constraints as well as other priorirites, we will not be able to take up this work as part of SQL Server 2008 release. However, we have investigated this issue and have this firmly in our radar to address
    as part of the next release of SQL Server.
    I have never heard any information regarding why this was pulled from the 2008R2 release and why it wasn't implemented in either SQL Server 2012 or SQL Server 2014.  Can anyone shed any light on what's going on here and why it hasn't been enabled
    yet?  I've been champing at the bit for the better part of 6 years now to be able to move my Data Access Methodology to a more properly structured message oriented architecture using Request and Response Table Types for routing messages to and from SQL
    Server Functions and Stored Procs.    
    Please tell me that I won't have to manually build all of this out with XML for much longer.
    Note that in SQL Server 2008 table valued parameters are read only. But as you notice we actually
    require you to write READONLY. So that actually then means that at some point in the future maybe if you say please, please please often enough we might be able to actually make them writable as well at some point.
    Please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please,
    please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please,
    please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please,
    please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please,
    please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please,
    please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please,
    please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please,
    please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please,
    please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please,
    please!

    Can someone please explain what the complication is?  
    It makes no sense to me that you can
    1)declare a table typed variable inside a stored procedure
    2)insert items into it
    3)return the contents of it with a select from that table variable
    but you can't say "hey. The OUTPUT parameter that was specified by the calling client points to this same variable."
    I would like to understand what is so different between
    create database [TechnetSSMSMessagingExample]
    create schema [Resources]
    create schema [Messages]
    create schema [Services]
    create type [Messages].[GetResourcesRequest] AS TABLE([Value] [varchar](max) NOT NULL)
    create type [Messages].[GetResourcesResponse] AS TABLE([Resource] [varchar](max) NOT NULL, [Creator] [varchar](max) NOT NULL,[AccessedOn] [datetime2](7) NOT NULL)
    create table [Resources].[Contrivance] ([Value] [varchar](max) NOT NULL, [CreatedBy] [varchar](max) NOT NULL) ON [PRIMARY]
    create Procedure [Services].[GetResources]
    (@request [Messages].[GetResourcesRequest] READONLY)
    AS
    DECLARE @response [Messages].[GetResourcesResponse]
    insert @response
    select [Resource].[Value] [Resource]
    ,[Resource].[CreatedBy] [Creator]
    ,GETDATE() [AccessedOn]
    from [Resources].[Contrivance]
    inner join @request as [request]
    on [Resource].[Value] = [request].[Value]
    select [Resource],[Creator],[AccessedOn]
    from @responseGO
    and
    create Procedure [Services].[GetResources]
    ( @request [Messages].[GetResourcesRequest] READONLY
    ,@response [Messages].[GetResourcesResponse] OUTPUT)
    AS
    insert @response
    select [Resource].[Value] [Resource]
    ,[Resource].[CreatedBy] [Creator]
    ,GETDATE() [AccessedOn]
    from [Resources].[Contrivance]
    inner join @request as [request]
    on [Resource].[Value] = [request].[Value]
    GO
    that this cannot be accomplished in 7 years with 3 major releases of SQL Server.
    If you build the database that I provided (I didn't provide flow control commands, of course so they'll need to be chunked into individual executable scripts) and then 
    insert into [Resources].[Contrivance] values('Arbitrary','kalanbates')
    insert into [Resources].[Contrivance] values('FooBar','kalanbates')
    insert into [Resources].[Contrivance] values('NotInvolvedInSample','someone-else')
    GO
    DECLARE @request [Message].[GetResourcesRequest]
    insert into @request
    VALUES ('Arbitrary')
    ,('FooBar')
    EXEC [Services].[GetResources] @request
    your execution will return a result set containing 2 rows.  
    Why can these not 'just' be pushed into a "statically typed" OUTPUT parameter rather than being returned as a loose result set that then has to be sliced and diced as a dynamic object by the calling client?

  • SQL and Multiple Values Parameters

    Hi,
    I've pretty much exhausted my search (google and in this forum) with finding a solution to my problem... So now I'm hoping that any of you will be able to help me out.
    I am writing an Oracle SQL query to get the data for a Crystal Report (Product Ver. 11.5.8.826).
    What I am trying to do is to allow a parameter to be entered by the user based on three possibilities:
    1. user enters a single value (eg. '66200')
    2. user enters multiple values (eg. '66200, 66201')
    or
    3. user leaves the parameter alone (eg. '' )
    The query works up to when I try do the following...
    Select
    From
    Where
    and ({?param_id} IS NULL OR table1.ID IN ({?param_id}))
    {?param_id} settings:
    'List of Values' = Static
    'Allow multiple values' = False
    'Value Type' = String
    with no Default Value
    table1.ID is of type Integer
    Using the above query, it works when I enter a single value such as '66200', but I get the following error when I leave the param_id blank:
    "Failed to retrieve data from the database.
    Details: HY000:(Oracle)(ODBC)(Ora)ORA-00936: missing expression
    (Database Vendor Code: 936 )"
    When I try to enter the value '66200, 66201' (yes, I know I have Allow multiple values set to False, and I do want the user to be able to enter more than one ID by using comma as a separator), I get the following error:
    "Failed to retrieve data from the database.
    Details: HY000:(Oracle)(ODBC)(Ora) ORA-00920: invalid relational operator
    (Database Vendor Code: 920 )"
    But when I have the following query:
    Select
    From
    Where
    and (table1.ID IN ({?param_id}))
    and enter the value '66200' it works, or if I enter the value '66200, 66201' this works too ('66200, 66201' will return the correct data result).
    However, if I leave the param_id to be blank, I get the error:
    "Failed to retrieve data from the database.
    Details: HY000:(Oracle)(ODBC)(Ora)ORA-00936: missing expression
    (Database Vendor Code: 936 )"
    What I want to try and do is to allow the user to leave the param_id empty and have the SQL query return all ID values by checking if that param_id is empty.
    I understand that I can just add a Value to the param_id to have "ALL" and just let the user select it, but the problem with that is then I will need to have the SQL Query potentially return thousands of data before I can even do the Record Selection - obviously not good on report performance and all.  I do have four (4) other parameters that I am using for the report, with two of them being required Date parameters:
    {?param_startdate}
    {?param_enddate}
    {?param_title}
    {?param_refnum}
    These four parameters are also in the SQL query, and returns with no problem at all:
    WHERE
    and ( {?param_startdate} IS NULL OR {?param_startdate}='' OR table.startdate >= {?param_startdate} )
    and ( {?param_enddate} IS NULL OR {?param_enddate}='' OR table.enddate <= {?param_enddate} +1)
    and ( '{?param_refnum}' IS NULL OR table.refnum= TO_NUMBER('{?param_refnum}') )
    and ( '{?param_title}' IS NULL OR UPPER(table.title) = UPPER('{?param_title}) )
    So, my question is:
    Is there a way to have the param_id be left blank thus allowing the SQL query to return all the ids?
    Any help would be much appreciated... thanks in advance.
    Edited by: Suolon Hu on Oct 16, 2008 6:13 PM
    Edited by: Suolon Hu on Oct 16, 2008 7:28 PM

    Hi Mohamed,
    Thanks again!  This does the job, but I find that it runs much slower than if I were to have it in the SQL query instead.  I guess there isn't a way to have a check condition in the SQL query instead of having it in the Record Selection?
    I was trying the CASE WHEN in the WHERE clause of the SQL query, but not being a SQL expert, I wasn't successful with this method - I was able to get it to work with one entry, but not multiple values '66200, 66201' or blank (all values))
    WHERE
    and table.ID IN
    (CASE
    WHEN {?param_ID} IS NULL THEN table.ID
    ELSE {?param_ID}
    END)

  • Non-cumulative value Parameters EFFECT

    Hi,
    I am customizing the 0IC_C03 inventory cube to get to the reports we need. But the query performance is extremly slow. We do not have BI Acceleratior, but aggregates are build for my query. So I duplicated the cube and removed 0MATERIAL from the non-cumulative parameter value for the cube, and have only 0CALDAY and 0PLANT. When I run the same query it runs way faster than before. All I did was remove the 0MATERIAL as one of the possible parameters.
    I would like to know the role of these parameters and the effect of not having 0MATERIAL as one of the parameter value.
    Anyone know why the performance difference?
    Also looking at the /BIC/ZL* cube with 0MATERIAL, the record counts are as high the material count. Now after removing the same table has lot less records.
    Could anyone explain about this?
    Thanks,
    Arthur.

    Hi,
    The basic purpose of Non-cumulatives is to get the values for them depending upon the Time Characterestics alone and not on any other characterestics. As far as I know you cant use 0MATERIAL as the aggregation reference Char.

  • Optional Multi-Value Parameters in a URL

    I have 3 summary reports, that each need to hyperlink to 4 detail reports. The summary reports use multi-value string parameters that are set to "optional" (this is crystal 2008). I need to construct URLs to support these optional parameters. The opendoc documentation says to use "no_value" as the param argument, but that doesn't work - I get the string "no_value" in the selection criteria which causes it to fail. Ideally, I'd use either lsMMyParam="NULL" or lsMMyParam="", but neither works. Anyone ever done this?

    hi Bob,
    have you tried doing this...
    &lsMPromptName=[]
    lsM prompt / parameter values have to be passed with square brackets as far as i know.
    jamie

  • How to pass multi-value parameters to DDS (data driven subscription)?

    Using RS2005, how should multivalue parameters be stored in a database field so that a data driven subscription can properly read and use them?  I have so far had no luck using syntax of:
    1)  parm1, parm2
    2)  parm1,parm2
    Do single qutoes need to explicitly wrap the values?  Can you please provide an example and a SQL INSERT statement using parm1 and parm2 to demonstrate what to store in the database field? 
    Thanks!!

    I have skimmed through this an have ran into this problem before but not with RS specifically, but with other ASP.NET apps I have built.  Maybe this work around will help.
    In my database I created a table function I call udf_Split List.  It looks like this: (Can't remember where I got this from, but it's not my own.)
    CREATE
    FUNCTION [dbo].[udf_SplitList]
    @List
    varchar(max),
    @SplitOn
    nvarchar(5)
    RETURNS
    @RtnValue table
    Id
    int
    identity(1,1),
    Value
    nvarchar(100)
    AS
    BEGIN
    While
    (Charindex(@SplitOn,
    @List)
    > 0)
    Begin
    Insert
    Into @RtnValue
    (value)
    Select Value
    =
    ltrim(rtrim(Substring(@List,
    1,
    Charindex(@SplitOn,
    @List)
    - 1)))
    Set @List
    =
    Substring(@List,Charindex(@SplitOn,
    @List)
    +
    len(@SplitOn),
    len(@List))
    End
    Insert
    Into @RtnValue
    (Value)
    Select Value
    =
    ltrim(rtrim(@List))
    Return
    END
    Then, in my query I used the following parameter: QueriedField IN(select value from dbo.udf_SplitList(@Parameter,',')  (I used commas to separate the list, but you can use whatever you like (;,|,*, etc.)
    For you @Parameter would be your DDS list parameter.  Hope this helps.  You can enter your list like Item1,Item2,Item3 etc.

  • Multiple value parameters in JSP to Portal

    Hello all,
    I'm creating parameter forms in JSP to run from the Portal 9i. I have a parameter form with select boxes that allows the user to select multiple choices. But when I submit the parameters. Only the first selection of the choices are being passed as parameters to the report.
    Code is as follows:
    <label for="search_by">Choose Search By:</label>     
    <select multiple size=5 name=search_by>
    <option value="Appraiser" selected>Appraiser
    <option value="Broker" >Broker
    <option value="Title Company">Title Company
    <option value="Credit Bureau">Credit Bureau
    <option value="PMI">PMI
    </select>     
    Is there any way to check the values of "search_by" before I submit to the Portal?
    Or do you know of any examples showing how to set this up so the Portal sees all the values selected by the user?

    Hi,
    As you are saying...
    Attributes : PostalCode
    Value : abc123
    in the second line,
    Attributes : PostalCode
    Value : cde456
    Is the data looking like..
    Address   Postal code
    ABC         abc123
    CDE         cde123
    In this case, you could easily load data into BW, just create 1:1 mapping
    If the data is:
    Address   Postal code
    ABC         abc123
    ABC         cde123
    Then please get confirmation from business as to which postal code is correct, as this may be a incorrect data isue.
    Regards,
    Pankaj

Maybe you are looking for