Link two identical databases, same tables, same fields

Post Author: CathyH
CA Forum: Data Connectivity and SQL
I have two Accpac databases (two different companies, one Canadian one US).  I have created the same report for both companies using their respective data tables and another where I have converted the US funds to Canadian. 
I would now like to create one report that links the two companies. 
I will be sorting on Customer.  Whenever a customer is set up in the US company a duplicate is set up in the Canadian company but Canadian customers are not duplicated in the US company (it's just something we have to do for billing purposes) so there will always be many more Canadian customers.
I would like the report to add together any matching customers in the US and Canadian companies but also report the customers that are strictly Canadian.
Can anyone help me?  Please!
Cathy

Post Author: synapsevampire
CA Forum: Data Connectivity and SQL
You might do this using advanced SQL on the database in a View or SP.
Or another, somewhat fugly solution is to create a main report with the canadian database, group by the company, insert a subreport using the US database at the group level (header or footer), and link by the company.
You can now respond to no rows in the subreport to indicate those that are not in the US database.
Ain't purdy, but it'll work.
-k

Similar Messages

  • How to give two values of same field in read Statment

    Hi,
    Please Tell me how to give the two values of same field in read statements Condition.
    i.e
      Read table it_tab with key matnr = '1' or matnr = '2'.
    With Regards
    Kesavaperumal

    Hi Kesavaperumal,
    <li>You can not use OR operator with READ TABLE statement.
    <li>You have to use different fields of the internal table in where condition.
    <li>If you want to compare with two values, you need to use LOOP statement.
    LOOP AT it_mara WHERE matnr = '1' or matnr = '2'.
    "Write code
    ENDLOOP.
    Thanks
    Venkat.O

  • BUG: "Don't Import Suspected Duplicates" FAILS for two identical files (same name, same MD5)

    Using LR 4.4, I'm seeing duplicate files not detected when the files have the same name and identical content (same MD5).
    Adobe support takes me here, although I'd rather file a bug.
    I've isolated a small test case where I have a directory with a small number of images (taken at the same time with the same camera.)
    I can copy this directory to a different location, then try to import it and one of the files will not be detected as a dupe.
    I've tried re-reading the metadata for the existing library file.
    Files have the same name and same checksums.

    According to the Lightroom documentation
    Lightroom determines a photo is a duplicate of another file in the catalog if it has the same, original filename; the same Exif capture date and time; and the same file size
    Please confirm that your "duplicate" files meet this criterion

  • Different optimizer paths between two identical databases

    Hello!
    I'm running into a problem with a query that is pretty amazing.  I have two different databases that I work with - Development and Acceptance.  According to my DBA, they are absolutely identical in every respect - including data.  Both of them gather statistics every night at the same time.
    On development my query executes beautifully - 0.6 seconds.
    On acceptance the query executes in 60 - 70 seconds.
    They both evalute completely differently thought an explain plan - obviously from the difference in performance.  Here are the two explain plans for the query...
    GOOD
    explain plan for
    select e.employee_name,
           e.worker_id       id,
           e.vac_ent         "Vac<BR>Ent",
           e.vac_taken       "Vac<BR>Taken",
           e.vac_presched    "Vac<BR>PreSched",
           e.vac_remain      "Vac<BR>Remain",
           e.banked_hours    "Banked<BR>Hours",
           e.banked_taken    "Banked<BR>Hours<BR>Taken",
           e.banked_presched "Banked<BR>Hours<BR>Presched",
           e.banked_remain   "Banked<BR>Hours<BR>Remain",
           e.edo_earned      "EDO<BR>Hours<BR>Earned",
           e.edo_taken       "EDO<BR>Hours<BR>Taken",
           e.edo_presched    "EDO<BR>Hours<BR>Presched",
           e.edo_remain      "EDO<BR>Hours<BR>Remain",
           e.ado_earned      "ADO<BR>Hours<BR>Earned",
           e.ado_taken       "ADO<BR>Hours<BR>Taken",
           e.ado_presched    "ADO<BR>Hours<BR>Presched",
           e.ado_remain      "ADO<BR>Hours<BR>Remain"
      from tas.benefit_summary_curr_year_v e /* USESYSDATEFORSECURITY */
    where 1 = 1
       and (e.worker_id in
           (select worker_id
               from worker_cost_centre_v ecc2
              where ecc2.cost_centre = '100033'
                and ((ecc2.effective_date <= dtutil.todate('2013/10/08') and
                    ecc2.expiration_date >= dtutil.todate('2013/10/08')) or
                    (ecc2.effective_date <= dtutil.todate('2013/11/08') and
                    ecc2.expiration_date >= dtutil.todate('2013/11/08')) or
                    (ecc2.effective_date >= dtutil.todate('2013/10/08') and
                    ecc2.expiration_date <= dtutil.todate('2013/11/08')))))
       and pkg_taw_security.user_worker_access('CA17062',
                                               'TIMEKEEPER',
                                               e.worker_id,
                                               trunc(sysdate)) = 1
    union
    select 'ZZZTOTALS',
           sum(e.vac_ent),
           sum(e.vac_taken),
           sum(e.vac_presched),
           sum(vac_remain),
           sum(e.banked_hours),
           sum(e.banked_taken),
           sum(e.banked_presched),
           sum(e.banked_remain),
           sum(e.edo_earned),
           sum(e.edo_taken),
           sum(e.edo_presched),
           sum(e.edo_remain),
           sum(e.ado_earned),
           sum(e.ado_taken),
           sum(e.ado_presched),
           sum(e.ado_remain)
      from tas.benefit_summary_curr_year_v e
    where 1 = 1
       and (e.worker_id in
           (select worker_id
               from worker_cost_centre_v ecc2
              where ecc2.cost_centre = '100033'
                and ((ecc2.effective_date <= dtutil.todate('2013/10/08') and
                    ecc2.expiration_date >= dtutil.todate('2013/10/08')) or
                    (ecc2.effective_date <= dtutil.todate('2013/11/08') and
                    ecc2.expiration_date >= dtutil.todate('2013/11/08')) or
                    (ecc2.effective_date >= dtutil.todate('2013/10/08') and
                    ecc2.expiration_date <= dtutil.todate('2013/11/08')))))
       and pkg_taw_security.user_worker_access('CA17062',
                                               'TIMEKEEPER',
                                               e.worker_id,
                                               trunc(sysdate)) = 1
    order by 1;
    select * from table(dbms_xplan.display);
    GOOD PLAN_TABLE_OUTPUT
    Plan hash value: 432971565
    | Id  | Operation                            | Name                   | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT                     |                        |     2 |   274 |    14  (43)| 00:00:01 |
    |   1 |  SORT UNIQUE                         |                        |     2 |   274 |    13  (70)| 00:00:01 |
    |   2 |   UNION-ALL                          |                        |       |       |            |          |
    |   3 |    HASH GROUP BY                     |                        |     1 |    66 |     6  (34)| 00:00:01 |
    |   4 |     NESTED LOOPS                     |                        |       |       |            |          |
    |   5 |      NESTED LOOPS                    |                        |     1 |    66 |     4   (0)| 00:00:01 |
    |   6 |       NESTED LOOPS                   |                        |     1 |    44 |     3   (0)| 00:00:01 |
    |*  7 |        TABLE ACCESS BY INDEX ROWID   | WORKER_COST_CENTRE_TBL |     1 |    29 |     2   (0)| 00:00:01 |
    |*  8 |         INDEX RANGE SCAN             | WORKER_CC_CC_IDX       |    29 |       |     1   (0)| 00:00:01 |
    |*  9 |        INDEX RANGE SCAN              | BENEFIT_IND            |     1 |    15 |     1   (0)| 00:00:01 |
    |* 10 |       INDEX UNIQUE SCAN              | WORKER_PK              |     1 |       |     1   (0)| 00:00:01 |
    |  11 |      TABLE ACCESS BY INDEX ROWID     | WORKER_TBL             |     1 |    22 |     1   (0)| 00:00:01 |
    |  12 |    SORT AGGREGATE                    |                        |     1 |   208 |     7  (43)| 00:00:01 |
    |  13 |     VIEW                             | VM_NWVW_0              |     1 |   208 |     6  (34)| 00:00:01 |
    |  14 |      HASH GROUP BY                   |                        |     1 |    66 |     6  (34)| 00:00:01 |
    |  15 |       NESTED LOOPS                   |                        |       |       |            |          |
    |  16 |        NESTED LOOPS                  |                        |     1 |    66 |     5  (20)| 00:00:01 |
    |  17 |         NESTED LOOPS                 |                        |     1 |    44 |     4  (25)| 00:00:01 |
    |  18 |          SORT UNIQUE                 |                        |     1 |    29 |     2   (0)| 00:00:01 |
    |* 19 |           TABLE ACCESS BY INDEX ROWID| WORKER_COST_CENTRE_TBL |     1 |    29 |     2   (0)| 00:00:01 |
    |* 20 |            INDEX RANGE SCAN          | WORKER_CC_CC_IDX       |    29 |       |     1   (0)| 00:00:01 |
    |* 21 |          INDEX RANGE SCAN            | BENEFIT_IND            |     1 |    15 |     1   (0)| 00:00:01 |
    |* 22 |         INDEX UNIQUE SCAN            | WORKER_PK              |     1 |       |     1   (0)| 00:00:01 |
    |  23 |        TABLE ACCESS BY INDEX ROWID   | WORKER_TBL             |     1 |    22 |     1   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       7 - filter("X"."EFFECTIVE_DATE"<="DTUTIL"."TODATE"('2013/10/08') AND
                  "X"."EXPIRATION_DATE">="DTUTIL"."TODATE"('2013/10/08') OR
                  "X"."EFFECTIVE_DATE"<="DTUTIL"."TODATE"('2013/11/08') AND
                  "X"."EXPIRATION_DATE">="DTUTIL"."TODATE"('2013/11/08') OR
                  "X"."EFFECTIVE_DATE">="DTUTIL"."TODATE"('2013/10/08') AND
                  "X"."EXPIRATION_DATE"<="DTUTIL"."TODATE"('2013/11/08'))
       8 - access("X"."COST_CENTRE"='100033')
       9 - access("X"."WORKER_ID"="X"."WORKER_ID")
           filter(TO_CHAR(INTERNAL_FUNCTION("X"."ACTIVITY_DATE"),'YYYY')>=TO_CHAR(SYSDATE@!,'YYYY') AND
                  "PKG_TAW_SECURITY"."USER_WORKER_ACCESS"('CA17062','TIMEKEEPER',"X"."WORKER_ID",TRUNC(SYSDATE@!))=1)
      10 - access("X"."WORKER_ID"="X"."WORKER_ID")
      19 - filter("X"."EFFECTIVE_DATE"<="DTUTIL"."TODATE"('2013/10/08') AND
                  "X"."EXPIRATION_DATE">="DTUTIL"."TODATE"('2013/10/08') OR
                  "X"."EFFECTIVE_DATE"<="DTUTIL"."TODATE"('2013/11/08') AND
                  "X"."EXPIRATION_DATE">="DTUTIL"."TODATE"('2013/11/08') OR
                  "X"."EFFECTIVE_DATE">="DTUTIL"."TODATE"('2013/10/08') AND
                  "X"."EXPIRATION_DATE"<="DTUTIL"."TODATE"('2013/11/08'))
      20 - access("X"."COST_CENTRE"='100033')
      21 - access("X"."WORKER_ID"="X"."WORKER_ID")
           filter(TO_CHAR(INTERNAL_FUNCTION("X"."ACTIVITY_DATE"),'YYYY')>=TO_CHAR(SYSDATE@!,'YYYY') AND
                  "PKG_TAW_SECURITY"."USER_WORKER_ACCESS"('CA17062','TIMEKEEPER',"X"."WORKER_ID",TRUNC(SYSDATE@!))=1)
      22 - access("X"."WORKER_ID"="X"."WORKER_ID")
    The bad plan - based off the same query but run against a different database.
    Bad PLAN_TABLE_OUTPUT
    Plan hash value: 3742309457
    | Id  | Operation                        | Name                        | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT                 |                             |     4 |  1158 |       | 10065   (2)| 00:02:01 |
    |   1 |  SORT UNIQUE                     |                             |     4 |  1158 |       | 10064  (51)| 00:02:01 |
    |   2 |   UNION-ALL                      |                             |       |       |       |            |          |
    |*  3 |    HASH JOIN                     |                             |     3 |   915 |       |  5031   (2)| 00:01:01 |
    |   4 |     JOIN FILTER CREATE           | :BF0000                     |     1 |    29 |       |     2   (0)| 00:00:01 |
    |*  5 |      TABLE ACCESS BY INDEX ROWID | WORKER_COST_CENTRE_TBL      |     1 |    29 |       |     2   (0)| 00:00:01 |
    |*  6 |       INDEX RANGE SCAN           | WORKER_CC_CC_IDX            |    28 |       |       |     1   (0)| 00:00:01 |
    |*  7 |     VIEW                         | BENEFIT_SUMMARY_CURR_YEAR_V |   204K|    53M|       |  5027   (1)| 00:01:01 |
    |   8 |      HASH GROUP BY               |                             |   204K|  7403K|  9656K|  5027   (1)| 00:01:01 |
    |   9 |       JOIN FILTER USE            | :BF0000                     |   204K|  7403K|       |  3040   (2)| 00:00:37 |
    |* 10 |        HASH JOIN                 |                             |   204K|  7403K|  5392K|  3040   (2)| 00:00:37 |
    |  11 |         TABLE ACCESS FULL        | WORKER_TBL                  |   162K|  3485K|       |   584   (1)| 00:00:08 |
    |* 12 |         INDEX FULL SCAN          | BENEFIT_IND                 |   204K|  3001K|       |  1927   (2)| 00:00:24 |
    |  13 |    SORT AGGREGATE                |                             |     1 |   243 |       |  5032   (2)| 00:01:01 |
    |* 14 |     HASH JOIN RIGHT SEMI         |                             |    16 |  3888 |       |  5031   (2)| 00:01:01 |
    |  15 |      JOIN FILTER CREATE          | :BF0001                     |     1 |    29 |       |     2   (0)| 00:00:01 |
    |* 16 |       TABLE ACCESS BY INDEX ROWID| WORKER_COST_CENTRE_TBL      |     1 |    29 |       |     2   (0)| 00:00:01 |
    |* 17 |        INDEX RANGE SCAN          | WORKER_CC_CC_IDX            |    28 |       |       |     1   (0)| 00:00:01 |
    |* 18 |      VIEW                        | BENEFIT_SUMMARY_CURR_YEAR_V |   204K|    41M|       |  5027   (1)| 00:01:01 |
    |  19 |       HASH GROUP BY              |                             |   204K|  7403K|  9656K|  5027   (1)| 00:01:01 |
    |  20 |        JOIN FILTER USE           | :BF0001                     |   204K|  7403K|       |  3040   (2)| 00:00:37 |
    |* 21 |         HASH JOIN                |                             |   204K|  7403K|  5392K|  3040   (2)| 00:00:37 |
    |  22 |          TABLE ACCESS FULL       | WORKER_TBL                  |   162K|  3485K|       |   584   (1)| 00:00:08 |
    |* 23 |          INDEX FULL SCAN         | BENEFIT_IND                 |   204K|  3001K|       |  1927   (2)| 00:00:24 |
    Predicate Information (identified by operation id):
       3 - access("E"."WORKER_ID"="X"."WORKER_ID")
       5 - filter("X"."EFFECTIVE_DATE"<="DTUTIL"."TODATE"('2013/10/08') AND
                  "X"."EXPIRATION_DATE">="DTUTIL"."TODATE"('2013/10/08') OR "X"."EFFECTIVE_DATE"<="DTUTIL"."TODATE"('2013/11/08')
                  AND "X"."EXPIRATION_DATE">="DTUTIL"."TODATE"('2013/11/08') OR
                  "X"."EFFECTIVE_DATE">="DTUTIL"."TODATE"('2013/10/08') AND
                  "X"."EXPIRATION_DATE"<="DTUTIL"."TODATE"('2013/11/08'))
       6 - access("X"."COST_CENTRE"='100033')
       7 - filter("PKG_TAW_SECURITY"."USER_WORKER_ACCESS"('CA17062','TIMEKEEPER',"E"."WORKER_ID",TRUNC(SYSDATE@!))=1
      10 - access("X"."WORKER_ID"="X"."WORKER_ID")
      12 - filter(TO_CHAR(INTERNAL_FUNCTION("X"."ACTIVITY_DATE"),'YYYY')>=TO_CHAR(SYSDATE@!,'YYYY'))
      14 - access("E"."WORKER_ID"="X"."WORKER_ID")
      16 - filter("X"."EFFECTIVE_DATE"<="DTUTIL"."TODATE"('2013/10/08') AND
                  "X"."EXPIRATION_DATE">="DTUTIL"."TODATE"('2013/10/08') OR "X"."EFFECTIVE_DATE"<="DTUTIL"."TODATE"('2013/11/08')
                  AND "X"."EXPIRATION_DATE">="DTUTIL"."TODATE"('2013/11/08') OR
                  "X"."EFFECTIVE_DATE">="DTUTIL"."TODATE"('2013/10/08') AND
                  "X"."EXPIRATION_DATE"<="DTUTIL"."TODATE"('2013/11/08'))
      17 - access("X"."COST_CENTRE"='100033')
      18 - filter("PKG_TAW_SECURITY"."USER_WORKER_ACCESS"('CA17062','TIMEKEEPER',"E"."WORKER_ID",TRUNC(SYSDATE@!))=1
      21 - access("X"."WORKER_ID"="X"."WORKER_ID")
      23 - filter(TO_CHAR(INTERNAL_FUNCTION("X"."ACTIVITY_DATE"),'YYYY')>=TO_CHAR(SYSDATE@!,'YYYY'))
    So I can definitely tune the query to work against my acceptance database - that isn't really the problem.  The problem is that I can't count on the optimizations to be the same between development and acceptance.  So if I move this to production, how do I know I don't get a third plan?!?!?
    Can anyone suggest anything that might cause what I'm seeing above - and / or anything that I can do to prevent it.  This is just one query out of 10,000 or so that I'm working with - we are migrating from Oracle 9 to 11g and the queries all worked perfectly on 9.
    Thanks in Advance!
    Cory Aston

    Here are the two plans for the simplified query - using the OUTLINE format as per your request
    This is the bad plan from acceptance.
    PLAN_TABLE_OUTPUT
    SQL_ID  3zfrdhqpqk1mw, child number 1
    select /*+ gather_plan_statistics */        w.worker_id, w.worker_name
    from worker_v                   w,        worker_cost_centre_v       c
    where w.worker_id = c.worker_id    and c.effective_date <=
    trunc(sysdate)    and c.expiration_date >= trunc(sysdate)    and
    c.cost_centre = '100033'    and pkg_taw_security.user_worker_access('CA1
    7062',                                            'TIMEKEEPER',
                                       w.worker_id,
                       trunc(sysdate)) = 1  order by w.worker_name
    Plan hash value: 1726112176
    | Id  | Operation                      | Name                   | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT               |                        |       |       |   589 (100)|          |
    |   1 |  SORT ORDER BY                 |                        |     4 |   400 |   589   (2)| 00:00:08 |
    |*  2 |   HASH JOIN                    |                        |     4 |   400 |   588   (1)| 00:00:08 |
    |   3 |    VIEW                        | WORKER_COST_CENTRE_V   |     4 |   124 |     2   (0)| 00:00:01 |
    |*  4 |     TABLE ACCESS BY INDEX ROWID| WORKER_COST_CENTRE_TBL |     4 |   116 |     2   (0)| 00:00:01 |
    |*  5 |      INDEX RANGE SCAN          | WORKER_CC_CC_IDX       |    28 |       |     1   (0)| 00:00:01 |
    |*  6 |    VIEW                        | WORKER_V               |   162K|    10M|   584   (1)| 00:00:08 |
    |   7 |     TABLE ACCESS FULL          | WORKER_TBL             |   162K|  3485K|   584   (1)| 00:00:08 |
    Outline Data
      /*+
          BEGIN_OUTLINE_DATA
          IGNORE_OPTIM_EMBEDDED_HINTS
          OPTIMIZER_FEATURES_ENABLE('11.2.0.3')
          DB_VERSION('11.2.0.3')
          OPT_PARAM('optimizer_index_cost_adj' 10)
          ALL_ROWS
          OUTLINE_LEAF(@"SEL$2")
          OUTLINE_LEAF(@"SEL$3")
          OUTLINE_LEAF(@"SEL$1")
          NO_ACCESS(@"SEL$1" "C"@"SEL$1")
          NO_ACCESS(@"SEL$1" "W"@"SEL$1")
          LEADING(@"SEL$1" "C"@"SEL$1" "W"@"SEL$1")
          USE_HASH(@"SEL$1" "W"@"SEL$1")
          FULL(@"SEL$2" "X"@"SEL$2")
          INDEX_RS_ASC(@"SEL$3" "X"@"SEL$3" ("WORKER_COST_CENTRE_TBL"."COST_CENTRE"
                  "WORKER_COST_CENTRE_TBL"."EFFECTIVE_DATE"))
          END_OUTLINE_DATA
    Predicate Information (identified by operation id):
       2 - access("W"."WORKER_ID"="C"."WORKER_ID")
       4 - filter("X"."EXPIRATION_DATE">=TRUNC(SYSDATE@!))
       5 - access("X"."COST_CENTRE"='100033' AND "X"."EFFECTIVE_DATE"<=TRUNC(SYSDATE@!))
       6 - filter("PKG_TAW_SECURITY"."USER_WORKER_ACCESS"('CA17062','TIMEKEEPER',"W"."WORKER_ID",TRUN
                  C(SYSDATE@!))=1)
    Note
       - cardinality feedback used for this statement
    62 rows selected.
    This is the good one from development.
    PLAN_TABLE_OUTPUT
    SQL_ID  3zfrdhqpqk1mw, child number 0
    select /*+ gather_plan_statistics */        w.worker_id, w.worker_name
    from worker_v                   w,        worker_cost_centre_v       c
    where w.worker_id = c.worker_id    and c.effective_date <=
    trunc(sysdate)    and c.expiration_date >= trunc(sysdate)    and
    c.cost_centre = '100033'    and pkg_taw_security.user_worker_access('CA1
    7062',                                            'TIMEKEEPER',
                                       w.worker_id,
                       trunc(sysdate)) = 1  order by w.worker_name
    Plan hash value: 3435904055
    | Id  | Operation                      | Name                   | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT               |                        |       |       |     5 (100)|          |
    |   1 |  SORT ORDER BY                 |                        |    18 |   918 |     5  (20)| 00:00:01 |
    |   2 |   NESTED LOOPS                 |                        |       |       |            |          |
    |   3 |    NESTED LOOPS                |                        |    18 |   918 |     4   (0)| 00:00:01 |
    |*  4 |     TABLE ACCESS BY INDEX ROWID| WORKER_COST_CENTRE_TBL |    18 |   522 |     2   (0)| 00:00:01 |
    |*  5 |      INDEX RANGE SCAN          | WORKER_CC_CC_IDX       |    29 |       |     1   (0)| 00:00:01 |
    |*  6 |     INDEX UNIQUE SCAN          | WORKER_PK              |     1 |       |     1   (0)| 00:00:01 |
    |   7 |    TABLE ACCESS BY INDEX ROWID | WORKER_TBL             |     1 |    22 |     1   (0)| 00:00:01 |
    Outline Data
      /*+
          BEGIN_OUTLINE_DATA
          IGNORE_OPTIM_EMBEDDED_HINTS
          OPTIMIZER_FEATURES_ENABLE('11.2.0.3')
          DB_VERSION('11.2.0.3')
          OPT_PARAM('optimizer_index_cost_adj' 10)
          ALL_ROWS
          OUTLINE_LEAF(@"SEL$5428C7F1")
          MERGE(@"SEL$2")
          MERGE(@"SEL$3")
          OUTLINE(@"SEL$1")
          OUTLINE(@"SEL$2")
          OUTLINE(@"SEL$3")
          INDEX_RS_ASC(@"SEL$5428C7F1" "X"@"SEL$3" ("WORKER_COST_CENTRE_TBL"."COST_CENTRE"
                  "WORKER_COST_CENTRE_TBL"."EFFECTIVE_DATE"))
          INDEX(@"SEL$5428C7F1" "X"@"SEL$2" ("WORKER_TBL"."WORKER_ID"))
          LEADING(@"SEL$5428C7F1" "X"@"SEL$3" "X"@"SEL$2")
          USE_NL(@"SEL$5428C7F1" "X"@"SEL$2")
          NLJ_BATCHING(@"SEL$5428C7F1" "X"@"SEL$2")
          END_OUTLINE_DATA
    Predicate Information (identified by operation id):
       4 - filter("X"."EXPIRATION_DATE">=TRUNC(SYSDATE@!))
       5 - access("X"."COST_CENTRE"='100033' AND "X"."EFFECTIVE_DATE"<=TRUNC(SYSDATE@!))
       6 - access("X"."WORKER_ID"="X"."WORKER_ID")
           filter("PKG_TAW_SECURITY"."USER_WORKER_ACCESS"('CA17062','TIMEKEEPER',"X"."WORKER_ID",TRUN
                  C(SYSDATE@!))=1)
    60 rows selected.
    I'm not sure how to interpret what dbms_xplan is telling me above.  Any help would be greatly appreciated!!
    Thanks,
    Cory

  • Array of two VO whit same field

    I have 2 VO on my app, one of this is like that
    id string, numberOfItems
    that VO is filled whit data like that
    id items
    [1][100]
    [2][50]
    [3][200]
    [3][70]
    [4][80]
    [3][45]
    [5][30]
    [5][20]
    [5][60]
    i want to place this data in a second VO but grouping the data whit same ID and sum the total items, to get some like that
    [1][100]
    [2][50]
    [3][315]
    [4][80]
    [5][130]
    can som1 plz help me, i'm just 3 weeks of experiense whit J2EE and Java

    was done!
    int x=0;
    for(int vo1=0; vo1<y ; vo1++){
         String auxA = itemsInventoryFull[vo1].getID();
         int aux=0;
         try {
              for (int i=0;i<totalOfUniqueItems;i++) {
                   String aux1=auxA;
                   String aux2=itemsInventory.getID();
                   if (aux1.equalsIgnoreCase(aux2)) {
                        if (aux < 1) { aux = i; };
         } catch (Exception ex) {}
         if (aux==0) {
              itemsInventory[x] = new itemsInventoryVO();
              itemsInventory[x].setID(itemsInventoryFull[vo1].getID());
              itemsInventory[x].setRemuneracionImponible(itemsInventoryFull[vo1].getItems());
              x++;
         } else {
              itemsInventory[aux].setID(itemsInventoryFull[vo1].getID());
              double totalItems = itemsInventoryFull[vo1].getItems() + itemsInventory[aux].getItems();
              itemsInventory[aux].setItems(totalItems);

  • How to seperate the access for two identical databases from two application

    First I have to say I'm sorry... Oracle and the oracle architecture are totally new for me. However I hope to get some help with this.
    We have one Oracle 10g server and a database name A with table name X, Y and Z, for Application AA with access for property file AAA.
    The server capacity are almost not being used.
    Here are my thought, how can I add a database name B with table name X, Y and Z (yes same tables as in database A) data for application BB with access for property file BBB.
    how can I seperate the 2 property files (question: on a port number?), so in case there by a mistake should be switch around on 2 property files, it then is impossible to access the date from Application AA to date in database name B.
    Password on Database A (incl table) and Database B (incl table) are the same.
    Is there any solution to this?

    What I would like to do is make use of the resource on one machine.
    I have several similar applications, databases, tables and password where data should be totally separated from each other. however I would trying to prevent that there could be any data access from Application AA to Database B in case there should be a switch of property files
    I'm familiar with Sybase environment, however isn't there some thing fancy in oracle there can seperate to almost identical applications to access other databases

  • Universe Design - Linking two columns in a table to a subordinate table

    Post Author: bradwist
    CA Forum: Semantic Layer and Data Connectivity
    I hope this is the right forum to ask a question about Universe Design.  If not, please redirect me.  Thanks.
    I have a question on a universe design that I am trying to implement.  I'll try to simplify to what I really am focusing on here.  I've got a table, PersonRelationship, that defines a relationship between two people (Person1, Person2).  Both Person entities have a set of data that are contained in the PersonTable.  I'm trying to set up a universe design that allows the PersonRelationship table to join to the Person table twice, for Person1 and Person2 (fields are Person1Id and Person2Id respectively).
    (below is a poor attempt to draw the table relationships)
    Person (table)          PersonRelationship (Table)                  OtherData (table)
    PersonId (PK)          RelationshipId (PK)                             OtherDataId (PK)
                   ^----
    Person1Id (FK)
             ^----
    Person2Id (FK)
                                   OtherDataId (FK) -
    ^
    I then would like to build a query in Web-I that allows me to query against certain parameters for both Person1 and Person2.  For instance, I may want information that reflects when Person1 is male and Person2 is female.
    Is there a way to establish this relationship within the universe without having to create two physical tables?
    Thanks.

    Post Author: bradwist
    CA Forum: Semantic Layer and Data Connectivity
    With further information, I believe the answer to this is Aliasing the table.  But when I create and Alias of the person table, it doesn't show up in WebI.  I only see the original.  Not sure what the problem is.

  • Same field two meaning

    Hi all;
    I need to create a custom data source which contains different fields from different table, I am trying to create a view for this. I have this issue: same field ID has different meaning in two tables and I can't use those two same fields into my view.
    Field name 'POSID' has meaning in below;
    table: IMPZ: Identification for an investment program position
    Table: IMAK : Appropriation Request Number
    My question is I need both field appropriation request number and Identification for an investment program..we have two seperate Info Objects for them in BW.
    Kind help would be appreciated.
    thanks.

    Siegried;
    That was helpful, so even I rename the viewfield, I will get the data from the table right? the other question I have is I am trying to activate the view and getting into this warnings:
    All fields are evaluated as key field                 
    Not all the base tables are linked with join conditions
    The view ignores client-dependency of the base tables

  • Can I have two identical PCs with clones of the same hard drive?

    This all started when I had a problem with my first pc, a gateway laptop, would not wake up from sleep due to, supposedly, a driver problem. I didn't want to send it off for my free, under-warrantee, repair and be without a computer for however long that
    would take. So I bought another one and took it to a local dealer to clone the hard drive of the first one to put on the new one.
    This created a number of odd problems which eventually I figured out had something to do, it seemed, with Microsoft not allowing two identical machines to exist like that. I only plan to use one, the other one being exclusively for backup or in case something
    happened to the first. But I think the problems occurred when I tried to switch back and forth, to do some texting.
    Is there a way I can accomplish this?
    Thanks.

    Until Windows 7, it was possible to use two identical PCs with same clone. Provided, both the PCs must be legally licensed to use the Windows operating system (version as well as edition) and of same OEM, model and spec. This is possible because, the product
    keys are common for all the PCs of same OEM build (if preinstalled, and the installed product key is different from the one mentioned in COA). This made OEM builders to distribute to more PCs than the license agreement, which is impossible for Microsoft to
    find out. To solve this issue, Microsoft changed the licensing structure from Windows 8 - embedding the product key in BIOS. So, here, only the installation is provided and the product keys are not common for all the PCs even if they are of the same OEM build.
    Therefore, cloning fails here. And naturally, as Team Zigzag and EC Ltd say, same product key can't be used for more than one PC.
    As to restore the PC in case of an emergency, you can perform a backup of the existing installed software and user files, which can be restored later (File History in Windows 8). The following links may be helpful:
    http://windows.microsoft.com/en-us/windows-8/what-happened-to-backup-restore
    http://blogs.technet.com/b/keithmayer/archive/2013/09/17/backup-amp-recovery-of-windows-8-windows8-itpro-tipoftheday.aspx#.UkC-hmLrbIU
    Balaji Kundalam

  • My iPhone has two identical options under "iTunes wi-fi sync" that are the same computer. I only have one user on my  computer, and I tried moving my iTunes file in Finder to organize it and now my library's not synced with my phone. Help?

    My iPhone has two identical options under "iTunes wi-fi sync" that are the same computer. I only have one user on my computer, and I tried moving my iTunes file in Finder to organize it and now my library's not synced with my phone. Help?

    I have the same problem. Right now my iPhone 5S shows 3 instances of the computer to which it is connected under Settings » General » iTunes WiFi Sync. I'm having problems connecting and syncing, and this is probably the cause: the phone chooses one of these connections, and it isn't the one that's actually in use. What's probably happening is that the phone and computer establish a connection using a dynamic IP address, the address becomes "disassociated" due to error, another address is associated, the phone retains each address/link, and each link is displayed as if it represents a separate computer (the fact that the name of the computer is identical is ignored, as the only thing that is considered important is the IP address). But that's all conjecture. More important, I'm not sure how to fix the problem. A network reset doesn't do it.

  • Two triggers on same table

    Hi Friend.
    I have to write two triggers on same table for auditing different columns of different users(may be different modules).
    I will have an audit table in which i will insert data such as (user_id,module_id,column_name,old_col_val,new_col_val,timestamp)
    Now different users from different modules will update the data on same table may be same columns from different front end forms!
    If we write directly, we will not be able to know which column is updated by which user.
    My question is in this case how can we control the triggers to raise differently?

    You can use WHEN clause to fire a trigger only when some condition is true - you can check an user also,
    look at simple example:
    - suposse we have two users US1 and US2:
    C:\>sqlplus sys as sysdba
    SQL*Plus: Release 10.2.0.1.0 - Production on Pn Gru 6 13:14:22 2010
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Enter password:
    Connected to:
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
    SQL> create user us1 identified by us1;
    User created.
    SQL> create user us2 identified by us2;
    User created.
    SQL> grant connect, resource to us1, us2;
    Grant succeeded.
    SQL> grant create public synonym to us1, us2;
    Grant succeeded.and suposse we have a table with three columns + audit table:
    SQL> connect us1
    Enter password:
    Connected.
    SQL> create table tab123(
      2  col1 number,
      3  col2 number,
      4  col3 number);
    Table created.
    SQL> create table audit_tab123(
      2  username varchar2(100),
      3  col1 number,
      4  col2 number,
      5  col3 number );
    Table created.
    SQL>  grant select, update, insert on tab123 to us2;
    Grant succeeded.
    SQL>  grant select, update, insert on audit_tab123 to us2;
    Grant succeeded.
    SQL> create public synonym tab123 for tab123;
    Synonym created.
    SQL> insert into tab123 values( 1, 1, 1 );
    1 row created.
    SQL> commit;
    Commit complete.We want a trigger that is fired only by user US1 and only after update of COL1 and COL2
    (COL3 is ignored):
    SQL> connect us1/us1
    Connected.
    SQL> CREATE OR REPLACE TRIGGER Trig_123_US1
      2  AFTER UPDATE OF col1, col2 ON tab123
      3  FOR EACH ROW
      4  WHEN ( user = 'US1' )
      5  BEGIN
      6    INSERT INTO audit_tab123( username, col1, col2 )
      7    VALUES( user, :new.col1, :new.col2 );
      8 END;
    SQL> /
    Trigger created.And we want a second trigger that is fired only by user US2 and only after update of COL2 and COL3
    (COL1 is ignored):
    SQL> connect us1/us1
    Connected.
    SQL> CREATE OR REPLACE TRIGGER Trig_123_US2
      2  AFTER UPDATE OF col2, col3 ON tab123
      3  FOR EACH ROW
      4  WHEN ( user = 'US2' )
      5  BEGIN
      6    INSERT INTO audit_tab123( username, col2, col3 )
      7    VALUES( user, :new.col2, :new.col3 );
      8  END;
      9  /
    Trigger created.and now let test our triggers:
    SQL> connect us1/us1
    Connected.
    SQL> update tab123 set col1 = 22;
    1 row updated.
    SQL> update tab123 set col2 = 22;
    1 row updated.
    SQL> update tab123 set col3 = 22;
    1 row updated.
    SQL> commit;
    Commit complete.
    SQL> select * from audit_tab123;
    USERNAME         COL1       COL2       COL3
    US1                22          1
    US1                22         22
    SQL> connect us2/us2
    Connected.
    SQL> update tab123 set col1 = 333;
    1 row updated.
    SQL> update tab123 set col2 = 333;
    1 row updated.
    SQL> update tab123 set col3 = 333;
    1 row updated.
    SQL> commit
      2  ;
    Commit complete.
    SQL> select * from us1.audit_tab123;
    USERNAME         COL1       COL2       COL3
    US1                22          1
    US1                22         22
    US2                          333         22
    US2                          333        333As you see, each trigger is fired only once, first triger only for user US1 and columns COL1 and COL2,
    and second trigger only for user US2 and only after update of COL2 and COL3.
    I hope this will help.

  • Why same fields appearing more than once in a Table like EKPO , KNA1 ???

    hi ,
    in SAP IDES version u will see :
    In EKPO table : Two fields MATNR and EMATNR having same spec. and
    showing same redundant data in IDES version .
    IN KNA1 table : NAME1 field appears twice ...
    why so ? any utilities / Reason ????

    HI,
    kna1 is customer master table.
    now 1 customer can have 2 names like 1 official and one nick name or 2 persons or brothers who are given only 1 customer no kunnr by their vendor.
    these things are done by seeing all the business scenarios.
    now in table EKPO
    MATNR IS PRODUCT NO
    EMATNR IS MATERIAL NO.
    now there is a difference between product and material.
    a material can be a raw material semi finished or finished good,but a product is always a material which is been purchased through the purchase order from the vendor.
    the matnr is essentially the final stage of the product by the vendor.
    in many cases these contain same data but there are a lot of cases when these things worry.
    if you have accesss to your production system then you can check there.
    thanks
    reward if helpful
    vivekanand

  • How to summary a field from 2 separate tables but having the same fields

    Post Author: thuyvd78
    CA Forum: General
    Hi, I am getting trouble with creating the summary from 2 separate tables. These tables dont have any link together but they have the same fields, such as: part id, qty, etc. I need to create a report that displays whole the information from these tables and also the summary of total qty field of these tablesAny idea to organize this report? Thank you very much! Thuy  

    Post Author: thuyvd78
    CA Forum: General
    Thank you for your help v361.where can I can get the link to download samples for subreport from official website?And can I use FULL INNER query to join these tables. I think this way is much clearer than using subreport but not sure it will work? Thanks Thuy  

  • How join the two query block with same field

    sorry sir i am posting dublicate thread
    i thought you not understand my question
    sir i have two query block in report with same field
    i try the link object but that creat now block not creat link withen query block
    please give me idea
    thank

    Dear,
    Use data link object.
    Click at data link object then click on the fild in query block1 and drag it into the other query block data link will be created.
    try it

  • Is there any other table like BSEG with same fields.

    Hi Abapers,
    I want to use BSEG table.But due to some promblem BSEG table is not supporting.So is there any other table like BSEG with same fields.
    can any one help me.
    with regards

    Since performance may be an issue when hitting BSEG table
    Any of the below accounting tables can be used.
    1.BSAD
    2.BSAK
    3.BSAS
    4.BSID
    5.BSIK
    6.BSIS
    These are normal database tables, not clusters. Normally every record from BSEG can be found in one of these 6 tables. The program which selects data
    From these tables runs faster than from BSEG.
    Plz reward if helpful.
    Thanks.
    Ramya

Maybe you are looking for