Tables of Union of multiplying srouces given in OBIEE

Hi Pros,

I Recenetly do a POC on union the same table structure to multiply the data sources through OBIEE, uptill now I can't do it yet, I tried below ways:

Prerequisite: I've set up two tables under a physical folder with the connection of two pool

1. When do the union at the physical level, cannot apply because either can not create a union two tables using SQL or view.
2. When do the union at the logical level, cannot also implement

I know that this kind of data integration should be done before that we import in OBIEE model, but there is something political that we cannot integrate, so I was wondering if OBIEE has this functionlity who can trade union data from different data source. Please notify.

Thank you

I think I confused... lets you go with simple approach test Fragmentation future (http://www.rittmanmead.com/2007/06/obiee-data-modeling-tips-2-fragmentation/)

In physics create a column (Source) more on both sources. Configure all the joins as we usually do. MDB to configure your fragmentation based on the source column.

Your physical look like columns look like: ID, NAME, ADDRESS and SOURCE.

Source1 sample data
ID, NAME, ADDRESS, SOURCE
1, s, abc, Source1

Source2 sample data
ID, NAME, ADDRESS, SOURCE
11, s, abc1, Source2

Thank you
Srinivas

Tags: Business Intelligence

Similar Questions

  • ODI 11 g multiple table with union join

    Hi all

    I have a problem with joining 4 different tables and union all of them.

    Here I want to generate this query;

    Select * from

    Table1, table2

    Join table2 = table1

    Union of all the

    Select * from

    Table 3, table 4

    Join table3 = table 4

    But I have not the same column that all the table, some are missing. When I write one - PL/SQL query I can easily add a false "NULL column1' column, but I can not how I do with ODI 11 g.

    I tried not to use "Active Mapping", but it does not work.

    I'm newbie ODI 11 g

    Thank you

    Myra

    Hi, Myra,.

    I'd even as in PL/SQL. In your table target add all the columns you need and overall data whatever you're missing some columns just put NULL in the mapping.

    Thank you

    Ajay

  • The combination of several tables: patent wise associates to a given laboratory

    Oracle 10g

    Ask your help to rewrite the query below correctly

    I have the following tables
    CREATE TABLE  "ADDLAB" 
       (     "VERSIONNO" NUMBER(*,0), 
         "LABID" VARCHAR2(20), 
         "LABNAME" VARCHAR2(60), 
         "LABSTARTDATE" DATE, 
         "LABSTATUS" VARCHAR2(20), 
         "LABENDDATE" DATE, 
         "OPERATOR" VARCHAR2(20), 
         "FROMDATE" DATE, 
         "TODATE" DATE, 
         "SRCHFIELD" VARCHAR2(20), 
         "PARENTLABID" VARCHAR2(20), 
         "LABCLOSEREASON" VARCHAR2(1000), 
         "LABHIDDENDATE" VARCHAR2(20), 
          CONSTRAINT "PK_B34" PRIMARY KEY ("LABID", "LABHIDDENDATE") ENABLE
       )
    
    CREATE TABLE  "ADDPROJECT" 
       (     "VERSIONNO" NUMBER(*,0), 
         "PROJID" VARCHAR2(20), 
         "PROJNAME" VARCHAR2(60), 
         "PROJSTARTDATE" DATE, 
         "PROJSTATUS" VARCHAR2(20), 
         "PROJENDDATE" DATE, 
         "PROJENDTYPE" VARCHAR2(20), 
         "PROJENDREASON" VARCHAR2(1000), 
         "UCPROJECTMANAGER" VARCHAR2(20), 
         "FROMDATE" DATE, 
         "TODATE" DATE, 
         "SRCHFIELD" VARCHAR2(20), 
         "OPERATOR" VARCHAR2(20), 
         "PARENTPROJID" VARCHAR2(20), 
         "PROJHIDDENDATE" VARCHAR2(20), 
          CONSTRAINT "PK_B36" PRIMARY KEY ("PROJID", "PROJHIDDENDATE") ENABLE
       )
    
    CREATE TABLE  "PROJECTTOLABASSOCIATION" 
       (     "VERSIONNO" NUMBER(*,0), 
         "PROJLABASSOID" NUMBER(9,0), 
         "PROJID" VARCHAR2(20), 
         "LABID" VARCHAR2(20), 
         "PROJLABSTARTDATE" DATE, 
         "STATUS" VARCHAR2(20), 
         "ENDDATE" DATE, 
         "LABHIDDENDATE" VARCHAR2(20), 
         "PROJLABHIDDENDATE" VARCHAR2(20), 
         "PROJHIDDENDATE" VARCHAR2(20), 
          CONSTRAINT "PK_B37" PRIMARY KEY ("LABID", "PROJID", "PROJLABHIDDENDATE") ENABLE
       )
    
    CREATE TABLE  "ADDPATENT" 
       (     "VERSIONNO" NUMBER(*,0), 
         "PATID" NUMBER(9,0), 
         "PATTITLE" VARCHAR2(250), 
         "PATSTATUS" VARCHAR2(20), 
         "PATAPPDATE" DATE, 
         "PATSTATUSDATE" DATE, 
         "PATENTREJECTWITHDRAWNREASON" VARCHAR2(1000), 
         "PATNO" VARCHAR2(20), 
         "SRCHFIELD" VARCHAR2(20), 
         "FROMDATE" DATE, 
         "TODATE" DATE, 
         "OPERATOR" VARCHAR2(20), 
         "PATENTGEOGRAPHY" VARCHAR2(20), 
         "PAPERTYPE" VARCHAR2(20) DEFAULT 'dummy', 
         "PATENTURL" VARCHAR2(200), 
          CONSTRAINT "PK_A67" PRIMARY KEY ("PATID") ENABLE, 
          CONSTRAINT "UQ_PATENTTITLE" UNIQUE ("PATTITLE") ENABLE
       )
    
    CREATE TABLE  "PATENTTOPROJECTASSOCIATION" 
       (     "VERSIONNO" NUMBER(*,0), 
         "PATENTPROJASSOID" NUMBER(9,0), 
         "PATID" NUMBER(9,0), 
         "PROJID" VARCHAR2(20), 
         "PATENTPROJHIDDENDATE" VARCHAR2(20), 
         "STATUS" VARCHAR2(20), 
         "STARTDATE" DATE, 
         "ENDDATE" DATE, 
         "PROJHIDDENDATE" VARCHAR2(20), 
          CONSTRAINT "PK_A91" PRIMARY KEY ("PATID", "PROJID", "PATENTPROJHIDDENDATE") ENABLE
       )
    
    CREATE TABLE  "PATENTASSOCIATES" 
       (     "VERSIONNO" NUMBER(*,0), 
         "PATASSOID" NUMBER(9,0), 
         "PATID" NUMBER(9,0), 
         "ASSOCIATEID" NUMBER(9,0), 
          CONSTRAINT "PK_B67" PRIMARY KEY ("ASSOCIATEID", "PATID") ENABLE
       )
    
    CREATE TABLE  "ADDASSOCIATE" 
       (     "VERSIONNO" NUMBER(*,0), 
         "ASSOCIATEID" NUMBER(9,0) NOT NULL ENABLE, 
         "ASSOCIATENAME" VARCHAR2(100) NOT NULL ENABLE, 
         "CTOJOINDATE" DATE, 
         "STATUS" VARCHAR2(20), 
         "ENDDATE" DATE, 
         "SRCHFIELD" VARCHAR2(20), 
         "OPERATOR" VARCHAR2(20), 
         "FROMDATE" DATE, 
         "TODATE" DATE, 
          CONSTRAINT "PK_B23" PRIMARY KEY ("ASSOCIATEID") ENABLE
       )
    Now, I need a list of all patents sage associates for each laboratory.
    I have wirtten the following query. If I get the correct results, I get duplicate values. Each record is displayed at least 10 times. So if there are 4 partners for a given patent, it's ateleast back 40 records. I tried SINGLE. No results displayed.
    query2 = "SELECT tn1.associateName AS name " +
    "FROM AddLab al, AddProject ap, AddPatent p, ProjecttoLabAssociation pl, PatenttoProjectAssociation pp, " +
    "AddAssociate tn1, PatentAssociates tn2 " + 
    "WHERE " +
    "al.labID=pl.labID " + 
    "AND ap.projID=pl.projID " +
    "AND pl.projID=pp.projID " +
    "AND p.patID=pp.patID " +
    "AND pl.status = 'Active' " +
    "AND tn1.associateID = tn2.associateID " +
    "AND tn2.patID = '" + rs.getString("patID") + "' " +
    "order by al.labID";
    
    try
    {
    stmt = conn.createStatement();
    rs2 = stmt.executeQuery(query2);
    String associateNames = "";
                                            
    while(rs2.next())
    {
     associateNames += rs2.getString("ID") + ";\n";
    }

    Use the laureline or

    Use can use the the tn1.associateName group

    It seems that your use within java code here, I formatted as sql code. Fomat according to your requirement

    SELECT t.name FROM (SELECT tn1.associateName AS name,count(*)
    FROM AddLab al, AddProject ap, AddPatent p, ProjecttoLabAssociation pl, PatenttoProjectAssociation pp,
    AddAssociate tn1, PatentAssociates tn2
    WHERE
    al.labID=pl.labID
    AND ap.projID=pl.projID
    AND pl.projID=pp.projID
    AND p.patID=pp.patID
    AND pl.status = 'Active'
    AND tn1.associateID = tn2.associateID
    AND tn2.patID = '  rs.getString(patID)  '
    GROUP BY tn1.associateName
    order by al.labID) t;
    
  • Level given in OBIEE 11 g security

    Hi all

    I'm using OBIEE 11 g. I have a table called "USER_ACCESS_T", which has four columns user_name, Access_level_name, Access_level_type and status_flag.

    User_name Access_Level Access_Type Status_Flag

    Project ABC XX project Yes group
    Void YY DEF project group Yes
    GH ZZ project Yes

    My requirement is

    When the XX user BI answers, he has access only to the project group is to say.., ABC project.
    When a user yy connects BI answers, it needs to access only project sup group is to say.., project DEF.

    Kindly guide me.

    Thanks and greetings
    Sara

    Published by: Sara on December 23, 2011 11:44

    Hi Sara,.

    Please follow the follow-up steps to restrict users on the dimension of the project.

    (1) create an init block to fill the project list that a user belongs. You have to make this line - sage initialized as a user can belong to several projects.

    Select 'Numero_projet', numero_projet from w_project_d where UPPER (user_name) = UPPER(':USER');

    (2) now that you have all the numbers for a particular user in a variable, you can use that to filter on the dimension table.

    (3) of the RPD, go to the group/role - permissions - Select the dimension table project - and put the filter following.

    "Basic". "" Dim - Project.Project number "= VALUEOF (NQ_SESSION. NUMERO_PROJET)

    That's all. Your security is now in place for projects.

    I think this will give you a solution.

  • How disply last 4months given in obiee 11g

    Hi all

    In my report, I need to disply the latest data from four months in the current year. months data format looks like 2013/07.

    reoprt like that

    Order of months cost

    -------------------------------------------------
    20000 2013/07

    50000 2013/06

    2000000 2013/05

    2013/04 70000

    month will advance to disply details these last months.

    Please help me.

    Use the filter on date column

    Time.Date <= cast(current_date="" as="" date)="" and="" time.date="">= TIMESTAMPADD (SQL_TSI_MONTH,-3, TIMESTAMPADD (SQL_TSI_DAY, DAYOFMONTH (CURRENT_DATE) *-(1) + 1, CURRENT_DATE))

    Here's Time.Date, column date

    Mark it if help.

  • How to multiply all the items in a table by a negative

    Hello

    I have a 1 d table, I need to multiply each element of the array in the negative.  How would I do that?

    You have two options. Top of page option if you just want to always deny. Down if you can reach more than by anything else.

  • I want to convert my logic large table - multiply in a library called the faster, need some advice on the code of C.

    Hello everyone,

    In my VI, I have a code that looks like this-

    Each table is 2D size 512 by 640.  The time it takes to run this whole chain is approximately 28miliseconds. Seems fast, but I need to cut it to about 10ms.  I tried to make the tables 1 d, but saves only about 2 ms.  I even tried to cut the table 1 d in half and duplicate the code and then combine them at the end (a half-hearted attempt at optimizing multi-core) and who showed zero improvement...

    I guess my last option (please let me know if there are other options) is to compile a DLL that will do this for me.

    I'm a bit confused on how I'm supposed to implement table multiplies in C, however.

    What I do run for(;;) a loop and multiply each item one by one?  It seems that that would be much slower than anything done LabView in-house to do this multiplication of cross-checking.

    Thank you!!

    MK

    If you don't know how you would in C, I don't know why you think that move it to a DLL will make it faster. In C, you will need to either make operations sequentially in a loop for, as you mentioned, or find a library for parallelization of this operation. There is no built-in c function to multiply the tables.

    One thing you might try in your LabVIEW code is to multiply it in a loop for, where you make an addition to each iteration and store the result in a shift register. Also remember the current power of the original array into a shift register. Which should reduce the number of copies of the table you need, which can speed up to turn the code. So, you initialize it the 'sum' with the first table shift register and the shift register current electric table with the result of the subtraction (or, Alternatively, with a table of the same size, filled with 1, according to the order in which you want to do things). Multiply this table by the first multiplier, add it to the sum, and multiply the power of the original (subtraction) table, storing to the power shift register. Repeat until you are finished.

  • Union of crazy on 3 tables

    Hi all, I hope I have explained this madness of...

    I have 3 tables (a, b, c) which have same pk (called product_serial). The same product_serial can exist in one or all three tables. No one table is the primary table (although tables a and b are preferable to the c). In 2 tables (a, b) there is also a unique key (known as popcon). The product_serial, popcon combination can be duplicated through these 2 tables, once more, neither is the master. If data exist in the table a or b, then we don't really need to worry on c, but of course, if the data does not exist in a or b, then we have need c data.

    I would like to create a view in any of these 3 tables so that the data are merged so that I can create a virtual master so that I can then join to other tables. The view must contain a unique set of product_serials and popcons.

    For a product_serial which is duplicated between a and b tables, a union works as expected and I pick up a single line.
    Select * from abc_view where product_serial = 'psa1.
    returns...
    product_serial, popcon
    psa1, pca1

    But when there is a record in c, a or b, then the union returns duplicates.
    Select * from abc_view where product_serial = 'psb1.
    returns...
    product_serial, popcon
    pSB1, pcb1
    pSB1, null

    In the latter case, since a record found in a or b, which should take peference, and we don't need to worry about the c.

    So I guess that 2 possible solutions come to mind,
    1. is there a way to filter the record that has a popcon null when there are no records with a non-null value for this product_serial?
    2. is there a way to union and b, but only if there are no results then question c (that is, if the union of b returns the result, then it is all we need)?

    IM open to other solutions as well. Of course, the obvious solution is to go the difficulty of the model of data, but for some reason any of this is not possible atm :).

    Here is my test data...


    drop table;
    drop table b;
    drop table c;
    create table a (product_serial VARCHAR2 (255) primary key, popcon VARCHAR2 (255) unique, name VARCHAR2 (255));
    create table b (primary key of the product_serial VARCHAR2 (255), popcon VARCHAR2 (255) unique, name VARCHAR2 (255));
    create table c (product_serial VARCHAR2 (255) primary key, name VARCHAR2 (255));
    insert into a values ('psa1', 'pca1', 'namea1');
    insert into a values ('psa2', 'pca2', 'namea2');
    insert into b values ('psb1', 'pcb1', 'nameb1');
    insert into b values ('psb2', 'pcb2', 'nameb2');
    insert into b values ('psa1', 'pca1', 'namea1'); -double in one
    insert into c values ('psc1', 'namec1');
    insert into c values ('psc2', 'namec2');
    insert into c values ('psb1', 'nameb1'); -duplicated in b
    commit;

    Drop view abc_view;
    Create view abc_view as
    Select product_serial, popcon of
    (
    (select product_serial, popcon since one
    Union
    Select product_serial, b popcon)
    Union
    Select product_serial, null of c
    );


    Thanks in advance.

    Published by: user523756 on May 24, 2011 07:55
    create or replace
      view abc_view
        as
          select  product_serial,
                  popcon
            from  (
                   select  product_serial,
                           popcon,
                           row_number() over(partition by product_serial oder by popcorn nulls last) rn
                     from  (
                             select  product_serial,
                                     popcon
                               from  a
                            union all
                             select  product_serial,
                                     popcon
                               from  b
                            union all
                             select  product_serial,
                                     null popcon
                               from  c
                           )
                  )
      where rn = 1
    /
    

    SY.

  • Table of the Union

    Hi all
    I have 2 tables TableA and TableB

    TableA
    Name, amount, Date

    TableB
    Name, Amt, BusinessDate

    How to get all records in TableA, TableB (Union)
    Join TableA.Date = TableB.BusinessDate

    Note: above the table column name was different. (TableA. Amount and TableB.Amt)

    Result:
    Name, amount, Date
    I should show all (Union records) in above the column name.

    How to do this in OBIEE could you please me step by step

    Thank you

    Hi reda,.

    Defined a level of aggregation (Sum) to the RPD for amount columns?

    Thank you

    Daan Bakboord
    http://obibb.WordPress.com

  • Merge into the nested table

    Hi all
    Can I combine the records in the nested table
    I have a table with 2 colum: col_1 and col_2
    col_1: corresponds to the id (varchar2)
    col_2: is a column nested with the type of table (sub_col_1 (number), sub_col_2 (number))

    for example: I have 2 accounts table ('a', (1,2)) and ('b', (3,4)))

    what I want is merged into this table with values ('a', '4.5')) + ('c', (6,7)) IN a single statement

    What I should have after this operation ('a', (1,2,4,5)) + ('b', (3,4)) + ('c', (6,7)).
    Can I do this?
    CREATE OR REPLACE TYPE TEST_TYPE AS OBJECT(SUB_COL_1 NUMBER, SUB_COL_2 NUMBER) ;
    
    CREATE OR REPLACE TYPE TEST_TYPE_TABLE IS TABLE OF TEST_TYPE;
    
    CREATE TABLE TEST_MERGE_NESTED_TABLE (COL_1 VARCHAR2(1 CHAR), COL_2 TEST_TYPE_TABLE)
        NESTED TABLE COL_2 STORE AS COL_2_NESTED;
        
    INSERT INTO TEST_MERGE_NESTED_TABLE VALUES('a',TEST_TYPE_TABLE(TEST_TYPE(1,2) ));
    INSERT INTO TEST_MERGE_NESTED_TABLE VALUES('b',TEST_TYPE_TABLE(TEST_TYPE(3,4) ));
    Oracle version: 11.2.0.3
    Thank you all.

    Published by: 966205 on 20:18 21/02/2013

    Published by: 966205 on 20:42 21/02/2013

    966205 wrote:
    That means he does the same thing as what I want (adding? do not recreate this column in the physical layer).

    Actually, no.
    All content of the nested table is first removed (for the given FK), then the result of the MULTISET UNION is reinserted.

    The evidence on:

    SQL> alter session set events '10046 trace name context forever, level 12';
    
    Session altered.
    
    SQL> merge into test_merge_nested_table t
      2  using (
      3    select 'a' col_1, TEST_TYPE_TABLE(TEST_TYPE(4,5)) col_2 from dual union all
      4    select 'c' , TEST_TYPE_TABLE(TEST_TYPE(6,7))            from dual
      5  ) v
      6  on ( t.col_1 = v.col_1 )
      7  when matched then update
      8    set t.col_2 = t.col_2 multiset union v.col_2
      9  when not matched then insert (col_1, col_2)
     10   values (v.col_1, v.col_2) ;
    
    2 rows merged.
    
    SQL> alter session set events '10046 trace name context off';
    
    Session altered.
    
    SQL> select * from test_merge_nested_table;
    
    C COL_2(SUB_COL_1, SUB_COL_2)
    - --------------------------------------------------------------------------------
    c TEST_TYPE_TABLE(TEST_TYPE(6, 7))
    a TEST_TYPE_TABLE(TEST_TYPE(1, 2), TEST_TYPE(4, 5))
    b TEST_TYPE_TABLE(TEST_TYPE(3, 4))
    

    TKPROF output:

    DELETE, the nested table statement objectives associated with 'a' and deletes the line after line that it contains (1,2).
    The later INSERTION is performed twice (run count = 2) and target the two nested table 'a' by inserting 2 ranks: former one (1,2) + the new one (4.5) and the nested table 'c' by inserting 1 row (6,7).

    SQL ID: 6bjc2z2t53csn Plan Hash: 132214516
    
    DELETE /*+ REF_CASCADE_CURSOR */ FROM "DEV"."COL_2_NESTED"
    WHERE
     "NESTED_TABLE_ID" = :1
    
    call     count       cpu    elapsed       disk      query    current        rows
    ------- ------  -------- ---------- ---------- ---------- ----------  ----------
    Parse        1      0.00       0.00          0          0          0           0
    Execute      1      0.00       0.00          0          1          3           1
    Fetch        0      0.00       0.00          0          0          0           0
    ------- ------  -------- ---------- ---------- ---------- ----------  ----------
    total        2      0.00       0.00          0          1          3           1
    
    Misses in library cache during parse: 0
    Optimizer mode: CHOOSE
    Parsing user id: SYS   (recursive depth: 1)
    Number of plan statistics captured: 1
    
    Rows (1st) Rows (avg) Rows (max)  Row Source Operation
    ---------- ---------- ----------  ---------------------------------------------------
             0          0          0  DELETE  COL_2_NESTED (cr=1 pr=0 pw=0 time=44 us)
             1          1          1   INDEX RANGE SCAN SYS_FK0000023444N00002$ (cr=1 pr=0 pw=0 time=10 us)(object id 23446)
    
    ********************************************************************************
    
     
    
    ********************************************************************************
    
    SQL ID: 0fzd5yk23jyas Plan Hash: 0
    
    INSERT /*+ NO_PARTIAL_COMMIT REF_CASCADE_CURSOR */ INTO "DEV"."COL_2_NESTED"
      ("NESTED_TABLE_ID","SYS_NC_ROWINFO$")
    VALUES
    (:1, :2)
    
    call     count       cpu    elapsed       disk      query    current        rows
    ------- ------  -------- ---------- ---------- ---------- ----------  ----------
    Parse        2      0.00       0.00          0          0          0           0
    Execute      2      0.00       0.00          0          2         10           3
    Fetch        0      0.00       0.00          0          0          0           0
    ------- ------  -------- ---------- ---------- ---------- ----------  ----------
    total        4      0.00       0.00          0          2         10           3
    
    Misses in library cache during parse: 0
    Optimizer mode: ALL_ROWS
    Parsing user id: 50     (recursive depth: 1)
    Number of plan statistics captured: 1
    
    Rows (1st) Rows (avg) Rows (max)  Row Source Operation
    ---------- ---------- ----------  ---------------------------------------------------
             0          0          0  LOAD TABLE CONVENTIONAL  (cr=1 pr=0 pw=0 time=113 us)
    
    ********************************************************************************
    
  • Try to update the new column in the TABLE one by reading another table

    I had to add another column to a table and for updating this column, I need to read two other paintings, according to the REF_TYPE_CD.




    Update CUST_RQST_DROP c
    Set crd_mktr_no = (select mka_mktr_no from marketer_account
    where mka_acct_no = c.crd_ref_no
    and c.entry_dt between mka_eff_dt and mka_exp_dt
    and c.crd_ref_type_cd = 'A');

    Update CUST_RQST_DROP c
    Set crd_mktr_no = (select aeq_mktr_no from acct_enroll_que
    where aeq_work_q_no = c.crd_ref_no
    and c.crd_ref_type_cd = 'P');


    I don't know how to combine in a single query.

    Any suggestions would be greatly appreciated

    Well, I still had to build all of the DDL and DML statements me:(dans l'avenir, je recommanderais ajouter ceci dans votre post, vous aurez BEAUCOUP plus de gens prêts à aider si vous le faites.) Just a suggestion for your benefit.

    It should work assuming you have a relationship with each other between tablea and b and c... AND you never have more than one row in the child table (b or c to a given value in one).

    create table tablea
    (
    account_no      number,
    entry_dt     date,
    ref_type     varchar2(1),
    refno          number,
    mkt_no          number
    );
    
    create table tableb
    (
    id               number,
    account_no      number,
    mkt_no          number
    );
    
    create table tablec
    (
    id               number,
    account_no      number,
    mkt_no          number,
    eff_dt          date,
    exp_dt          date
    );
    
    insert into tablea values (123, to_date('04/01/2010','mm/dd/yyyy'), 'P', 9983, null);
    insert into tablea values (124, to_date('04/02/2010','mm/dd/yyyy'), 'A', 3452, null);
    insert into tablea values (125, to_date('04/02/2010','mm/dd/yyyy'), 'P', 9984, null);
    
    insert into tableb values (9983, 123, 10001);
    insert into tableb values (9984, 125, 11232);
    
    insert into tablec values (3452, 124, 10333, to_date('01/01/2010','mm/dd/yyyy'), to_date('05/19/2010','mm/dd/yyyy') );
    
    ME_XE?Update TableA a
    set mkt_no =
    (
         select mkt_no from tableb b where b.account_no = a.account_no and a.ref_type = 'P'
         union all
         select mkt_no from tablec c where c.account_no = a.account_no and a.ref_type = 'A' and a.entry_dt between c.eff_dt and c.exp_dt
    )
    where mkt_no is null;
    
    3 rows updated.
    
    Elapsed: 00:00:00.12
    ME_XE?select * from tablea;
    
            ACCOUNT_NO ENTRY_DT             R              REFNO             MKT_NO
    ------------------ -------------------- - ------------------ ------------------
                   123 01-APR-2010 12 00:00 P               9983              10001
                   124 02-APR-2010 12 00:00 A               3452              10333
                   125 02-APR-2010 12 00:00 P               9984              11232
    
    3 rows selected.
    
    Elapsed: 00:00:00.15
    
  • Unable to delete all the rows in the table

    Hi all

    According to the time range I'm removing the equipment data and travel work shifts then insert new data of mth_site_shift_definitions in the work day moves and equipment move the table. If mth_Site_shift_definitions table has three rows for a given plant and I delete the two lines in a time then I am able to delete data for movement of equipment and work sihfts table, and then click Insert data in a single row in these two tables, but when I try to remove the last line I get an SQL exception. Can someone tell me the reason for this exception. In fact, I want that if we delete the last row also mth_Site_shift_definitions then the corresponding data should also get demolished transfers of equipment and work instead of give to the exception. I have this code:

    PROCEDURE GENERATE_SHIFTS (p_plant_fk_key in NUMBER,
    p_start_date IN this update,
    p_end_date IN DATE)
    IS
    -declation of local variable

    l_plant_fk_key NUMBER;
    l_sysdate DATE: = sysdate; - sysdate variable
    l_last_update_system_id NUMBER;
    l_last_update_date DATE;
    l_plant_pk VARCHAR2 (120);
    l_start_time varchar2 (8); - variable to store the start time
    l_end_time VARCHAR2 (8); - variable to store end_time
    l_graveyard VARCHAR2 (30);
    number of l_shift_num;
    l_shift_name VARCHAR2 (240);
    l_line_num NUMBER;
    l_start_date DATE;
    l_end_date DATE;
    NUMBER of l_start_time1;
    NUMBER of l_end_time1;
    l_equipment_fk_key NUMBER;
    NUMBER of l1_plant_fk_key;
    Number of N;
    l_creation_system_id NUMBER;
    -l_organization_code VARCHAR2 (120);
    l_system_fk_key NUMBER;
    l_site_id NUMBER;
    l_entity_pk_key NUMBER;
    l_entity_name VARCHAR2 (100);
    l_entity_type VARCHAR2 (30);
    l_production_entity VARCHAR2 (1);
    l_shift_workday_pk_key NUMBER;
    DATE of l1_shift_date;
    l_from_date DATE;
    l_to_date DATE;
    l_shift_type VARCHAR2 (30);
    -l_graveyard_shift NUMBER;
    CURSOR c_shift_def IS

    Select the value of start_time, end_time, cemetery, shift_num, shift_name, shift_type
    -in l_start_time, l_end_time, l_graveyard, l_shift_num, l_line_num, l_shift_name, l_shift_type
    Of

    mth_site_shift_definitions where plant_fk_key = p_plant_fk_key;

    BEGIN

    l_plant_fk_key: = p_plant_fk_key;
    l_start_date: = p_start_date;
    l_end_date: = p_end_date;
    l_system_fk_key: = 'MTH_UTIL_PKG. ' "MTH_UA_GET_VAL"();

    -DELETE FROM mth_workday_shifts_D WHERE plant_fk_key = l_plant_fk_key and shift_date > = l_start_date;
    DELETE FROM mth_workday_shifts_D WHERE plant_fk_key = l_plant_fk_key and Trunc (from_date) > = l_start_date AND Trunc (from_date) < = l_end_date;
    DELETE FROM mth_workday_shifts_D WHERE plant_fk_key = l_plant_fk_key and shift_date > = l_start_date AND shift_date < = l_end_date;
    DELETE FROM mth_equipment_shifts_d WHERE availability_date > = l_start_date AND availability_date < = l_end_date
    AND equipment_fk_key IN (SELECT DISTINCT (Nvl(a.equipment_fk_key,0))
    OF mth_equipment_shifts_d a, mth_equipments_d b WHERE the b.equipment_pk_key = a.equipment_fk_key AND b.plant_fk_key = l_plant_fk_key
    UNION ALL
    Separate (SELECT Nvl(a.equipment_fk_key,0))
    OF mth_equipment_shifts_d a, mth_resources_d b WHERE the b.resource_pk_key = a.equipment_fk_key AND b.plant_fk_key = l_plant_fk_key

    UNION ALL
    Separate (SELECT Nvl(a.equipment_fk_key,0))
    OF mth_equipment_shifts_d a, mth_plants_d b WHERE the b.plant_pk_key = a.equipment_fk_key AND b.plant_pk_key = l_plant_fk_key

    UNION ALL
    Separate (SELECT Nvl(a.equipment_fk_key,0))
    OF mth_equipment_shifts_d a, mth_equip_entities_mst b WHERE the b.entity_pk_key = a.equipment_fk_key AND b.plant_fk_key = l_plant_fk_key
    );

    FOR l_shift_def IN c_shift_def
    LOOP

    l_start_time: = l_shift_def.start_time;
    l_end_time: = l_shift_def.end_time;
    l_graveyard: = l_shift_def.graveyard;
    l_shift_num: = l_shift_def.shift_num;
    -l_line_num: = l_shift_def.line_num;
    l_shift_name: = l_shift_def.shift_name;
    l_shift_type: = l_shift_def.shift_type;



    Select plant_pk in the mth_plants_d l_plant_pk where plant_pk_key = l_plant_fk_key;
    -SELECT organization_code INTO l_organization_code FROM mth_organizations_l WHERE plant_fk_key =
    -l_plant_fk_key;
    N: = l_end_date-l_start_date;

    because me in 1... N + 1
    LOOP



    l_last_update_system_id: = - 99999.
    l_last_update_date: = l_sysdate;
    l_creation_system_id: = - 1;
    l_start_time1: = TO_NUMBER (SUBSTR (l_start_time, 1, 2)) * 3600 +.
    TO_NUMBER (substr (l_start_time, 4, 2)) * 60 +.
    TO_NUMBER (substr (l_start_time, 7, 2));

    l_end_time1: = TO_NUMBER (SUBSTR (l_end_time, 1, 2)) * 3600 +.
    TO_NUMBER (substr (l_end_time, 4, 2)) * 60 +.
    TO_NUMBER (substr (l_end_time, 7, 2));


    INSERT INTO mth_workday_shifts_D (shift_workday_pk_key, shift_workday_pk,
    shift_date, shift_date_julian, plant_fk_key, shift_type,
    from_date, to_date, shift_num, graveyard_shift, shift_name,
    source_org_code, system_fk_key,
    CREATION_DATE, last_update_date, creation_system_id,
    last_update_system_id)
    VALUES (mth.mth_workdays_shifts_s.nextval,
    TO_CHAR (DECODE (GREATEST (l_start_time1, l_end_time1),
    l_start_time1, l_start_date,
    l_start_date) + ((TO_NUMBER (SUBSTR (l_start_time, 1, 2)) +))
    (TO_NUMBER (SUBSTR (l_start_time, 4, 2)) / 60) +.
    ((TO_NUMBER (SUBSTR (l_start_time, 7, 2)) / 3600)) (/ 24),
    "(AAAAMMJJ-hh24:mi:ss') ' | '-'|" l_shift_num | » -'|| l_plant_pk,
    DECODE (GREATEST (l_start_time1, l_end_time1), l_start_time1,)
    l_start_date + Decode (l_shift_def.graveyard, 'SED', 1, 0), l_start_date).
    TO_NUMBER (TO_CHAR (l_start_date, 'J')),
    l_plant_fk_key, l_shift_type, l_graveyard,
    l_start_date + ((TO_NUMBER (SUBSTR (l_start_time, 1, 2)) +))
    (TO_NUMBER (SUBSTR (l_start_time, 4, 2)) / 60) +.
    ((TO_NUMBER (SUBSTR (l_start_time, 7, 2)) / 3600)) (/ 24),
    DECODE (GREATEST (l_start_time1, l_end_time1), l_start_time1,)
    l_start_date + ((TO_NUMBER (SUBSTR (l_end_time, 1, 2)) +))
    (TO_NUMBER (SUBSTR (l_end_time, 4, 2)) / 60) +.
    ((TO_NUMBER (SUBSTR (l_end_time, 7, 2)) / 3600)) (/ 24) + Decode (l_shift_def.graveyard, 'SED', 1, 0),
    l_start_date + ((TO_NUMBER (SUBSTR (l_end_time, 1, 2)) +))
    (TO_NUMBER (SUBSTR (l_end_time, 4, 2)) / 60) +.
    ((TO_NUMBER (SUBSTR (l_end_time, 7, 2)) / 3600)) ((/ 24)),
    l_shift_num, l_shift_name, null, l_system_fk_key.
    l_sysdate, l_sysdate,
    (l_creation_system_id, l_last_update_system_id);
    l_start_date: = l_start_date + 1;


    END LOOP;
    COMMIT;



    l_start_date: = p_start_date;


    IF SUPERIOR (l_shift_type) = "BOTH" THEN
    INSERT INTO mth_equipment_shifts_d (equipment_fk_key, availability_date, shift_workday_fk_key, from_date, To_Date, line_num, availability_flag, entity_type, creation_date, last_update_date, creation_system_id,
    (last_update_system_id)

    SELECT b.entity_pk_key entity_pk_key, a.shift_date shift_date, a.shift_workday_pk_key shift_workday_fk_key, a.from_date from_date, To_Date, 1 line_num, 'Y', a.to_date
    b.entity_type entity_type, SYSDATE-1, SYSDATE,-99999

    -IN l_site_id, l_entity_pk_key, l_entity_name, l_entity_type, l_production_entity,.
    -l_shift_workday_pk_key, l1_shift_date, l_from_date, l_to_date
    Mth_workday_shifts_d a.,
    (
    SELECT site_id plant_fk_key, entity_pk_key, entity_name, entity_type, production_entity production_entity
    OF mth.mth_equip_entities_mst
    UNION ALL
    SELECT plant_pk_key site_id, plant_pk_key entity_pk_key, plant_name entity_name, "SITE", production_site production_entity
    OF mth.mth_plants_d
    UNION ALL
    SELECT plant_fk_key site_id, resource_pk_key entity_pk_key, nom_entite resource_name, "RESOURCE", production_resource production_entity
    OF mth.mth_resources_d
    UNION ALL
    SELECT plant_fk_key site_id, equipment_pk_key entity_pk_key, equipment_name entity_name, "EQUIPMENT", production_equipment production_entity
    OF mth.mth_equipments_d
    ) b
    WHERE b.site_id = a.plant_fk_key
    AND a.plant_fk_key = l_plant_fk_key
    AND shift_date > = l_start_date
    AND shift_date < = l_end_date
    AND SUPERIOR (a.shift_type) = "BOTH".
    - AND a.line_num = l_line_num
    AND a.shift_num = l_shift_num
    AND a.shift_name = l_shift_name
    AND l_shift_def.start_time = To_Char(from_date,'HH24:MI:SS')
    AND l_shift_def.end_time = To_Char(To_Date,'HH24:MI:SS'));)

    END IF;
    IF SUPERIOR (l_shift_type) = 'PROD-SHIFT' THEN
    INSERT INTO mth_equipment_shifts_d (equipment_fk_key, availability_date, shift_workday_fk_key, from_date, To_Date, line_num, availability_flag, entity_type, creation_date, last_update_date, creation_system_id,
    (last_update_system_id)

    SELECT b.entity_pk_key entity_pk_key, a.shift_date shift_date, a.shift_workday_pk_key shift_workday_fk_key, a.from_date from_date, To_Date, 1 line_num, 'Y', a.to_date
    b.entity_type entity_type, SYSDATE-1, SYSDATE,-99999

    -IN l_site_id, l_entity_pk_key, l_entity_name, l_entity_type, l_production_entity,.
    -l_shift_workday_pk_key, l1_shift_date, l_from_date, l_to_date
    Mth_workday_shifts_d a.,
    (
    SELECT site_id plant_fk_key, entity_pk_key, entity_name, entity_type, production_entity production_entity
    OF mth.mth_equip_entities_mst
    UNION ALL
    SELECT plant_pk_key site_id, plant_pk_key entity_pk_key, plant_name entity_name, "Site", production_site production_entity
    OF mth.mth_plants_d
    UNION ALL
    SELECT plant_fk_key site_id, resource_pk_key entity_pk_key, nom_entite resource_name, "Resource", production_resource production_entity
    OF mth.mth_resources_d
    UNION ALL
    SELECT plant_fk_key site_id, equipment_pk_key entity_pk_key, equipment_name entity_name, "Equipment", production_equipment production_entity
    OF mth.mth_equipments_d
    ) b
    WHERE b.site_id = a.plant_fk_key
    AND a.plant_fk_key = l_plant_fk_key
    AND shift_date > = l_start_date
    AND shift_date < = l_end_date
    AND b.production_entity = 'Y'
    AND SUPERIOR (a.shift_type) = "PROD-SHIFT."
    - AND a.line_num = l_line_num
    AND a.shift_num = l_shift_num
    AND a.shift_name = l_shift_name
    AND l_shift_def.start_time = To_Char(from_date,'HH24:MI:SS')
    AND l_shift_def.end_time = To_Char(To_Date,'HH24:MI:SS'));)

    END IF;
    IF SUPERIOR (l_shift_type) = 'NON-PROD-SHIFT' THEN
    INSERT INTO mth_equipment_shifts_d (equipment_fk_key, availability_date, shift_workday_fk_key, from_date, To_Date, line_num, availability_flag, entity_type, creation_date, last_update_date, creation_system_id,
    (last_update_system_id)

    SELECT b.entity_pk_key entity_pk_key, a.shift_date shift_date, a.shift_workday_pk_key shift_workday_fk_key, a.from_date from_date, To_Date, 1 line_num, 'Y', a.to_date
    b.entity_type entity_type, SYSDATE-1, SYSDATE,-99999

    -IN l_site_id, l_entity_pk_key, l_entity_name, l_entity_type, l_production_entity,.
    -l_shift_workday_pk_key, l1_shift_date, l_from_date, l_to_date
    Mth_workday_shifts_d a.,
    (
    SELECT site_id plant_fk_key, entity_pk_key, entity_name, entity_type, production_entity production_entity
    OF mth.mth_equip_entities_mst
    UNION ALL
    SELECT plant_pk_key site_id, plant_pk_key entity_pk_key, plant_name entity_name, "Site", production_site production_entity
    OF mth.mth_plants_d
    UNION ALL
    SELECT plant_fk_key site_id, resource_pk_key entity_pk_key, nom_entite resource_name, "Resource", production_resource production_entity
    OF mth.mth_resources_d
    UNION ALL
    SELECT plant_fk_key site_id, equipment_pk_key entity_pk_key, equipment_name entity_name, "Equipment", production_equipment production_entity
    OF mth.mth_equipments_d
    ) b
    WHERE b.site_id = a.plant_fk_key
    AND a.plant_fk_key = l_plant_fk_key
    AND shift_date > = l_start_date
    AND shift_date < = l_end_date
    AND b.production_entity =' no
    AND SUPERIOR (a.shift_type) = "NON-PROD-SHIFT."
    - AND a.line_num = l_line_num
    AND a.shift_num = l_shift_num
    AND a.shift_name = l_shift_name
    AND l_shift_def.start_time = To_Char(from_date,'HH24:MI:SS')
    AND l_shift_def.end_time = To_Char(To_Date,'HH24:MI:SS'));)

    END IF;

    COMMIT;
    END LOOP;

    l_start_date: = p_start_date;

    because me in 1... N + 1
    LOOP


    l_last_update_system_id: = - 99999.
    l_last_update_date: = l_sysdate;
    l_creation_system_id: = - 1;

    INSERT INTO mth_workday_shifts_D (shift_workday_pk_key, shift_workday_pk,
    shift_date, shift_date_julian, plant_fk_key, shift_type, graveyard_shift, from_date, to_date, shift_num, shift_name, source_org_code, system_fk_key,
    CREATION_DATE, last_update_date, creation_system_id,
    last_update_system_id)
    VALUES (mth.mth_workdays_shifts_s.nextval, l_start_date |) » -'|| l_plant_pk | 'MTH_UTIL_PKG '. "MTH_UA_GET_VAL"(), l_start_date, TO_NUMBER (TO_CHAR (l_start_date, 'J')),
    l_plant_fk_key, 'TWO', null, null,
    NULL, null, FND_PROFILE. VALUE ('MTH_CATCH_ALL_NAME'), null, l_system_fk_key,
    l_sysdate, l_sysdate, l_creation_system_id, l_last_update_system_id);
    l_start_date: = l_start_date + 1;


    END LOOP;
    COMMIT;
    l_start_date: = p_start_date;

    INSERT INTO mth_equipment_shifts_d (equipment_fk_key, availability_date, shift_workday_fk_key, from_date, To_Date, line_num, availability_flag, entity_type, creation_date, last_update_date, creation_system_id,
    (last_update_system_id)

    SELECT b.entity_pk_key entity_pk_key, a.shift_date shift_date, a.shift_workday_pk_key shift_workday_fk_key, Trunc (a.shift_date) from_date, Trunc (a.shift_date) To_Date, 1 line_num, 'Y ',.
    b.entity_type entity_type, SYSDATE-1, SYSDATE,-99999

    -IN l_site_id, l_entity_pk_key, l_entity_name, l_entity_type, l_production_entity,.
    -l_shift_workday_pk_key, l1_shift_date, l_from_date, l_to_date
    Mth_workday_shifts_d a.,
    (
    SELECT site_id plant_fk_key, entity_pk_key, entity_name, entity_type, production_entity production_entity
    OF mth.mth_equip_entities_mst
    UNION ALL
    SELECT plant_pk_key site_id, plant_pk_key entity_pk_key, plant_name entity_name, "Site", production_site production_entity
    OF mth.mth_plants_d
    UNION ALL
    SELECT plant_fk_key site_id, resource_pk_key entity_pk_key, nom_entite resource_name, "Resource", production_resource production_entity
    OF mth.mth_resources_d
    UNION ALL
    SELECT plant_fk_key site_id, equipment_pk_key entity_pk_key, equipment_name entity_name, "Equipment", production_equipment production_entity
    OF mth.mth_equipments_d
    ) b
    WHERE b.site_id = a.plant_fk_key
    AND a.plant_fk_key = l_plant_fk_key
    AND shift_date > = l_start_date
    AND shift_date < = l_end_date
    AND SUPERIOR (a.shift_type) = "BOTH".
    AND a.FROM_DATE IS NULL
    AND one. To_Date IS NULL
    - AND a.line_num = NULL
    AND a.shift_num IS NULL
    );



    -exception handling
    -EXCEPTION
    -WHEN NO_DATA_FOUND THEN
    -RAISE_APPLICATION_ERROR (-20001,
    -"An exception occurred');

    END GENERATE_SHIFTS;

    Thanks a lot for your help.
    Kind regards
    Amrit

    You have assigned data to N in the loop of the cursor which doesnot have given.

    N := l_end_date-l_start_date;
    

    Assign the value out of the loop as it doesnot has nothing to do with the cursor data.

    Twinkle

  • dynamically change the selection table of

    is it possible to dynamically change the table used in a select statement for an interactive report 3.2 on 11g database? I have a series of similar tables, one for each month of the year. I want to click a month on one page and to set up a table for this month report. I want to use a page for this report and have all the links from the link to the previous page on the same page, just different results based on what month has been clicked.
    I know I could just install 12 different reports and conditionally display each region based on a value passed to the page, but I prefer to create only a single page and a report on this page.

    Thanks for ideas or solutions.

    Hello:

    Because the tables involved are fixed for a given month, you can try something like

    select * from tab_1
    where :p_mth=1
    UNION
    select * from tab_2
    where :p_mth=2
    UNION
    ....
    select * from tab_12
    where :p_mth=12
    

    only the query for the IR. "P_MTH" is the page element has the value entered by the user for the months for which data should be retieved.

    CITY

  • How can I multiply all values of an array of 4 elements, with all its opposite values, resulting in an array with all 16 products?

    I'm quite new to LabVIEW (v.8.0) and I'm trying to understand the best way to have a table of 4 elements multiplied by its inverse values, resulting in an array of 16 elements

    Values of table 1 = 1, 2, 3, 4

    Values of table 1 reverse = 0.5, 0.33, 0.25, 1

    Resulting table = (0.33 0.25, 0.5, 1, 2, 1, 0.66, 0.5, 0.75, 1, 1.5, 3, 1.32, 4, 2, 1)

    Any advice would be appreciated. Thank you!

    You can try something like the following (the last operation is "reshaping table")

  • How to hide data in the table?

    Hello

    I'm using LabWindows/CVI 8.5 and I have a question about the use of tables.

    The problem is this: in my table, I have 8 columns.  I have columns of chains, whole, and a column of buttons - so there is a button on each line.  I have some information about each line I don't want to display in the table, however, I would like this information to be associated with other information on this line.  Each line represents a high lack of information from a log file - level when the user clicks on the button, I want to be able to go to the specified file and extract more detailed information about this flaw and display it on another Panel.  "Hidden" information are (1) file identification number, and (2) seek-card value... or 2 integers.  My problem is how to have these 2 pieces of information available for each line, but they have to be seen by the user.

    There are two ways I see this, but I did not really understand how to make no more.

    (1) I could have each key also contain a string that includes the 2 pieces of information (for example, "32:125567"), so that when I click the button, the application can retrieve the string value of the key, analyse and extract integer values from two...  I've done this work - BUT the button actually displays the string containing the numbers!  Is there a way to "hide" this information contained in the button?

    (2) alternative... Is it possible to include columns 'hidden' in a table that can contain information - but these columns are not displayed.  For example, my table is currently 8 visible columns.  Could I somehow add a column for file identification number and a column for search-map and have these columns be hidden from view (but still accessible to the application)?  I don't see a way to do this, but I'm still very inexperienced using tables in L/CVI.

    Or you guys maybe you know a better way to do...

    Thank you very much

    Harv

    Regarding your question 2, although it is probably replaced by my previous post, don't forget that a table can have more columns than those displayed on the screen.

    You can configure your table to have 10 columns, but only 8 shown (button ' size/scroll options' in table in the IUR editor properties); given that you can hide the horizontal scroll bar, even in this case you can store information in the table that are not accessible to the user.

Maybe you are looking for

  • EL Capitan - impossible to resize the partition in disk utility

    I'm having a problem with resizing the partition of my drive (background: I have 2 partitions, 350g for mac and 150g for bootcamp) I want to resize the mac one in order to free up space. in normal startup, disk utility tells me target disk is too sma

  • Connection receive Mini to a 720 p TV.

    Then the current model of Mac Mini support a 720 p set TV and if so, what would be needed for that Setup? I ask because the page on Apple's site for the tecniques of Mini just said "HDMI 1080" but does not explicitly say it will work for a set of nat

  • size of the binary value of fixing

    Hello Simple question but having a few problems to understand. I have a 13-bit binary value. I want to filter the last piece. How this can be done? Thank you

  • XP Pro ser CIP 2, Dell D:IM

    was a workstation to normal computor, just a sign in page, can not start up F12, get retry F1 and F2. being kill disk, all reload them Xp ready.

  • FIC Ip HP Officejet Pro K5400

    I'm helping friends with their HP Officejet Pro K5400, which is connected to a router that cannot use fixed IP addresses. Is it possible to set up a fixed IP with the printer?