Passing multiple values to a parmeters in Discoverer 4i

Hi Friends,
I have a requirement of passing multiple values (Operating Unit Names) to the parameter(P_Opr_Unit) in Discoverer.
I am using PL/SQL function to get the data in Discoverer.Function is working fine for multiple values from Database(SQL Developer).
When i am trying to pass multiple values from discoverer ...it is accepting only the first parameter value of Operating Unit.
Need your Expertise on this issue.
Thanks In Advance.
Thanks & Regards
Ramya Nomula

Hi,
You can only pass one parameter value into a function. When you have a multi-valued parameter it enables you to create the condition: item IN (:param) which Discoverer expands to the condition: item IN ('val1', 'val2', 'val3') where these are the values the user has picked from the list of values.
Now if you have a calculation containing a function and a parameter: my_func(:param) then Discoverer has to map the parameter in the function an item in the worksheet. So if the param is from a multi-valued list it can only pass one value and so expands the calculation to my_func('val1') where val1 is the first item picked from the list.
Rod West

Similar Messages

  • How to passing multiple values for a parameter of discoverer(url parameters

    Hi All,
    I am trying to pass multiple values for a parameter of disco report. I am trying to include my url for discoverer viewer report. the values has the following
    'jeff,mark'
    'sfophiee,angela'
    Thanks and Regards
    Venkat

    Hello Venkat,
    I know there are some problems with 10.1.2.0.2, maybe if you haven't done yet you can try with 10.1.2.2, assuming this version should be working for multiple parameter values :
    OracleAS Discoverer 10.1.2.2 is installed with the following patch :
    Patch 4960210 PLACEHOLDER BUG FOR AS/DS 10G R2 PATCH SET 2 10.1.2.2
    So, once installed you can try adding your parameter as param_<parameter_name>='sfophiee,angela'
    Hope this helps, otherwise feel free to log a Service Request to Support.
    Best Regards,
    Gianluca

  • Passing multiple values to a parmeters in SQL Query

    Hi friends,
    I have the following requirement -
    I need to pass multiple values to the parameter 'WHERE hou.name = (:id1)' and the query is copied below for your reference .
    SELECT partno part_num,
         customer customer_name,
         hou.name op_name
         FROM hr_organization_units hou,
         oe_transaction_types_all sot,
         ra_customers rc,
         ra_addresses_all ra,
         ra_site_uses_all rsu,
         oe_order_headers_all h,
         oe_order_lines_all l,pwr_sod50 ps
         WHERE hou.name = (:id1)
    -- and hou.name = (:id4)
    --hou.name in ('CPS FRANCE','CPS GERMANY')
    --and hou.name = (:id1,hou.name)
         and trunc(ps.sch_ship_date) between nvl(:id2,trunc(ps.sch_ship_date)) and nvl(to_date(:id3)+.99999,trunc(ps.sch_ship_date))
         and ps.group_id = 9999999
         and hou.organization_id=h.org_id
         and ps.line_id =l.line_id
         and l.header_id =h.header_id
         and h.invoice_to_org_id=rsu.site_use_id
         and rsu.address_id =ra.address_id
         and ra.customer_id =rc.customer_id
         and h.order_type_id =sot.transaction_type_id
    Looking for your help on this.
    Thanks In Advance.
    Thanks & Regards
    Ramya Nomula

    Hi karthik,
    I am sorry for the wrong updation of my anonymus block.
    My requirement is to pass a multiple values to the parameter in SQL query, and here is the code which is working now for the multiple values with ourt single quotes to the values -
    SELECT partno part_num,
         customer customer_name,
         ps.customer_id customer_id,
         avail_qty avail_qty,
         sch_ship_date schedule_Ship_date,
         so_num order_no,
         h.header_id header_id,
         line_num line_no,
         l.ordered_quantity ordered_quantity,
         scd_qty qty_open,
         s_price unit_price,
         part_flag flag,
         sub_inv subinv,
         sbu,
         hold,
         qoh,
         line_detail_id detail_id,
         picking_line_id,
         picking_line_detail_id,
         rc.customer_name cust_name,
         rc.customer_number customer_number,
         rsu.location location,
         sot.attribute5 order_type,
         ps.line_id line_id,
         h.transactional_curr_code transactional_curr_code,
         hou.name op_name
         FROM hr_organization_units hou,
         oe_transaction_types_all sot,
         ra_customers rc,
         ra_addresses_all ra,
         ra_site_uses_all rsu,
         oe_order_headers_all h,
         oe_order_lines_all l,pwr_sod50 ps
         WHERE ','||:id1||',' like '%,'||hou.name||',%'
         and trunc(ps.sch_ship_date) between nvl(:id2,trunc(ps.sch_ship_date)) and nvl(to_date(:id3)+.99999,trunc(ps.sch_ship_date))
         and ps.group_id = 9999999
         and hou.organization_id=h.org_id
         and ps.line_id =l.line_id
         and l.header_id =h.header_id
         and h.invoice_to_org_id=rsu.site_use_id
         and rsu.address_id =ra.address_id
         and ra.customer_id =rc.customer_id
         and h.order_type_id =sot.transaction_type_id;
    Condition for sending multiple Oprtaing Units -
    WHERE ','||:id1||',' like '%,'||hou.name||',%'
    This above condition is working when i am passing multiple values with out single quotes...but not working for multiple values with single quotes.
    Sample queries tested -
    select 1 from dual where ',aa,bb,cc,' like '%,bb,%' (This is working)
    select 1 from dual where ','aa','bb','cc',' like '%,'bb',%'(This is not working).
    Thanks In Advance!
    Looking for Your Great Help.
    Thanks & Regards
    Ramya Nomula

  • Passing Multiple Values from a worksheet to PL/SQL function.

    Hi All,
    Is there any way to pass multiple values selected in a worksheet to a PL/SQL function ?
    I will try to explain the scenario:
    We have a crosstab report that showing all the customer details, deposit sum of a customer in each date in a date range selected. With the customer details we are showing the Rank of a customer based on the deposit in the latest date selected. Filtering is based on the rank, ie Top50 or Top60 etc.( As I said rank is calculating based on the deposit in the latest date).This is working fine.
    Now the new requirement is to : For example, in Top50 report, list all the customers, who were in the Top50 list, in any of the dates selected. We are able to display the daywise rank, but when giving a condition like daywiserank <= 50, the result becomes uncertain. Some blank lines, wrong amounts etc..
    As a work around we tried to find out the rank in a PL/SQL function. But the issue there is : we have some multiple value parameters used in the worksheet.
    Is there any way to pass multiple values selected in a worksheet to a PL/SQL function ?
    Or any other work arounds for the scenario explained?
    Reagrds,
    Jeneesh

    Hi Russ,
    Thanks for the response.
    Russ Proudman wrote:
    1. I thought there was an analytical function similar to rank - or maybe an option of rank - that if there are duplicate records to have them all considered the same rank. So if you had 3 records all the same as rank=2 then a condition saying where rank=2 would return the 3 records. You could check into this.
    We are already using DENSE_RANK. But the issue is the output contains incorrect null values nd repeated rows.
    We got it solved as I explained in the previous post. But will that AGGREGATION MODE setting ( Which discoverer says - not recommended) have any issue? I mean side effects?
    Russ Proudman wrote:
    2. Another thought is that you can create a PL/SQL routine - that's called from a SQL function registered in Discoverer - where a table is created that does the first part of your query. Then a worksheet is created to use the data from that table. So, in essence, the table would have your top50 ranked customers. Then you can write any kind of worksheet against that table. However, DBAs are loath to allow tables - that they didn't create! - many times in a PROD environment.
    Here also the same problem will occur: as the top 50 will depend upon the parameters. I cannot pass those parameters to PL/SQL Function.And storing the top50 ( itmay be top100 or to 150 also) for all combinations of the parameters is impossible
    Russ Proudman wrote:
    3. Finally, are you sure you're rank function is correct in that if you're getting blank lines, maybe the 'over' part is not considering all columns needed to determine the rank?
    Yes the query we are using is correct. The output QUERY of discoverer gives correct results in Sqlplus.
    Regards,
    Jeneesh

  • Passing Multiple Values from Multi Select

    Hi,
    My requirement is simple. I have created a simple Multi Select Option in parameter form and i want to send multiple selected values from the multi select option (in parameter form) to reports.
    eg:
    I want to send multiple countries code as input .........'US', 'CA', 'IND', 'UK'
    Can i do it in Oracle 6i reports, Thanks in Advance.
    Regards,
    Asgar

    Hi Thanks Again,
    For such a nice response. I got the Lexical Where condition properly running but still getting problems in catching the multiple values to be passed from form. just i will give u an insight of wat i have done:
    SQL:
    SELECT ALL FROM EMPLOYEES &cond_1* -- Working FIne
    in my Html Parameter Form i have an Multi Select component (the Problem is here) it is not passing more than i value from the form once i am accessing it from web or running it in paper report. In paper report layout it is not allowing me to select more than one value. but in HTML it is allowing to select multiple values but at the server end (After Parameter Form Trigger) it is giving a single value not multiple values.
    In PL/SQL when i checking the length of country_id i m getting it as one.
    Here is my SQL code
    srw.message(10, LENGTH(:country_id_1));
    :cond_1 := 'where country_id = '''|| :country_id_1 ||'''';
    This is passing the condition properly to SQL but only with single value but i want to pass multiple values
    I am struck in this+_
    WHERE CONTRY_COLUMN IN ('USA','UAE') -- This variable you have to pass from you form...
    Here as you said you gave multiple selection in your parameter form to generate report. So before generation report just prepare variable like this as it is bold above.
    and pass parameter through your runtime form to the report as you pass the normal parameter...liket this i gave you example...
    ADD_PARAMETER(PARAMETER_LIST_NAME,'P_CONT_PARAM',TEXT_PARAMETER,vString);
    Sorry for troubling you for a small thing but please help me to solve this issue.
    Thanks Again............
    Asgar.

  • How to pass multiple values from workbook to planning function ?

    Hi,
    I have created Planning function in Modeler and it has one parameter(Variable represents = Multiple single values).
    When executing the planning function by create planning seq. in the web template : I see value of variable store data like ...
        A.) input one value -> V1
        B.) input three values -> V1;V2;V3
    This function execute completely in web.
    However, I want to use the planning function in workbook(Excel).
    The value of variable can't input V1;V2;V3... I don't know how to pass multiple values from workbook to parameter(Multiple single values type) in planning function ?
    thank you.

    Hi,
    Please see the attached how to document (page no 16).
    <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f0881371-78a1-2910-f0b8-af3e184929be">how to</a>
    Hope this was helpful
    thanks

  • Passing multiple values for a single field in URL to call sap Transaction

    Hi All,
    I need to pass multiple values for a single field to SAP transaction .
    means if i have say a field "Date" which can contain more than one value, <b>but its not a range which has two fields</b> . How is it possible.
    Let me know pls.
    Regards,
    Sirisha.R.S.

    Hi Satyajit,
    I need to call a transaction with multiple values which gives me the report based on those values.
    So I need to pass multiple values for a single parameter.
    I hope u got it.
    Regards,
    Sirisha.R.S.

  • Any way to pass Multiple Values for a single Label in the Parameter?

    I have a Report that Contains 2 Parameters, @Customer & @Area. When trying to set up the Available Values for @Area, I'm having issues using multiple values for one Label, i.e. = "4006" Or "4610"
    One of the Filters in the Report is an Operation number, which is the [OPERATION] field, which is setup as a filter on the Tablix referencing the @Area parameter. 
    PROBLEM: I cannot retrieve any data when trying to use the ‘Or’ Operator here. If I simply put “4006” or “4610” I retrieve data, but when trying to combine it returns no data.
    Example, I need to allow a user to select ‘Chassis Incoming’, which would include data from Operations 4006 & 4610.
    QUESTION:
    Any way to pass Multiple Values for a single Label in the Parameter?
    I realize the typical solution may be to use ‘Multi-Value’ selection, but in this case we want the User to select the Area and the multiple values for Filtering will be automatically determined for them. Otherwise, they are subject to not getting
    it correct.
    I have tried several different ways, such as =”4006” Or “4610”, =(“4006”, “4610”), = In(“4006”, “4610”), etc….
    Note: We are using Report Builder 3.0

    Based on my experience, there's no way to 'intercept' the query that gets passed back to SQL Server, so a Split wouldn't work.
    Try creating either a function or stored procedure using the code below (compliments to
    http://www.dotnetspider.com/resources/4680-Parse-comma-separated-string-SQL.aspx) to parse the string: 
    CREATE FUNCTION dbo.Parse(@Array VARCHAR(1000), @Separator VARCHAR(10))
    RETURNS @ResultTable TABLE (ParseValue VARCHAR(100))AS
    BEGIN
    DECLARE @SeparatorPosition INT
    DECLARE @ArrayValue VARCHAR(1000)
    SET @Array = @Array + @Separator
    WHILE PATINDEX('%' + @Separator + '%' , @Array) <> 0
    BEGIN
    SELECT @SeparatorPosition = PATINDEX('%' + @Separator + '%', @Array)
    SELECT @ArrayValue = LEFT(@Array, @SeparatorPosition - 1)
    INSERT @ResultTable VALUES (CAST(@ArrayValue AS VARCHAR))
    SELECT @Array = STUFF(@Array, 1, @SeparatorPosition, '')
    END
    RETURN
    END
    Once created you can do things like this:
    SELECT * FROM Parse('John,Bill,David,Thomas', ',')
    SELECT * FROM (SELECT 'John' AS TestName union select 'David' AS TestName) AS Main
    WHERE TestName IN (SELECT ParseValue FROM dbo.Parse('John,Bill,David,Thomas', ','))
    This is what your SQL query would probably look like:
    SELECT OperationID, OperationName FROM dbo.Operations
    WHERE AreaID IN (SELECT ParseValue FROM dbo.Parse(@Area, ','))
    You may need to fiddle around with the Separator depending on whether SQL Server inserts a space between the comma and next value.

  • How can i pass multiple values by a single variable to EXECUTE IMMEDIATE

    Hi All,
    I want to pass multiple values for where condition for execute immediate. Something Like this:-
    bold
    Declare
    v_cond varchar(1000);
    Begin
    v_cond := '''INR','USD'''; --(OPTION 1)
    v_cond := 'INR,USD'; --(OPTION 2)
    EXECUTE IMMEDIATE 'Delete from table where colm in (:v_cond)' using v_cond;
    END;
    bold
    I am using this into a procedure
    Now option 1 gives an error ie a syntax error (; expected or something like that)(I am sorry, i can't tell the exact error here as i am not in the office right now)
    and option 2 makes the procedure execute but obviously doesn't delete the records, as it takes the whole as one.
    Please Help
    Regards
    Neeraj Bansal

    See the links containing examples under
    *7. List of values in an IN clause?*
    SQL and PL/SQL FAQ
    from the SQL and PL/SQL FAQ.

  • Passing multiple values to a single input parameter

    Hi folks,
    I have a Microstrategy query successfully passing input parameter to a calculation view.  For example I can pass a movement type to a material movements calculation view input parameter.  However if I try to pick more than one movement type the query then fails; 
    Generated SQL that works looks like this;
    select
    sum(a11.TOTALQUANTITY)  WJXBFS1
    from
    "_SYS_BIC"."MyPackage/CA_TEST_PASS_PARAMETER"
    ('PLACEHOLDER' = ('$$MoveType$$', '101')
    a11
    When choosing more than one value in Microstrategy the SQL now fails and looks like this;
    select
    sum(a11.TOTALQUANTITY)  WJXBFS1
    from
    "_SYS_BIC"."MyPackage/CA_TEST_PASS_PARAMETER"
    ('PLACEHOLDER' = ('$$MoveType$$', '101'),
    'PLACEHOLDER' = ('$$MoveType$$', '103'))
    a11
    If I cut and paste the SQL and run directly in HANA studio the error is;
    Could not execute 'select sum(a11.TOTALQUANTITY) WJXBFS1 from "_SYS_BIC"."MyPackage/CA_TEST_PASS_PARAMETER" ...' in 66 ms 361 µs .
    SAP DBTech JDBC: [2048]: column store error: search parameter error:  [2018] A received argument has an invalid value;TABLE/VIEW parameter: ( 'PLACEHOLDER'='$$MoveType$$, 103') not supported
    Is it possible to pass multiple values in a single parameter?  I'm using SP67 for this test.
    Thanks,
    -Patrick

    Ravi, also to answer one of your questions about how this will work in Microstrategy; I just heard back from my Microstrategy developer and he is trying MSTR Freeform SQL query with syntax like this;
    select (sumPAR_TEST.TOTALQUANTITY TOTALQUANTITY
    from "_SYS_BIC"."MyPackage/CA_TEST_PASS_PARAMETER"
    ('PLACEHOLDER' =('$$MoveType$$', '[Movement Type]')) PAR_TEST
    In this example [Movement Type] is the microstrategy prompt.  Unfortunately though it translates like this which is missing extra single quotes around each value;
    select     sum(PAR_TEST.TOTALQUANTITY)  TOTALQUANTITY
    from     "_SYS_BIC"."development.pr1959/CA_TEST_PASS_PARAMETER"
    ('PLACEHOLDER' = ('$$MoveType$$', ''101', '102''))   PAR_TEST
    instead of what we need which is;
    ('PLACEHOLDER' = ('$$MoveType$$', '''101'', ''102'''))   PAR_TEST
    So at this point we are not sure if this will be possible or not.
    -Patrick

  • Passing multiple values to a BI query

    Hi experts,
    This question has probably been asked a few times, but I have an issue with passing multiple values to a BI query.  Here's the scenario....
    1)  I have created a BI query.  When I test the query in VC I can enter values 1000:1100 in the Infoobject Business Area and I see that the values are passed through OK
    2)  Then I created a form where Business Area is an Input Field
    3)  I linked the form to the BI query and assigned value @Business_area
    3)  A table is linked to the BI query to view my result ( I have set a distinct before my table to view the data by fiscal year period)
    4) When running the VC model, the table show values for 1000 and 1100, but when I enter 1000:1100 and Submit it does not show both the business areas
    There must be something I am missing and I thought it was that in my submit string (between the input form and the BI query) that I should fill in some values (instad of @Business_area). I tried to fill in 1000:1100, but then I get an error saying Invalid time 1000:1100.
    I would really appreciate any help on this issue :-).
    Regards,
    Thomas

    Hi Thomas,
    I wish to enter default values for dates onto the VC form. Ie I have a VC report to display a customer's shipped data. Ship date is a selection field/ input field on the form for the report/ output table.
    At present if a user clicks submit they get all their shipped records from the beginning of time till today. How can I restrict the dates at VC level to past  3months? So if the users don't specify a ship date, they get the past 3 months data, and afterwards they can change it an retrieve all the data or past 2 years as they wish.
    Thanks,
    Jasmine

  • Passing multiple values to another page via a sql report

    Having trouble passing multiple values to another page via a popup SQL report
    I have two fields one called "descr" and another called "Met"
    when I use the code below all works fine and the value of "descr" is passed
    Select '&lt;a href="javascript:popUp2('''
    || 'f?p=&APP_ID.:950:&SESSION.::&DEBUG.::'
    || 'P950_TYPE:'
    || descr
    || ''', 790, 460);"style="color:darkred; font-weight: bold;font-size: 90%"&gt;'
    || descr
    || '&lt;/a&gt;' "Note"
    But when I want to pass another value, all goes bonkers and instead of the value of the field being passed the literal text is passed.
    can someone look at my code below and see what may be wrong
    Select '&lt;a href="javascript:popUp2('''
    || 'f?p=&APP_ID.:950:&SESSION.::&DEBUG.::'
    || 'P950_TYPE,P950_CODE:'
    || descr, Met
    || ''', 790, 460);"style="color:darkred; font-weight: bold;font-size: 90%"&gt;'
    || descr
    || '&lt;/a&gt;' "Note"
    I appeciate your help looking into this
    FYI (Here is the entire SQL for reference)
    With t
    as
    (SELECT
    CASE WHEN KEY = 2 then
    CASE WHEN WCS_CPT &gt; :P940_METRIC_1_WCS_CPT1 then
    '&lt;span style="color:Red; "&gt;'||TO_CHAR(WCS_CPT,'FML999G999G999G999G990D00')||'&lt;/span&gt;' else
    '&lt;span style="color:#399304; "&gt;'||TO_CHAR(WCS_CPT,'FML999G999G999G999G990D00')||'&lt;/span&gt;' end
    else '&lt;span style="color:#180c8b;"&gt;'||TO_CHAR(WCS_CPT,'FML999G999G999G999G990D00')||'&lt;/span&gt;' end "WCSCPT",
    CASE WHEN KEY = 2 then
    CASE WHEN WCS_TOI_PER_FTE &lt; :P940_METRIC_2_WCS_TOI_PER_FTE then
    '&lt;span style="color:Red; "&gt;'||TO_CHAR(WCS_TOI_PER_FTE,'999G999G999G999G990')||'&lt;/span&gt;' else
    '&lt;span style="color:#399304; "&gt;'||TO_CHAR(WCS_TOI_PER_FTE,'999G999G999G999G990')||'&lt;/span&gt;' end
    else '&lt;span style="color:#180c8b;"&gt;'||TO_CHAR(WCS_TOI_PER_FTE,'999G999G999G999G990')||'&lt;/span&gt;' end "WCSTOIPERFTE",
    CASE WHEN KEY = 2 then
    CASE WHEN WCS_SIO_PER_FTE &lt; :P940_METRIC_3_WCS_SIO_PER_FTE then
    '&lt;span style="color:Red; "&gt;'||TO_CHAR(WCS_SIO_PER_FTE,'999G999G999G999G990')||'&lt;/span&gt;' else
    '&lt;span style="color:#399304; "&gt;'||TO_CHAR(WCS_SIO_PER_FTE,'999G999G999G999G990')||'&lt;/span&gt;' end
    else '&lt;span style="color:#180c8b;"&gt;'||TO_CHAR(WCS_SIO_PER_FTE,'999G999G999G999G990')||'&lt;/span&gt;' end "WCSSIOPERFTE",
    CASE WHEN KEY = 2 then
    CASE WHEN WCS_TC_PER_FTE &lt; :P940_METRIC_4_WCS_TC_PER_FTE then
    '&lt;span style="color:Red; "&gt;'||TO_CHAR(WCS_TC_PER_FTE,'999G999G999G999G990')||'&lt;/span&gt;' else
    '&lt;span style="color:#399304; "&gt;'||TO_CHAR(WCS_TC_PER_FTE,'999G999G999G999G990')||'&lt;/span&gt;' end
    else '&lt;span style="color:#180c8b;"&gt;'||TO_CHAR(WCS_TC_PER_FTE,'999G999G999G999G990')||'&lt;/span&gt;' end "WCSTCPERFTE",
    CASE WHEN KEY = 2 then
    CASE WHEN WCS_ADSL_PER_FTE &lt; :P940_METRIC_5_WCS_DSL_PER_FTE then
    '&lt;span style="color:Red; "&gt;'||TO_CHAR(WCS_ADSL_PER_FTE,'999G999G999G999G990')||'&lt;/span&gt;' else
    '&lt;span style="color:#399304; "&gt;'||TO_CHAR(WCS_ADSL_PER_FTE,'999G999G999G999G990')||'&lt;/span&gt;' end
    else '&lt;span style="color:#180c8b;"&gt;'||TO_CHAR(WCS_ADSL_PER_FTE,'999G999G999G999G990')||'&lt;/span&gt;' end "WCSADSLPERFTE",
    CASE WHEN KEY = 2 THEN
    TO_CHAR(MONTH,'MON-YY')
    else
    'METRICS'
    end "MONTH"
    FROM (
    SELECT DISTINCT
    ROW_NUMBER() OVER (ORDER BY KEY DESC) AS ROW_NUM, KEY, WCS_CPT, WCS_TOI_PER_FTE, WCS_SIO_PER_FTE, WCS_TC_PER_FTE, WCS_ADSL_PER_FTE, MONTH
    from TW_M_KEYMETRICS
    WHERE TO_DATE(UPPER(MONTH),'DD/MON/YY') &gt;= TO_DATE(UPPER(:P940_START_OF_THIS_FIN_YEAR),'DD/MON/YY')
    ORDER BY KEY ASC, ROW_NUM, MONTH)
    WHERE ROW_NUM &lt;= :P940_MONTHS_SINCE_FIN_START)
    Select '&lt;a href="javascript:popUp2('''
    || 'f?p=&APP_ID.:950:&SESSION.::&DEBUG.::'
    || 'P950_METRIC_TYPE,P950_METRIC_VALUE:descr,MET'
    || ''
    || ''', 790, 460);"style="color:darkred; font-weight: bold;font-size: 90%"&gt;'
    || descr
    || '&lt;/a&gt;' "Note"
    , max(Met) METRICS, max(Jul) Jul08, max(Aug) Aug08, max(Sep) Sep08, max(Oct) Oct08, max(Nov) Nov08, max(Dec)Dec08, max(Jan) Jan08, max(Feb) Feb08, max(Mar) Mar08, max(Apr) Apr08, max(May) May08, max(Jun) Jun08
    from (
    Select 'Cost Per Transaction' descr,
    decode (MONTH, 'METRICS', WCSCPT) MET,
    decode (MONTH, 'JUL-08', WCSCPT) Jul,
    decode (MONTH, 'AUG-08', WCSCPT) Aug,
    decode (MONTH, 'SEP-08', WCSCPT) Sep,
    decode (MONTH, 'OCT-08', WCSCPT) Oct,
    decode (MONTH, 'NOV-08', WCSCPT) Nov,
    decode (MONTH, 'DEC-08', WCSCPT) Dec,
    decode (MONTH, 'JAN-08', WCSCPT) Jan,
    decode (MONTH, 'FEB-08', WCSCPT) Feb,
    decode (MONTH, 'MAR-08', WCSCPT) Mar,
    decode (MONTH, 'APR-08', WCSCPT) Apr,
    decode (MONTH, 'MAY-08', WCSCPT) May,
    decode (MONTH, 'JUN-08', WCSCPT) Jun
    from t
    union all
    Select 'Total Orders Issued Per FTE' descr,
    decode (MONTH, 'METRICS', WCSTOIPERFTE) MET,
    decode (MONTH, 'JUL-08', WCSTOIPERFTE) Jul,
    decode (MONTH, 'AUG-08', WCSTOIPERFTE) Aug,
    decode (MONTH, 'SEP-08', WCSTOIPERFTE) Sep,
    decode (MONTH, 'OCT-08', WCSTOIPERFTE) Oct,
    decode (MONTH, 'NOV-08', WCSTOIPERFTE) Nov,
    decode (MONTH, 'DEC-08', WCSTOIPERFTE) Dec,
    decode (MONTH, 'JAN-08', WCSTOIPERFTE) Jan,
    decode (MONTH, 'FEB-08', WCSTOIPERFTE) Feb,
    decode (MONTH, 'MAR-08', WCSTOIPERFTE) Mar,
    decode (MONTH, 'APR-08', WCSTOIPERFTE) Apr,
    decode (MONTH, 'MAY-08', WCSTOIPERFTE) May,
    decode (MONTH, 'JUN-08', WCSTOIPERFTE) Jun
    from t
    union all
    Select 'SIOs Per Billing FTE' descr,
    decode (MONTH, 'METRICS', WCSSIOPERFTE) MET,
    decode (MONTH, 'JUL-08', WCSSIOPERFTE) Jul,
    decode (MONTH, 'AUG-08', WCSSIOPERFTE) Aug,
    decode (MONTH, 'SEP-08', WCSSIOPERFTE) Sep,
    decode (MONTH, 'OCT-08', WCSSIOPERFTE) Oct,
    decode (MONTH, 'NOV-08', WCSSIOPERFTE) Nov,
    decode (MONTH, 'DEC-08', WCSSIOPERFTE) Dec,
    decode (MONTH, 'JAN-08', WCSSIOPERFTE) Jan,
    decode (MONTH, 'FEB-08', WCSSIOPERFTE) Feb,
    decode (MONTH, 'MAR-08', WCSSIOPERFTE) Mar,
    decode (MONTH, 'APR-08', WCSSIOPERFTE) Apr,
    decode (MONTH, 'MAY-08', WCSSIOPERFTE) May,
    decode (MONTH, 'JUN-08', WCSSIOPERFTE) Jun
    from t
    union all
    Select 'Total Calls Answered per FTE' descr,
    decode (MONTH, 'METRICS', WCSTCPERFTE) MET,
    decode (MONTH, 'JUL-08', WCSTCPERFTE) Jul,
    decode (MONTH, 'AUG-08', WCSTCPERFTE) Aug,
    decode (MONTH, 'SEP-08', WCSTCPERFTE) Sep,
    decode (MONTH, 'OCT-08', WCSTCPERFTE) Oct,
    decode (MONTH, 'NOV-08', WCSTCPERFTE) Nov,
    decode (MONTH, 'DEC-08', WCSTCPERFTE) Dec,
    decode (MONTH, 'JAN-08', WCSTCPERFTE) Jan,
    decode (MONTH, 'FEB-08', WCSTCPERFTE) Feb,
    decode (MONTH, 'MAR-08', WCSTCPERFTE) Mar,
    decode (MONTH, 'APR-08', WCSTCPERFTE) Apr,
    decode (MONTH, 'MAY-08', WCSTCPERFTE) May,
    decode (MONTH, 'JUN-08', WCSTCPERFTE) Jun
    from t
    union all
    Select 'ADSL Orders per FTE' descr,
    decode (MONTH, 'METRICS', WCSADSLPERFTE) MET,
    decode (MONTH, 'JUL-08', WCSADSLPERFTE) Jul,
    decode (MONTH, 'AUG-08', WCSADSLPERFTE) Aug,
    decode (MONTH, 'SEP-08', WCSADSLPERFTE) Sep,
    decode (MONTH, 'OCT-08', WCSADSLPERFTE) Oct,
    decode (MONTH, 'NOV-08', WCSADSLPERFTE) Nov,
    decode (MONTH, 'DEC-08', WCSADSLPERFTE) Dec,
    decode (MONTH, 'JAN-08', WCSADSLPERFTE) Jan,
    decode (MONTH, 'FEB-08', WCSADSLPERFTE) Feb,
    decode (MONTH, 'MAR-08', WCSADSLPERFTE) Mar,
    decode (MONTH, 'APR-08', WCSADSLPERFTE) Apr,
    decode (MONTH, 'MAY-08', WCSADSLPERFTE) May,
    decode (MONTH, 'JUN-08', WCSADSLPERFTE) Jun
    from t
    GROUP by descr
    Frank

    Borg Species 5618 wrote:
    Having trouble passing multiple values to another page via a popup SQL report
    But when I want to pass another value, all goes bonkers and instead of the value of the field being passed the literal text is passed.
    can someone look at my code below and see what may be wrong
    Select '&lt;a href="javascript:popUp2('''
    || 'f?p=&APP_ID.:950:&SESSION.::&DEBUG.::'
    || 'P950_TYPE,P950_CODE:'
    || descr, Met
    || ''', 790, 460);"style="color:darkred; font-weight: bold;font-size: 90%"&gt;'
    || descr
    || '&lt;/a&gt;' "Note"
    Hi Frank,
    You should close this parameters with single quotation. Try this -
    Select '&lt;a href="javascript:popUp2('''
    || 'f?p=&APP_ID.:950:&SESSION.::&DEBUG.::'
    || 'P950_TYPE,P950_CODE:'
    *|| 'descr, Met'*
    || ''', 790, 460);"style="color:darkred; font-weight: bold;font-size: 90%"&gt;'
    || descr
    || '&lt;/a&gt;' "Note"
    Hope this helps.
    Regards,
    M Tajuddin
    http://tajuddin.whitepagesbd.com

  • Passing multiple values to the QUERY BDOC parameter?

    hi All,
    Below is my Query BDOC Anchor Before Query Execute even handler... I'm trying to pass multiple values to the         bq.Z_PartnerFunction query parameter... i.e. 
    PARTNER_FCT in( '00000012','ZDIVMGR','ZAREADR')
    is it possible without creating new Query Bdoc ?
    ====================================
    Private Sub aempchoicewinTCWSearchTAnchor_beforeQueryExecute(ByRef bq As BusinessQuery, ByRef cancel As Boolean)
    If Not bq Is Nothing Then
            If sWcDummy = "Yes" Then
                    bq.WcDummy = sWcDummy
            End If
            bq.Z_PartnerFunction = "00000012"
            If ctrlZ_Territory.Value <> "" Then
                 bq.PRNB_TerrID = "*" & ctrlZ_Territory.Value
            End If
    End If
    End Sub
    ================================
    Thanks in advance
    Hetal

    Hi,
    it looks that you already enhanced the query BDoc because you have a new query parameter bq.Z_PartnerFunction, right?
    To which BDoc parameter is this BQ parameter mapped? And how looks the related where clause?
    For a single filter normally a "=" operator is used. Therefore your example with "in" won't work.
    If these three partner functions are fixed then you might hardcoded them directly in the where clause (supposed the BDoc is not used somewhere else where you don't want to have this filter).
    Or you might add 3 new BDoc parameters, add 3 new where clauses using a disjunction for them (and using an embracing bracket). In this case always all these 3 BQ parameters need to be filled (or all stay empty) to avoid a SQL syntax error.
    Regards,
    Wolfhard

  • I am facing a problem in passing multiple values as out parameters from fo

    Hi All,
    i am facing a problem in passing multiple values as out parameters from for loop.
    EX:
    i have a select statment inside a loop like.....
    PACKAGE SPEC:
    create or replace PACKAGE EMP_PKG AS
    TYPE TAB_NUM IS TABLE OF SCOTT.EMP.EMPNO%TYPE;
    TYPE TAB_NAME IS TABLE OF SCOTT.EMP.ENAME%TYPE;
    TYPE TAB_JOB IS TABLE OF SCOTT.EMP.JOB%TYPE;
    temp_table TAB_NUM;
    procedure test(temp_TAB_e_no OUT TAB_NUM,
    temp_TAB_e_name OUT TAB_NAME,
    temp_TAB_e_job OUT TAB_JOB);
    END EMP_PKG;
    PACKAGE BODY:
    create or replace PACKAGE BODY EMP_PKG AS
    v_e_no NUMBER;
    procedure test(temp_TAB_e_no OUT TAB_NUM,
    temp_TAB_e_name OUT TAB_NAME,
    temp_TAB_e_job OUT TAB_JOB) IS
    BEGIN
    select EMPNO bulk collect into temp_table from emp;
    for i in 1..temp_table.count loop
    v_e_no := temp_table(i);
    select empno,
    ename,
    job
    into temp_TAB_e_no(i),
    temp_TAB_e_name(i),
    temp_TAB_e_job(i)
    from emp
    where empno = v_e_no;
    end loop;
    end test;
    END EMP_PKG;
    PROBLEM FACING IS:
    I am expecting all rows returning from bellow select statment ...
    select empno,
    ename,
    job
    into temp_TAB_e_no(i),
    temp_TAB_e_name(i),
    temp_TAB_e_job(i)
    from emp
    where empno = v_e_no;
    But,while running the SP , i am getting error like
    ORA-06531: Reference to uninitialized collection
    ORA-06512: at "SCOTT.EMP_PKG", line 16
    why i am not getting all values as out parameters.please provide a solution for me.
    Thanks in advance my friend.

    user9041629 wrote:
    Hi All,
    i am facing a problem in passing multiple values as out parameters from for loop.
    EX:
    i have a select statment inside a loop like.....
    PACKAGE SPEC:
    create or replace PACKAGE EMP_PKG AS
    TYPE TAB_NUM IS TABLE OF SCOTT.EMP.EMPNO%TYPE;
    TYPE TAB_NAME IS TABLE OF SCOTT.EMP.ENAME%TYPE;
    TYPE TAB_JOB IS TABLE OF SCOTT.EMP.JOB%TYPE;
    temp_table TAB_NUM;
    procedure test(temp_TAB_e_no OUT TAB_NUM,
    temp_TAB_e_name OUT TAB_NAME,
    temp_TAB_e_job OUT TAB_JOB);
    END EMP_PKG;
    PACKAGE BODY:
    create or replace PACKAGE BODY EMP_PKG AS
    v_e_no NUMBER;
    procedure test(temp_TAB_e_no OUT TAB_NUM,
    temp_TAB_e_name OUT TAB_NAME,
    temp_TAB_e_job OUT TAB_JOB) IS
    BEGIN
    select EMPNO bulk collect into temp_table from emp;
    for i in 1..temp_table.count loop
    v_e_no := temp_table(i);
    select empno,
    ename,
    job
    into temp_TAB_e_no(i),
    temp_TAB_e_name(i),
    temp_TAB_e_job(i)
    from emp
    where empno = v_e_no;
    end loop;
    end test;
    END EMP_PKG;
    PROBLEM FACING IS:
    I am expecting all rows returning from bellow select statment ...
    select empno,
    ename,
    job
    into temp_TAB_e_no(i),
    temp_TAB_e_name(i),
    temp_TAB_e_job(i)
    from emp
    where empno = v_e_no;
    But,while running the SP , i am getting error like
    ORA-06531: Reference to uninitialized collection
    ORA-06512: at "SCOTT.EMP_PKG", line 16
    why i am not getting all values as out parameters.please provide a solution for me.
    Thanks in advance my friend.Probably not a bad thing that this isn't working for you.
    This is a horrible way to return the contents of a table.
    Are you doing this for educational purpose, or ... what is your goal here? If you just want to return a result set to a client you'd want to look in to using a REF CURSOR and not a bunch of arrays combined with horribly procedural (slow) code.

  • Pass multiple values as single input parameter into pipelined function

    Hi all,
    My need is to pass multiple values as single input parameter into pipelined function.
    For example - "2" and "3" are values of input parameter "t":
    with data as (
    select 1 as t from dual union all
    select 2 as t from dual union all
    select 3 as t from dual union all
    select 4 as t from dual union all
    select 5 as t from dual
    select * from data where t in (2,3)Is it possible at all?

    Not exactly sure, but usually 'multiple values'+'pipelined function' = some IN-LIST related approach?
    See:
    SQL> create table data as
      2  select 1 as t from dual union all
      3  select 2 as t from dual union all
      4  select 3 as t from dual union all
      5  select 4 as t from dual union all
      6  select 5 as t from dual;
    Table created.
    SQL> --
    SQL> CREATE OR REPLACE FUNCTION in_list (p_in_list  IN  VARCHAR2)
      2  RETURN sys.odcivarchar2list PIPELINED
      3  AS
      4    l_text  VARCHAR2(32767) := p_in_list || ',';
      5    l_idx   NUMBER;
      6  BEGIN
      7    LOOP
      8      l_idx := INSTR(l_text, ',');
      9      EXIT WHEN NVL(l_idx, 0) = 0;
    10      PIPE ROW (TRIM(SUBSTR(l_text, 1, l_idx - 1)));
    11      l_text := SUBSTR(l_text, l_idx + 1);
    12    END LOOP;
    13 
    14    RETURN;
    15  END;
    16  /
    Function created.
    SQL> --
    SQL> select *
      2  from   data
      3  where  t in ( select *
      4                from   table(in_list('1,2'))
      5              );
             T
             1
             2
    2 rows selected.http://www.oracle-base.com/articles/misc/dynamic-in-lists.php
    or
    http://tkyte.blogspot.nl/2006/06/varying-in-lists.html

Maybe you are looking for