Parellelism vs multiple queries using scheduler

Hi,
I am trying to run a query that is going to insert the data in a table (TEMP_RESULT).
At very high level lets just say that I have compare each row from "t_customer" with each row in "t_region". The result is inserted into a table.
I am HASH PARTITIONING "t_customer" (32 partitions) on 'Customer_ID' and "t_region" on 'REGION_ID' (16 partitions).
I am trying to get the best timing possible. The question is should I just let oracle use PARALLELISM and run this in one chunk or should I loop?
My current approcah is I loop through each 'Customer_ID' and compare it against all 'REGION_ID'. Assume nothing else is running on the Database, then what otion would be the best:
1) Let it just run through 1 process?
2) Would it be bettter if I start a second process for another 'CUSTOMER_ID' and have a few of these running simultaneously?
3) Another option I am trying to consider is to run 4 processes each process will handle a partition of the REGION table. I just need to somehow identify which 'REGION_ID' would fall in what partition and pass the values such that I have my where clasue something like "WHERE region_id between :min_region_id and :max_region_id"
with t_customer as
The customer table.  For the sake of simplicity I only have 5 codes per customer.
My real values are 7385 customers with 1269 codes.
Total number of rows is 7385*1269 = 9,371,565
SELECT 1 as customer_id, 201 as internal_code, 1 as fee from dual union all
SELECT 1 as customer_id, 202 as internal_code, 3 as fee from dual union all
SELECT 1 as customer_id, 203 as internal_code, 5 as fee from dual union all
SELECT 1 as customer_id, 204 as internal_code, 7 as fee from dual union all
SELECT 1 as customer_id, 205 as internal_code, 11 as fee from dual union all
SELECT 2 as customer_id, 201 as internal_code, 11 as fee from dual union all
SELECT 2 as customer_id, 202 as internal_code, 7 as fee from dual union all
SELECT 2 as customer_id, 203 as internal_code, 5 as fee from dual union all
SELECT 2 as customer_id, 204 as internal_code, 3 as fee from dual union all
SELECT 2 as customer_id, 205 as internal_code, 1 as fee from dual
, t_region as
The customer table.  For the sake of simplicity I only have 5 codes per region.
My real values are 3497 regions with 1269 codes.
Total number of rows is 3497*1269 = 4,437,693
SELECT 95 as region_id, 201 as internal_code, 0 as fee from dual union all
SELECT 95 as region_id, 202 as internal_code, 2 as fee from dual union all
SELECT 95 as region_id, 203 as internal_code, 4 as fee from dual union all
SELECT 95 as region_id, 204 as internal_code, 6 as fee from dual union all
SELECT 95 as region_id, 205 as internal_code, 8 as fee from dual union all
SELECT 96 as region_id, 201 as internal_code, 8 as fee from dual union all
SELECT 96 as region_id, 202 as internal_code, 6 as fee from dual union all
SELECT 96 as region_id, 203 as internal_code, 4 as fee from dual union all
SELECT 96 as region_id, 204 as internal_code, 2 as fee from dual union all
SELECT 96 as region_id, 205 as internal_code, 0 as fee from dual
The claculation
Compare each cutomer with each region for each code
Let's keep that simple too.
Row Count is Count(Distinct Customer ID) * Count(Distinct Region ID) * Count(Distinct Internal Code)
Sample: 2 * 2 * 5 = 20
Real:   7385 * 3497 * 1269 = 32,772,362,805
SELECT
         c.customer_id
       , r.region_id
       , c.internal_code
       , c.fee AS customer_fee
       , r.fee AS region_fee
       , c.fee - r.fee AS diff
    FROM t_customer c INNER JOIN t_region r ON c.internal_code = r.internal_codeWell there it is a sample that shows my problem, at a very basic level. The calculation itself is not very complicated, but what is stalling me is the size of the data.
Thanks.

The calculation is not as simple as it was stated here. I do need to store it, becuase we want to keep track of changes to the calculation.
Here is what the calculation is really like.
You were right, just the the base join the PARTITION-WISE join worked great. Howevere, I have to also group the data with another set. That's where the timing is really killing me.
The "internal_code" table is only about 12,000 records, do you think partitioning that table would be of any help.
Any suggestions would be helpful.
with t_customer as
The customer table.  For the sake of simplicity I only have 5 codes per customer.
My real values are 7385 customers with 1269 codes.
Total number of rows is 7385*1269 = 9,371,565
SELECT 1 as customer_id, 201 as internal_code, 1 as fee, 5 as base_fee, 10 as pct, 5 as default_pct from dual union all
SELECT 1 as customer_id, 202 as internal_code, 0 as fee, 5 as base_fee, 10 as pct, 5 as default_pct from dual union all
SELECT 1 as customer_id, 203 as internal_code, 5 as fee, 5 as base_fee, 10 as pct, 5 as default_pct from dual union all
SELECT 1 as customer_id, 204 as internal_code, 7 as fee, 5 as base_fee, 10 as pct, 5 as default_pct from dual union all
SELECT 1 as customer_id, 205 as internal_code, 11 as fee,5 as base_fee, 10 as pct, 5 as default_pct  from dual union all
SELECT 2 as customer_id, 201 as internal_code, 11 as fee,5 as base_fee, 10 as pct, 5 as default_pct  from dual union all
SELECT 2 as customer_id, 202 as internal_code, 0 as fee, 5 as base_fee, 10 as pct, 5 as default_pct  from dual union all
SELECT 2 as customer_id, 203 as internal_code, 5 as fee, 5 as base_fee, 10 as pct, 5 as default_pct  from dual union all
SELECT 2 as customer_id, 204 as internal_code, 3 as fee, 5 as base_fee, 10 as pct, 5 as default_pct  from dual union all
SELECT 2 as customer_id, 205 as internal_code, 1 as fee, 5 as base_fee, 10 as pct, 5 as default_pct  from dual
, t_region as
The customer table.  For the sake of simplicity I only have 5 codes per region.
My real values are 3497 regions with 1269 codes.
Total number of rows is 3497*1269 = 4,437,693
SELECT 95 as region_id, 201 as internal_code, 0 as fee, 5 as pct from dual union all
SELECT 95 as region_id, 202 as internal_code, 2 as fee, 5 as pct from dual union all
SELECT 95 as region_id, 203 as internal_code, 4 as fee, 5 as pct from dual union all
SELECT 95 as region_id, 204 as internal_code, 6 as fee, 5 as pct from dual union all
SELECT 95 as region_id, 205 as internal_code, 8 as fee, 5 as pct from dual union all
SELECT 96 as region_id, 201 as internal_code, 8 as fee, 5 as pct from dual union all
SELECT 96 as region_id, 202 as internal_code, 6 as fee, 5 as pct from dual union all
SELECT 96 as region_id, 203 as internal_code, 4 as fee, 5 as pct from dual union all
SELECT 96 as region_id, 204 as internal_code, 2 as fee, 5 as pct from dual union all
SELECT 96 as region_id, 205 as internal_code, 0 as fee, 5 as pct from dual
There are about 1269 unique internal_codes and they belong to different groups.
The table size for internal code is 12,000 records.
, t_internal_code
as
SELECT 1 as grp_id, 201 as internal_code, .5 as rate FROM DUAL UNION ALL
SELECT 1 as grp_id, 202 as internal_code, .5 as rate FROM DUAL UNION ALL
SELECT 1 as grp_id, 203 as internal_code, .2 as rate FROM DUAL UNION ALL
SELECT 1 as grp_id, 204 as internal_code, .3 as rate FROM DUAL UNION ALL
SELECT 1 as grp_id, 205 as internal_code, .1 as rate FROM DUAL UNION ALL
SELECT 2 as grp_id, 201 as internal_code, .5 as rate FROM DUAL UNION ALL
SELECT 2 as grp_id, 202 as internal_code, .5 as rate FROM DUAL
   , t_base_calc AS 
The claculation
Compare each cutomer with each region for each code
Let's keep that simple too.
Row Count is Count(Distinct Customer ID) * Count(Distinct Region ID) * Count(Distinct Internal Code)
Sample: 2 * 2 * 5 = 20
Real:   7385 * 3497 * 1269 = 32,772,362,805
     (SELECT customer_id
           , region_id
           , internal_code
           , customer_adjusted_fee
           , region_adjusted_fee
           , customer_adjusted_fee - region_adjusted_fee AS base_calc
        FROM (SELECT c.customer_id
                   , r.region_id
                   , c.internal_code
                   , c.fee AS customer_fee
                   , r.fee AS region_fee
                   , c.pct AS customer_pct
                   , r.pct AS region_pct
                   , c.base_fee
                   , c.default_pct
                   , CASE c.fee
                        WHEN 0
                           THEN (CASE r.fee
                                    WHEN 0
                                       THEN (CASE c.pct
                                                WHEN 0
                                                   THEN c.default_pct
                                                ELSE c.pct
                                             END) * c.base_fee / 100
                                    ELSE r.fee
                                 END) * c.pct / 100
                        ELSE c.fee
                     END AS customer_adjusted_fee
                   , CASE r.fee
                        WHEN 0
                           THEN (CASE c.pct
                                    WHEN 0
                                       THEN c.default_pct
                                    ELSE c.pct
                                 END) * c.base_fee / 100
                        ELSE r.fee
                     END AS region_adjusted_fee
                FROM t_customer c INNER JOIN t_region r ON c.internal_code = r.internal_code
             ) z
       WHERE customer_adjusted_fee - region_adjusted_fee > 0)
   , t_calcs AS
     (SELECT   bc.customer_id
             , bc.region_id
             , ic.grp_id
             , SUM (ic.rate) AS calc_2
             , SUM (bc.base_calc * ic.rate) / SUM (ic.rate) AS calc_3
             , SUM (CASE
                       WHEN bc.base_calc > 50
                          THEN ic.rate
                       ELSE 0
                    END) AS calc_4
          FROM t_base_calc bc INNER JOIN t_internal_code ic ON bc.internal_code = ic.internal_code
      GROUP BY bc.customer_id
             , bc.region_id
             , ic.grp_id)
SELECT *
  FROM t_calcsMessage was edited by:
pshah2k

Similar Messages

  • Insert multiple queries using either WORKBOOK, WAD or Report Designer

    Hello Guys
    I have a task where I have to insert multiple queries into one single page/sheet & print it out later. For this I can use any one of the tools available: Workbook, WAD or Report Designer.
    1. Workbook - Here I have read that we can use a call back MACRO and some other features.
    2. WAD - Here I have read that we can use: 1. Multiple data providers (one for each query) & 2. Multiple web analysis items linking to each individual data provider.
    3. Report Designer - Since this is the actual 'formatting' tool provided by SAP, I am assuming that this is the right environment to achieve my task.
    My question: Which one out of the above 3 tools is actually feasible? Can someone explain me in detail about how to go about this task. Any 'How to..' docs from SAP would also be most helpful.
    Regards.

    Hi Kashyap,
    I have done similar requirement in Workbook,it has better features and more user friendly than others......it depends on the individual...but U cna meet your requirement thru Workbooks...
    If the Req are complicated then we go for MAcros ,where in we can satify the critical req,say some sort of Dynamic reqs.
    There are lot of threads on Multiple queries in one Workbook....Just search in SDN and u will get lot of Threads on this topic.
    Come bak if u have any other doubts.
    Rgds
    SVU123

  • How to run multiple Thread using Scheduler's in 1.5

    Hi,
    I have a scenario, in which I have to run a Thread at every 15 minutes, If the first Thread is not Finished in 15 min then new Thread has to start.
    Currently I implemeted with java 1.5 schedulers, but the problem is if my first Thread is taking more than 15 min, then no new Thread is starting.
    Following is my Code:
    TestAccountingThread accountingThread = new TestAccountingThread();
    ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(10);
    scheduler.scheduleAtFixedRate( accountingThread, 0, 60, SECONDS );
    Can any one help on this, This is really urgent.
    Regards,
    Suman

    if my first Thread is taking more than 15 min, then no new Thread is startingIf it takes more than 15 min, manually run a new scheduler with initial-delay=0 and shutdown the current one when the current execution is finished --- and repeat this logic in a conditional loop.
    Could this be what you want?

  • Can we use multiple queries on one template

    Can we use multiple queries on one template

    Hi,
    if you're using data templates for your data set, you
    can put multiple queries in the XML data template.
    The queries may then be linked (or not) by the "link
    name" tag ...
    Grtz.Following you answer here...do you know eventually how/if possible to preview a report (with XMLP Desktop) that is using data templates for the data set?
    Thanks,
    Liviu

  • BEx Broadcaster - Using a Workbook with multiple queries on different tabs

    Hi,
    I was wondering if any has used Bex Broadcaster to broadcast a workbook that contains multiple queries on different tabs in the workbook.  I believe someone has mentioned that this was an issue in the past and I was wondering if this now a possibility with Bex Broadcaster
    If you were able to do this successfully, please let me know.
    Thanks

    Hello
    Of course it is possible.
    But, if you want to broadcast a workbook, you have to use a Precalculation Server.
    Without precalculation server, workbooks cannot be precalculated and broadcasted.
    More details, please check the note below:
    1461398          BW 7.X(7.20) Precalculation - General Info. & Limitations                              
    Best regards,
    Edward John

  • Cross tab data is getting multiplied if i use multiple queris in asingle report

    HI,
      i am using multiple queris for displaying data and graphs(charts).
      my requirement is to display 2 charts and data in crosstab in a single report.
      all the three thing (2charts and crosstab) will use diffrent values.
    I am writing 3 sql queries for getting appropriate values for charts and crosstab.
      Now the problem, both charts and crosstab are taking the values of all 3 queris
    i.e if i added crosstab  first to the report values are coming correctly. After  that if i add graph cross tab values are getting changed and graph values are not getting properly.
    if i add graph first then its coming correctly.
    if i tried to add all 3 components then values are going cores...... ?

    When you say you are writing 3 sql queries what do you mean? Are you creating 3 SQL command objects in the database expert? If so this is your problem, Crystal will pull a cartesian product through (this is every possible combinatin of rows from the 3 queries).
    If your 2 graphs and 1 crosstab are based on different datasets the way to approach this is to create each on a seperate report, then create a new blank report and add each of your 3 reports as subreports in the report footer.
    Hope this helps,
    Toby

  • Variable Sequence when using multiple queries

    Hi Experts,
    how can I adjust the variable sequence of a workbook that uses multiple queries (with variables of which each exists in at least two included queries)?
    E.g.:
    DP1 with variable sequence "A, B, D"
    DP_2 with variable sequence "A, C, D"
    DP_3 with variable sequence "B, C"
    I want "A, B, C, D" as the sequence for the workbook but i did not figure out how to adjust this.
    I already tried to insert a dummy DataProvider that holds all variables in the right sequence.. No success..
    Any help very appreciated!
    Marco

    Hi Mayank,
    thanks for your answer.
    I wonder how the displayed sequence of the common variables is derived from the underlying queries. Perhaps one can change the sequence of the variables by inserting the DataProviders in another sequence?!
    Regards,
    Marco

  • 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 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 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

  • 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

  • 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.

  • 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();

  • How do I display data from Multiple Queries in a spreadsheet?

    I am running Oracle forms 10g as a kicker to export a report (rdf 10.1.2.0.2) to PDF or Excel Spreadsheet - User's choice.
    Doesn't matter if I have desformat = SPREADSHEET, DELIMITEDDATA, or DELIMITED; I still get only the first query displayed when I run in spreadsheet format.
    How do I display data from Multiple Queries in a spreadsheet? Is this possible?
    Thanks in advance!

    Hi adam,
    did you search the forum? You will find a lot of threads handling the problem of Excel file access.
    In short: you need to use ActiveX (the RGT also uses ActiveX under the hood)!
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Report with Multiple queries too slow in BI Publisher 11g

    Hi, I have a report in 11g where i need to create multiple queries to show them in report. I tried to combine everything in one query, but i found that the query is too huge and hard to understand and maintain. I created 3 data sets and linked them together. In SQL dev, the main query is returning about 315 records and first detail query returns less than 100 records and second detail query is returning one record which is BLOB. Each query returns data within a couple of seconds from SQL Developer. The entire report from BI Publisher should be just 21 page PDF output. Did anyone face performance issues while running reports with multiple queries in 11g? I ran reports that have single query which returned 10K pages PDF and never had an issue while everthing is in one query. This is the first time Iam attempting to create multiple queries. Can someone help me understand what i might be doing wrong or missing here. Thank you.

    Isn't there a way for you to do this via a Package/Procedure versus having multiple queries?
    Per the BI Publisher guide,
    Following are recommended guidelines for building data models:
    Reduce the number of data sets or queries in your data model as much as possible. In general, the fewer data sets and queries you have, the faster your data model will run. While multiquery data models are often easier to understand, single-query data models tend to execute more quickly. It is important to understand that in parent-child queries, for every parent, the child query is executed.
    You should only use multiquery data models in the following scenarios:
    To perform functions that the query type, such as a SQL query, does not support directly.
    To support complex views (for example, distributed queries or GROUP BY queries).
    To simulate a view when you do not have or want to use a view.
    Thanks,
    Bipuser

Maybe you are looking for

  • Ipod shows up in My Computer not recognized by ITunes

    Video iPod was working then just stopped. ipod shows up in My Computer, initializes iTunes but is not recognized by iTunes Windows explorer will display file architecture of ipod but displays a "file corrupt" message if I attempt to view contents of

  • WPA2 support on HP Color LaserJet Pro MFP M476dw

    I am not able to find documentation that a HP Color LaserJet Pro MFP M476dw is supporting WPA2. That cannot be true in 2015. This protocol is the standard on every network. True or not? I do not want to buy the printer unless I am sure WPA2 is suppor

  • & symbol in XML code

    Hi, I am using DI server to create service calls. The cardcode = M&B. When i try to assign to tags ,<Cstmrcode>M&B</Cstmrcode> it gives an error. So i replaced "&" with '&". This time im getting an error that says "No matching record found". Any solu

  • Running Disk Cleanup: Windows 8

    Sometimes in troubleshooting it is a good idea to run the Disk Cleanup feature built into the Windows OS.  This is one of the advised steps to perform if one receives a Fatal Error when installing printers and is good to know how to do. The Printer S

  • Website monitor,Help!

    Hi guys! I would like to create a website monitor with Java. My idea is: This program, that run in background, should take in imput a file, that contains a list of URL, and then generates a sort of sign every time one of the URLs updates. Is there an