VB for multiple queries

Hello,
Can we run multiple reports in SAP BW at a single request?
How would data be extracted from a single cube for these multiple reports? If this is possible, the output should either go to the printer or in a .pdf file.Suggest.
Regards,
K&M

Hi,
You may use a workbook with several requests embedded.
Or you may have multiple WBs and one WB that has links to separate WBs each one with a single report.
If I'm not mistaken, Adobe Distiller allows you to bring Excel sheets content into pdf format. Setting up Excel WB properties (portrait/landscape, number of rows/columns repeated on each page, numbering etc.) will allow you to get in pdf a file with multiple reports formatted as you want and ready to print.
Best regards,
Eugene
Message was edited by: Eugene Khusainov

Similar Messages

  • Single input for multiple queries

    how can we have single input form for multiple queries in visual composer?

    Hi Amol,
    check this Wiki page:
    [https://www.sdn.sap.com/irj/sdn/wiki?path=/display/vc/connectingmultipleinputportstoonesingleform&|https://www.sdn.sap.com/irj/sdn/wiki?path=/display/vc/connectingmultipleinputportstoonesingleform&]
    For connecting a form with multiple queries you can create several transitions from your form to the input ports of the queries. You need a button in your form with the submit event. Select each transition from your form to the queries and rename the event to *submit. You need the asterisk for sending the data to all queries.
    Best Regards,
    Marcel

  • Group by Left Report for Multiple Queries

    Afternoon folks,
    I have been pretty much writing my queries in Oracle Reports by having one long query (which includes multiple sub-queries) and then displaying the results (Mainly Counts and MEDIAN values).
    This has resulted in one very long query (difficult to manage and understand), not to mention slower performance. I would like to change that my making smaller queries and use data links to join the groups.
    Here is my Report request in hand. I need to build a Report that will be grouped by a Reporting Year and stratified by Age Groups and then Report various Counts of Students that are
    coming from various data sources (Tables). As of now, I have the Counts coming from at least 3 different data sources. So as you can imagine, my 3 sub queries have added to one
    very long query. Anymore requirements to the Report and it can lead to a big mess.
    Column '# of Students Enrolled' is coming from ENROLLMENT_TB table
    Columns '# of Students who took Math' and 'Marks > 60' are coming from COURSE_MATH table.
    Birth Date information is in the STUDENT_TB table (Since the Report needs to be stratified by Age Groups)
    Report Layout
    Reporting Year    Age Group         # of Students Enrolled   # of Students who took Math       Marks > 60   Median Score
    ========================================================================================================================
    2010              1960 - 1969                          999                           999              999            999                 
                      1970 - 1979                          999                           999              999            999                 
                      1980 - 1989                          999                           999              999            999                 
                      1990+                                999                           999              999            999                 
    2011              1960 - 1969                          999                           999              999            999                 
                      1970 - 1979                          999                           999              999            999                 
                      1980 - 1989                          999                           999              999            999                 
                      1990+                                999                           999              999            999                 
    2012              1960 - 1969                          999                           999              999            999                 
                      1970 - 1979                          999                           999              999            999                 
                      1980 - 1989                          999                           999              999            999                 
                      1990+                                999                           999              999            999                  Currently, I have 3 sub-queries
    Sub Query #1: # of Students Enrolled from ENROLLMENT_TB.
    Sub Query #2: # of the Enrolled Students who took Math from COURSE_MATH_TB
    Sub Query #3: # of the Enrolled Students who took Math from COURSE_MATH_TB and got Marks > 60. Median Score of this sampling.
    My thought would be to have them into Groups and then create a Report a s a Group Left to achieve the results. Any help or suggestions would be more than welcome.
    I have begun working on this Report but it is still taking quite long (Like 4 minutes) when the individual Queries (Q_COURSE_MATH and Q_COURSE_MATCH_60) are only taking 20 seconds each.
    My guess is the Grouping based on the age group is resulting in slower performance but I could be wrong.
    Also, the Query runs between pages and takes a long time to run. So, when I actually ran the Report, only the first page was formatted and then subsequent pages follow.
    Looking at the data model, is there something conceptually wrong?
    I have also not included the Query for Enrollment Counts to keep the Report simple.
    Data Links:
    Q_REPORTING_YEAR and Q_COURSE_MATH (Join condition: reporting_year and age_range_order_id)
    Q_REPORTING_YEAR and Q_COURSE_MATH_60 (Join condition: reporting_year and age_range_order_id)
    Data Layout:
    Q_REPORTING_YEAR
    select yrs.reporting_year,
           age_range.age_range_label,
           age_range.age_range_order_id
    from
      select to_char(Add_Months(To_Date ('01-JAN-2009', 'DD-MON-YYYY'), 12 * LEVEL), 'YYYY')   reporting_year
      from    DUAL
      CONNECT BY LEVEL < 4
    ) yrs,
      select decode( rownum, 10, '1990+', to_char(1900+ (rownum-1)*10)||'-'|| to_char(1900+ (rownum)*10-1))   age_range_label,
                 to_char(1900+ (rownum - 1)*10)                                                               age_start,
                 to_char(decode(rownum, 10, to_char(sysdate, 'yyyy'), 1900+ (rownum)*10-1))                   age_stop,
                 rownum                                                                                       age_range_order_id
      from    dual
      connect by rownum < 11
    ) age_range
    order by yrs.reporting_year, age_range.age_range_order_id
    Q_COURSE_MATH
    select reporting_year              cm_reporting_year,
           age_range_label             cm_age_range_label,
           age_range_order_id          cm_age_range_order_id,
           COUNT(distinct(student_id)) cm_student_count
    from
      select distinct cm.student_id                     student_id,
             to_char(cm.course_date, 'YYYY')           reporting_year,
             age_range.age_range_label        age_range_label,
             age_range.age_range_order_id   age_range_order_id
      from   course_math    cm,
             student_tb s,
               select decode( rownum, 10, '1990+', to_char(1900+ (rownum-1)*10)||'-'|| to_char(1900+ (rownum)*10-1))   age_range_label,
                          to_char(1900+ (rownum - 1)*10)                                                               age_start,
                          to_char(decode(rownum, 10, to_char(sysdate, 'yyyy'), 1900+ (rownum)*10-1))                   age_stop,
                          rownum                                                                                       age_range_order_id
               from    dual
               connect by rownum < 11
              ) age_range
        where  cm.student_id = s.student_id
        and exists ( select 'x' from sampling_student_vw w
                         where  w.student_id = cm.student_id )
        and     to_char(s.birth_date, 'YYYY') between age_range.age_start and age_range.age_stop
    ) q
    GROUP BY q.reporting_year, q.age_range_label, q.age_range_order_id
    Q_COURSE_MATH_60
    select reporting_year              cm_reporting_year,
           age_range_label             cm_age_range_label,
           age_range_order_id          cm_age_range_order_id,
           COUNT(distinct(student_id)) cm_student_count,
           MEDIAN(marks)                cm_median_60
    from
      select distinct cm.student_id                     student_id,
             to_char(cm.course_date, 'YYYY')           reporting_year,
             cm.marks                                  marks,
             age_range.age_range_label        age_range_label,
             age_range.age_range_order_id   age_range_order_id
      from   course_math    cm,
             student_tb s,
               select decode( rownum, 10, '1990+', to_char(1900+ (rownum-1)*10)||'-'|| to_char(1900+ (rownum)*10-1))   age_range_label,
                          to_char(1900+ (rownum - 1)*10)                                                               age_start,
                          to_char(decode(rownum, 10, to_char(sysdate, 'yyyy'), 1900+ (rownum)*10-1))                   age_stop,
                          rownum                                                                                       age_range_order_id
               from    dual
               connect by rownum < 11
              ) age_range
        where  cm.student_id = s.student_id
        and      cm.marks >= 60
        and exists ( select 'x' from sampling_student_vw w
                         where  w.student_id = cm.student_id )
        and     to_char(s.birth_date, 'YYYY') between age_range.age_start and age_range.age_stop
    ) q
    GROUP BY q.reporting_year, q.age_range_label, q.age_range_order_id

    Hi Arsalan,
    "Group by" is not a valid calculation option for calculated fields in the database object, nor is it for the calculation fields in your report.
    I believe that what you are trying to achieve is to have a SUM of all the sales done, grouped by Brand. This is typically something you configure while building your report(in Active Studio).
    If you for example would only want to show 2 out of 5 Brands in your report I suggest you use a filter(which is configured while building your report as well).
    For all calculation and operation options in calculated fields you can go to the Help section of BAM and search for "Calculation Operators and Expressions".
    I hope I helped you solve your problem.
    Kind regards,
    Martijn van der Kamp

  • Ready for Input Variables for Multiple Queries in I_T_VAR_RANGE

    Hi
    I created Web template which contains multiple views/queries. Two views/queries contain Ready for Input Variables. I have custeomer exit code for this Web template. I wrote code by using Ready for input variable which pass to customer exit code. But the variables which contain in two views/queries not appearing in I_T_VAR_RANGE. The two variables belongs to different views and I required those variables. please find below code:
        WHEN 'ZVBCUST'.
          LOOP AT i_t_var_range INTO w_var_range WHERE vnam = 'ZVAR1'. 
            g_soldto = w_var_range-low.
          ENDLOOP.
          LOOP AT i_t_var_range INTO w_var_range WHERE vnam = 'ZVAR2'
            g_zvbsshto = w_var_range-vnam.
            g_shipto = w_var_range-low.
          ENDLOOP.
    The above 'ZVAR1' is ready for input variable which belongs to one Query and below 'ZVAR2' is other ready for input variable which belongs to second query. I required these two at a time when customer exit variable 'ZVBCUST' executes.
    But in I_T_VAR_RANGE only one variable appears when I execute Web Template . Kindly help me in this regard
    Thanks
    luci

    Hi,
    First thing is to how you have defined your variable such as
    Customer exit or
    Replacement path or
    Manual input etc..
    If you want your variable filled through the exit select Customer Exit, then you have to look at the variable options such as Single value or range. According to your definition you have code as you defined such as wa_range-opt = 'BT' or 'EQ'.
    Next..
    In CMOD -> your project -> EXIT_SAPLRRS0_001 -> include 'ZXRSRU01' ->
    ISTEP = 1 -> before the variable pop up will be filled by the exit
    when 'your variable'
    your code
    ISTEP = 2 -> after the variable pop up i.e after running your selections, calculates the values for your variables after selection screen execution.
    when 'your varaible'
    your code
    ISTEP = 3 -> Validation purpose and message handling purpose
    when 'your variable'
    your code

  • Question about templates with multiple queries

    I am just starting out with BI Publisher, v.10.1.3.2. I have a report that has multiple queries, but my template is just based on 1 query. How can I make the template use more than one query?
    Thanks!!

    <!-- BI Publisher Report Data Template --!>
    <!-- Report: -->
    <!-- defaultPackage - the PL/SQL package name to resolve any lexical
    references, group filters, or data triggers defined in the template. -->
    <dataTemplate name="dataTemplateName" description="DESCRIPTION" dataSourceRef="ORCL" defaultPackage="<SCHEMA>.<PACKAGE>" version="1.0">
    <properties>
    <property name="include_parameters" value="True|False"></property>
    <property name="include_null_Element" value="True|False"></property>
    <property name="xml_tag_case" value="upper|lower"></property>
    <property name="db_fetch_size" value="500"></property>
    <property name="scalable_mode" value="on|off"></property>
    <property name="include_rowsettag" value="true|false"></property>
    <property name="debug_mode" value="on|off"></property>
    </properties>
    <parameters>
    <parameter name="IDENTIFIER" dataType="character|date|number" defaultValue="0" include_in_output="true|false"></parameter>
    </parameters>
    <!-- Flexfield support for queries against Oracle Applications database -->
    <lexicals>
    <lexical></lexical>
    </lexicals>
    <dataQuery>
    <xml name="xml_query_name" expressionPath="Xpath_expression">
    <url method="GET|POST" realm="auth_name" username="" password="">file:///d:/windir/filename.xml</url>
    </xml>
    <sqlStatement name="query_name">
    <![CDATA[
    SELECT
    FROM
    WHERE
    ]]>
    </sqlStatement>
    </dataQuery>
    <!-- If you have multiple queries, you must link them to create the -->
    <!-- appropriate data output. In the data template, there are two methods -->
    <!-- for linking queries: using bind variables or using the <link> element -->
    <!-- to define the link between queries. -->
    <link parentQuery="parent_query_name" parentColumn="col" childQuery="child_query_name" childColumn="col" condition="= < <= > >="></link>
    <dataTrigger name="beforeReport" source="<package_name>.<function_name>"></dataTrigger>
    <!-- (Required for multiple queries) Defines the structure of the output -->
    <!-- XML. Consists of <group> and <element>elements to specify the -->
    <!-- structure. This section is optional for single queries; if not -->
    <!-- specified, the data engine will generate flat XML. -->
    <dataStructure>
    <group name="group_tag_name" source="query_name" groupFilter="<package_name>.<function_name>">
    <element name="tag_name" value="source_column" function="SUM() COUNT() AVG() MIN() MAX()"></element>
    <element name="tag_name" value="<group_name>.<column/alias name>" function="SUM() COUNT() AVG() MIN() MAX()"></element>
    <group name="group_tag_name" source="query_name" groupFilter="<package_name>.<function_name>">
         <element name="tag_name" value="source_column" function="SUM() COUNT() AVG() MIN() MAX()"></element>
         <element name="tag_name" value="<group_name>.<column/alias name>" function="SUM() COUNT() AVG() MIN() MAX()"></element>
    </group>
    </group>
    </dataStructure>
    <dataTrigger name="afterReport" source="<package_name>.<function_name>"></dataTrigger>
    </dataTemplate>

  • Multiple Queries in Workbook - Refresh Screen Shows Up for Every Query

    We have multiple queries in a workbook.  All of these queries have the exact same selections for the variable selection screen.  When all the queries are refreshed once, the selection screen used to show up once and all the queries are refreshed with the same selections.  
    We were on BI 7.0 and SP10.  We recently moved to SP12.  Since the SP12 installation, the multiple query refresh pops-up the selection screen for every query.  It is nothing like "multiple query refresh" at once since the user has to click "execute" button for every single query.  It is interesting to note that the selection screen only contains hierarchy variables and hierarchy node variables.  The other variables of selection screen do not show up.  I couldn't find any OSS note on this topic.  Please let me know if anyone has any comments on this issue.  I will assign points to useful posts.

    hi Sameer,
    try to update front end patch to latest version ?
    Using the BI 7.x Add-On for SAP GUI 7.10 - Requirements
    hope this helps.

  • Multiple Queries for sales

    Hello Gurus,
    I have multiple queries for SD, Kindly help me out.
    1: We send 50 quantities to client using (Post Goods issue) and when client receives the material he says their are only 48 quantities and 2 quantities are missing. I this scenario what we suppose to do , If i send my client 2 more quantities then my store shows 52.
    2: We have 3 stores and we are using MTO scenario when client calls us for finish goods we select store 100 in sales order after production our production department send some finished goods in store 100 some in 200 and the remaining in 300. now in this scenario what i suppose to do when i create delivery with respect to Sales order it shows store 100.
    3: Unit Conversion Client ask for 54500 small boxes , I make Sales order of small boxes but when i make delivery it shows like this
                       Description                   TYPE                      UNIT Packing Quantity
               finish goods small boxes     MasterBox(Big Box)      109(small box)      500           54500
    Means in 1 Big Box i have to Pack 500 Small boxes and deliver to my client . Now 109 Big Boxes Multiply 500 small Boxes = 54500
    Regards

    1: We send 50 quantities to client using (Post Goods issue) and when client receives the material he says their are only 48 quantities and 2 quantities are missing. I this scenario what we suppose to do , If i send my client 2 more quantities then my store shows 52.
    Book that a loss in transit for 2 quantities & do subsequent delivery free of charge for the new 2 quantities.
    3: Unit Conversion Client ask for 54500 small boxes , I make Sales order of small boxes but when i make delivery it shows like this
    Description TYPE UNIT Packing Quantity
    finish goods small boxes MasterBox(Big Box) 109(small box) 500 54500
    I assume you are not using handling units for this scenario.
    Refer following w/o handling units.
    You need 2 separate UoM for Big & Small Box.
    Say
    Small Box
    ZSB
    |Big Box|ZBB|
    Use UoM Box as reference
    In material master - Additional Data - Units of Measure, maintain
    100
    ZSB
    Small Box
    <=>
    1
    ZBB
    Big Box
    And also,
    In Sales:Sales Org1, General Data
    Base Unit of Measure
    ZSB
    Sales unit
    ZBB
    Regards
    JP

  • Multiple queries in reports with XSL-FO and without BI Publisher

    Hello,
    I'm trying to find out how to create a complex report in APEX for printing. The report contains multiple queries in different layout, images and static text.
    I don't have the possibility to use BI Publisher and I'm not an XSL-FO expert. However I'm trying to find out if it's possible at all not using BI Publisher.
    I'm having the impression that multiple report queries and layouts in APEX can only be used in combination with BI Publisher. I'd be glad if someone could give me an example of how to do multiple queries and layout in a single report only using XSL-FO.
    Thanks in advance,
    Jan Willem

    Hello,
    I'm trying to find out how to create a complex report in APEX for printing. The report contains multiple queries in different layout, images and static text.
    I don't have the possibility to use BI Publisher and I'm not an XSL-FO expert. However I'm trying to find out if it's possible at all not using BI Publisher.
    I'm having the impression that multiple report queries and layouts in APEX can only be used in combination with BI Publisher. I'd be glad if someone could give me an example of how to do multiple queries and layout in a single report only using XSL-FO.
    Thanks in advance,
    Jan Willem

  • Need Different Selection screen for different Queries in a Workbook

    Hi,
    I have created a workbook with Multiple tabs in BI 7.0.  Each Tab has different Queries and each query has different Selection screens (Variable Selections).
    When i open the workbook and refresh it, the selection screen is appearing only for one query.  All the queries are refreshed by this single selection screen, though each query has different Variable selections.  What i need is a seperate selection screen i.e seperate Variable selection appearing for each queries, when i refresh each one of them.
    Is it possible to do this?  If anybody has tried this, help me in solving this issue.  Thanks for ur time.
    Regards,
    Murali

    Murali,
    If you un-check the 'Display Duplicate Variables Only Once' this WILL solve your problem.
    When you Refresh, you should be presented with a single variable selection dialog box, but it should contain an area for each Query (DataProvider) that is embedded in the Workbook.
    This is the case if the queries are all on the same tab, or on different tabs.
    However, if you have multiple tabs each with a query on it, each query must have it's own DataProvider. If all queries are based on the same DataProvider, it will not work as the Workbook only 'sees' one Query for which it needs variable input.
    If you REALLY want multiple variable selection dialog boxes, then maybe the best way to do this is to have the queries in separate Workbooks.
    If you don't want the User to have to open 5 queries manually, you could use a Macro in each Workbook that runs on opening, to open the next Workbook in the sequence.
    I hope this makes sense!
    Regards
    Steve

  • Multiple Queries on Interactive Report

    hi all,
    Can i run multiple queries based on some condition in creating an interactive report?? I mean
    i want to run a single query as
    if :P12_QUERY == 1 then
    first query
    else if :P12_QUERY == 2 then
    second query
    end if;
    Please provide me the syntax if its possible. Plz help me in this regard.
    With Regards,
    Sunil Bhatia

    Hello,
    You will need to create a pipeline function and use it in your query. But both your queries have to return the same dataset.
    Example:
    function choose_query(v_query_type integer) return some_type pipelined
    is
    v_query varchar2(4000);
    v_cur sys_refcursor;
    v_row some_type;
    begin
    if :P12_QUERY == 1 then
    v_query := 'select ....';
    else if :P12_QUERY == 2 then
    v_query := 'select ....';
    end if;
    open v_cur for v_query;
    loop
    v_row := some_type(null, null, null);
    fetch v_cur into v_row;
    exit when v_cur%notfound;
    pipe row (v_row);
    end loop;
    close v_cur;
    end;In interactive report you have to set query:
    select * from table(choose_query(:P12_QUERY ))
    Best Regards, Kostya Proskudin

  • Single billing document for multiple delivery documents

    Hi,
    Can someone tell me how to configure or proceed to make single billing document for multiple delivery documents.
    Document flow: Contract--> Order---> Delivery----> Billing
    -Thanks

    Being an old member of the forum, there is no need to stress the importance of adhering to forum rules where it has been clearly spelled out to avoid posting repeated queries.
    If you search the forum or Google it, you will find lot of documentations available on the same topic.  Take the inputs and try on your own.  Still if you face any issue, update here.
    G. Lakshmipathi

  • How to execute multiple queries in one stored procedure.

    Hi,
    I am Kumar,
    How to execute multiple queries in one stored procedure.
    here is the my requirements,
    1. get the max value from one table and sum of the that value.
    2. insert the values and also sum of the max value.
    using stored procedure
    I am using SQL server 2000 database.
    Please help me.
    Advance thanks
    by,
    Kumar

    This is not a java question and it is not even a problem: your only problem is
    1) lack of knowledge
    2) lack of interest to find a manual
    But you are going to have to change both by actually reading a book or a manual that explains the stored procedure language of SQL Server. It is the same as Sybase I think, so you could also look for a manual for that DBMS.

  • How to get One Selection Screen for all queries?

    Hi Experts,
    I have three queries having selection screens. All the selection screen have the same variables, but the reports are different.
    I have created a workbook having these three queries. Each time when the workbook opens, the three selection screen pops up one after the another. Same values are entered in all the selection screens.
    Now the user wants only one selection screen for all the three reports. Is it possible? I tried but I do not see any way.
    I think there should be some way of getting it done.
    Waiting for your inputs,
    With kind regards,
    Shreeem

    Hi
    If a workbook contains multiple queries that use the same variable, you are prompted to enter the variable values again for each query. To avoid this, set the Display Duplicate Variables Only Once flag.
    Goto Workbook Settings>Under Variables Tab>select Display Duplicate Variables only Once
    http://help.sap.com/saphelp_nw70ehp1/helpdata/EN/54/a493f7256b43698191a2623e5a0532/frameset.htm
    Hope this helps,
    Aparna Duvvuri

  • Bursting a report with multiple queries

    Hi,
    I need to set-up bursting in BIP for a report with multiple queries. The output format is pdf and delivery is through e-mail. Since the queries need to be linked, I'm trying to do this using data template. I've set-up split and burst based on a field (store_id) from the first query which is used as a bind variable in the subsequent queries. So I'd ideally want the report to be split based on store_id. The report works fine if I use a parameter for store_id and view the output by store_id. When I try to schedule the report for bursting, it generates and e-mails the reports but only the last report appears to have correct data output while the others have only the output from the first query (and all other queries appear to return nothing in the report).
    Any suggestions on what could be the issue here? Thanks!
    Here is the data template for the report:
    <dataTemplate name="Report" description="Report" dataSourceRef="ReportDB">
    <dataQuery>
    <sqlStatement name="STORE_VENDOR">
    <![CDATA[SELECT STORE.STORE_ID Q1_STORE_ID, VENDOR.VENDOR_ID Q1_VENDOR_ID, VENDOR.VENDOR_DESC Q1_VENDOR_DESC, PERSON.NAME Q1_NAME
                   FROM STORE, SERVICE_TICKET, VENDOR, ROLE, ROLE_TYPE, PERSON, PERIOD PERIOD_FROM, PERIOD PERIOD_TO
                   WHERE (SERVICE_TICKET.SOURCE_ID = STORE.SOURCE_ID AND SERVICE_TICKET.STORE_ID = STORE.STORE_ID)
                   AND (SERVICE_TICKET.SOURCE_ID = VENDOR.SOURCE_ID AND SERVICE_TICKET.VENDOR_ID = VENDOR.VENDOR_ID)
                   AND (STORE.SOURCE_ID = ROLE.SOURCE_ID AND STORE.STORE_ID = ROLE.STORE_ID)
                   AND (ROLE.SOURCE_ID = ROLE_TYPE.SOURCE_ID AND ROLE.ROLE_TYPE_ID = ROLE_TYPE.TYPE_ID AND ROLE_TYPE.TYPE_DESC = 'PIC')
                   AND (ROLE.SOURCE_ID = PERSON.SOURCE_ID AND ROLE.PERSON_ID = PERSON.PERSON_ID)
                   AND SERVICE_TICKET.START_DATE BETWEEN PERIOD_FROM.START_DATE AND PERIOD_TO.END_DATE
                   AND PERIOD_FROM.PERIOD_DESC = 'Cal Week 1'
                   AND PERIOD_TO.PERIOD_DESC = 'Cal Week 4'
                   GROUP BY STORE.STORE_ID, VENDOR.VENDOR_ID, VENDOR.VENDOR_DESC, PERSON.NAME
                   ORDER BY STORE.STORE_ID]]>
    </sqlStatement>
    <sqlStatement name="WO">
    <![CDATA[SELECT STORE.STORE_ID Q3_STORE_ID, 'Nightly Cleaning' Q3_NIGHTLY_CLEANING, 'Nightly Cleaning' Q3_DESCRIPTION, SERVICE_TICKET.TICKET_ID Q3_TICKET_ID, TO_CHAR(SERVICE_TICKET.END_DATE, 'MM/DD/YYYY') Q3_END_DATE, 'Excellent' Q3_QUALITY_RATING_1, 'Satisfactory' Q3_QUALITY_RATING_2, 'Unsatisfactory' Q3_QUALITY_RATING_3
                   FROM SERVICE_TICKET, STORE, PERIOD PERIOD_FROM, PERIOD PERIOD_TO
                   WHERE (SERVICE_TICKET.SOURCE_ID = STORE.SOURCE_ID AND SERVICE_TICKET.STORE_ID = STORE.STORE_ID)
                   AND SERVICE_TICKET.START_DATE BETWEEN PERIOD_FROM.START_DATE AND PERIOD_TO.END_DATE
                   AND STORE.STORE_ID = :Q1_STORE_ID
                   AND PERIOD_FROM.PERIOD_DESC = 'Cal Week 1'
                   AND PERIOD_TO.PERIOD_DESC = 'Cal Week 4']]>
    </sqlStatement>
    <sqlStatement name="SERVC_TYPE_1">
    <![CDATA[SELECT STORE.STORE_ID Q4_STORE_ID, ZONE.ZONE_DESC Q4_ZONE_DESC, SERVICE_TICKET_LINE.SERVICE_COST Q4_SERVICE_COST, SERVICE_TICKET_LINE.TICKET_ID Q4_TICKET_ID, TO_CHAR(SERVICE_TICKET_LINE.WO_END_DATE, 'MM/DD/YYYY') Q4_WO_END_DATE, 'Excellent' Q4_QUALITY_RATING_1, 'Satisfactory' Q4_QUALITY_RATING_2, 'Unsatisfactory' Q4_QUALITY_RATING_3
                   FROM SERVICE_TICKET_LINE, SERVICE_TICKET, STORE, SERVICE_TYPE, ZONE, PERIOD PERIOD_FROM, PERIOD PERIOD_TO
                   WHERE (SERVICE_TICKET.SOURCE_ID = SERVICE_TICKET_LINE.SOURCE_ID AND SERVICE_TICKET.TICKET_ID = SERVICE_TICKET_LINE.TICKET_ID)
                   AND (SERVICE_TICKET.SOURCE_ID = STORE.SOURCE_ID AND SERVICE_TICKET.STORE_ID = STORE.STORE_ID)
                   AND (SERVICE_TICKET_LINE.SOURCE_ID = SERVICE_TYPE.SOURCE_ID AND SERVICE_TICKET_LINE.SERVICE_TYPE_ID = SERVICE_TYPE.TYPE_ID)
                   AND (SERVICE_TICKET_LINE.SOURCE_ID = ZONE.SOURCE_ID AND SERVICE_TICKET_LINE.ZONE_ID = ZONE.ZONE_ID)
                   AND SERVICE_TYPE.TYPE_DESC = 'ABC'
                   AND SERVICE_TICKET.START_DATE BETWEEN PERIOD_FROM.START_DATE AND PERIOD_TO.END_DATE
                   AND STORE.STORE_ID = :Q1_STORE_ID
                   AND PERIOD_FROM.PERIOD_DESC = 'Cal Week 1'
                   AND PERIOD_TO.PERIOD_DESC = 'Cal Week 4'
                   ORDER BY SERVICE_TICKET_LINE.SOURCE_ID, SERVICE_TICKET_LINE.TICKET_ID, SERVICE_TICKET_LINE.LINE_ID]]>
    </sqlStatement>
    <sqlStatement name="SERVC_TYPE_2">
    <![CDATA[SELECT STORE.STORE_ID Q5_STORE_ID, ZONE.ZONE_DESC Q5_ZONE_DESC, SERVICE_TICKET_LINE.SERVICE_COST Q5_SERVICE_COST, SERVICE_TICKET_LINE.TICKET_ID Q5_TICKET_ID, TO_CHAR(SERVICE_TICKET_LINE.WO_END_DATE, 'MM/DD/YYYY') Q5_WO_END_DATE, 'Excellent' Q5_QUALITY_RATING_1, 'Satisfactory' Q5_QUALITY_RATING_2, 'Unsatisfactory' Q5_QUALITY_RATING_3
                   FROM SERVICE_TICKET_LINE, SERVICE_TICKET, STORE, SERVICE_TYPE, ZONE, PERIOD PERIOD_FROM, PERIOD PERIOD_TO
                   WHERE (SERVICE_TICKET.SOURCE_ID = SERVICE_TICKET_LINE.SOURCE_ID AND SERVICE_TICKET.TICKET_ID = SERVICE_TICKET_LINE.TICKET_ID)
                   AND (SERVICE_TICKET.SOURCE_ID = STORE.SOURCE_ID AND SERVICE_TICKET.STORE_ID = STORE.STORE_ID)
                   AND (SERVICE_TICKET_LINE.SOURCE_ID = SERVICE_TYPE.SOURCE_ID AND SERVICE_TICKET_LINE.SERVICE_TYPE_ID = SERVICE_TYPE.TYPE_ID)
                   AND (SERVICE_TICKET_LINE.SOURCE_ID = ZONE.SOURCE_ID AND SERVICE_TICKET_LINE.ZONE_ID = ZONE.ZONE_ID)
                   AND SERVICE_TYPE.TYPE_DESC = 'XYZ'
                   AND SERVICE_TICKET.START_DATE BETWEEN PERIOD_FROM.START_DATE AND PERIOD_TO.END_DATE
                   AND STORE.STORE_ID = :Q1_STORE_ID
                   AND PERIOD_FROM.PERIOD_DESC = 'Cal Week 1'
                   AND PERIOD_TO.PERIOD_DESC = 'Cal Week 4'
                   ORDER BY SERVICE_TICKET_LINE.SOURCE_ID, SERVICE_TICKET_LINE.TICKET_ID, SERVICE_TICKET_LINE.LINE_ID]]>
    </sqlStatement>
    <sqlStatement name="SERVC_TYPE_3">
    <![CDATA[SELECT STORE.STORE_ID Q6_STORE_ID, ZONE.ZONE_DESC Q6_ZONE_DESC, 'Excellent' Q6_QUALITY_RATING_1, 'Satisfactory' Q6_QUALITY_RATING_2, 'Unsatisfactory' Q6_QUALITY_RATING_3, 'One' Q6_QTY_MISSING_1, 'Two' Q6_QTY_MISSING_2, '3 or More' Q6_QTY_MISSING_3
                   FROM SERVICE_TICKET_LINE, SERVICE_TICKET, STORE, SERVICE_TYPE, ZONE, PERIOD PERIOD_FROM, PERIOD PERIOD_TO
                   WHERE (SERVICE_TICKET.SOURCE_ID = SERVICE_TICKET_LINE.SOURCE_ID AND SERVICE_TICKET.TICKET_ID = SERVICE_TICKET_LINE.TICKET_ID)
                   AND (SERVICE_TICKET.SOURCE_ID = STORE.SOURCE_ID AND SERVICE_TICKET.STORE_ID = STORE.STORE_ID)
                   AND (SERVICE_TICKET_LINE.SOURCE_ID = SERVICE_TYPE.SOURCE_ID AND SERVICE_TICKET_LINE.SERVICE_TYPE_ID = SERVICE_TYPE.TYPE_ID)
                   AND (SERVICE_TICKET_LINE.SOURCE_ID = ZONE.SOURCE_ID AND SERVICE_TICKET_LINE.ZONE_ID = ZONE.ZONE_ID)
                   AND SERVICE_TYPE.TYPE_DESC = 'PQR'
                   AND SERVICE_TICKET.START_DATE BETWEEN PERIOD_FROM.START_DATE AND PERIOD_TO.END_DATE
                   AND STORE.STORE_ID = :Q1_STORE_ID
                   AND PERIOD_FROM.PERIOD_DESC = 'Cal Week 1'
                   AND PERIOD_TO.PERIOD_DESC = 'Cal Week 4'
                   ORDER BY SERVICE_TYPE.TYPE_ID]]>
    </sqlStatement>
    </dataQuery>
    <dataStructure>
         <group name="G_STORE_VENDOR" source="STORE_VENDOR">
              <element name="Q1_STORE_ID" value="Q1_STORE_ID"/>
              <element name="Q1_VENDOR_ID" value="Q1_VENDOR_ID"/>
              <element name="Q1_VENDOR_DESC" value="Q1_VENDOR_DESC"/>
              <element name="Q1_NAME" value="Q1_NAME"/>
         </group>     
         <group name="G_WO" source="WO">
              <element name="Q3_NIGHTLY_CLEANING" value="Q3_NIGHTLY_CLEANING"/>
              <element name="Q3_DESCRIPTION" value="Q3_DESCRIPTION"/>
              <element name="Q3_TICKET_ID" value="Q3_TICKET_ID"/>
              <element name="Q3_END_DATE" value="Q3_END_DATE"/>
              <element name="Q3_QUALITY_RATING_1" value="Q3_QUALITY_RATING_1"/>
              <element name="Q3_QUALITY_RATING_2" value="Q3_QUALITY_RATING_2"/>
              <element name="Q3_QUALITY_RATING_3" value="Q3_QUALITY_RATING_3"/>
         </group>     
         <group name="G_SERVC_TYPE_1" source="SERVC_TYPE_1">
              <element name="Q4_ZONE_DESC" value="Q4_ZONE_DESC"/>
              <element name="Q4_SERVICE_COST" value="Q4_SERVICE_COST"/>
              <element name="Q4_TICKET_ID" value="Q4_TICKET_ID"/>
              <element name="Q4_WO_END_DATE" value="Q4_WO_END_DATE"/>
              <element name="Q4_QUALITY_RATING_1" value="Q4_QUALITY_RATING_1"/>
              <element name="Q4_QUALITY_RATING_2" value="Q4_QUALITY_RATING_2"/>
              <element name="Q4_QUALITY_RATING_3" value="Q4_QUALITY_RATING_3"/>
         </group>     
         <group name="G_SERVC_TYPE_2" source="SERVC_TYPE_2">
              <element name="Q5_ZONE_DESC" value="Q5_ZONE_DESC"/>
              <element name="Q5_SERVICE_COST" value="Q5_SERVICE_COST"/>
              <element name="Q5_TICKET_ID" value="Q5_TICKET_ID"/>
              <element name="Q5_WO_END_DATE" value="Q5_WO_END_DATE"/>
              <element name="Q5_QUALITY_RATING_1" value="Q5_QUALITY_RATING_1"/>
              <element name="Q5_QUALITY_RATING_2" value="Q5_QUALITY_RATING_2"/>
              <element name="Q5_QUALITY_RATING_3" value="Q5_QUALITY_RATING_3"/>
         </group>     
         <group name="G_SERVC_TYPE_3" source="SERVC_TYPE_3">
              <element name="Q6_ZONE_DESC" value="Q6_ZONE_DESC"/>
              <element name="Q6_QUALITY_RATING_1" value="Q6_QUALITY_RATING_1"/>
              <element name="Q6_QUALITY_RATING_2" value="Q6_QUALITY_RATING_2"/>
              <element name="Q6_QUALITY_RATING_3" value="Q6_QUALITY_RATING_3"/>
              <element name="Q6_QTY_MISSING_1" value="Q6_QTY_MISSING_1"/>
              <element name="Q6_QTY_MISSING_2" value="Q6_QTY_MISSING_2"/>
              <element name="Q6_QTY_MISSING_3" value="Q6_QTY_MISSING_3"/>
         </group>
    </dataStructure>
    </dataTemplate>

    Hello user6428199,
    When you use ":Q1_STORE_ID" in your queries, BI Publisher looks for a report parameter named Q1_STORE_ID. Change all your report queries to get data for all the store_id's available. As you are bursting the report using the store_id as the bursting key, BI Publisher will split the report based on the stored_id and delivers content based on it. No matter how many queries you may have, BI Publisher will loop through all the store_id's available and all the queries will return data for that particular id in a report.
    Thanks,
    Machaan

  • Multiple queries with 1 connection

    Can I execute multiple queries with one connection?
    //Example -
    <%
    String firstconn;
    Class.forName("org.gjt.mm.mysql.Driver");
    // create connection string
    firstconn = "jdbc:mysql://localhost/profile?user=mark&password=mstringham";
    // pass database parameters to JDBC driver
    Connection aConn = DriverManager.getConnection(firstconn);
    // query statement
    Statement firstSQLStatement = aConn.createStatement();
    String firstquery = "UPDATE auth_users SET last_log='" + rightnow + "'WHERE name='" + username + "' ";
    // get result code
    int firstSQLStatus = firstSQLStatement.executeUpdate(firstquery);
    // close connection
    firstSQLStatement.close();
    %>     
    Now, instead of building a new connection for each query, can I use the same connection info for another query?
    if so - how do you do this?
    thanks for any help.
    Mark

    Create multiple statement objects from your connection. It's a good idea to close these in a finally block after you're done with them
    Connection conn = null;
    Statement stmt1 = null;
    Statement stmt2 = null;
    try {
        conn = DriverManager.getConnection();
        stmt1 = conn.createStatement();
        // some sql here
        stmt2 = conn.createStatement();
        // some more sql here
    } finally {
        if ( stmt1 != null ) stmt1.close();
        if ( stmt2 != null ) stmt2.close();

Maybe you are looking for