Join of two tables in two different schemas

Hi all

I have an obligation to join two tables on two different schemas. How to join these two tables in the object view.

Thanks in advance.

Concerning
Kaushik Guillaumin

You can do just that using schema name in the +' view object.table name ' + according to the query object and also grant select the another schema to this schema user

ex
you need schem is test and another Act you need to a view object based on the test to join a table on shcema Act

you write semply object sql view code:

Act.table name

and you can also give him select statement on Bill schem table to test

concerning

Tags: Java

Similar Questions

  • How can I import tables to a different schema in the relational model existing... to add these tables in the existing model? PLSS help

    How can I import tables from a different schema in the relational model... to add these tables in the existing relational/logic model? PLSS help

    Notes; I already have a schema ready relational/logic model... and I need to add more tables to this relational/logic model

    can I import the same way like I did before?

    But even if I do the same how can I add it in the template? as the logic model has been designed...

    Help, please...

    Thank you

    To view the diagram of logic model in Bachman notation, you right-click on a blank area of the diagram and select the rating > Bachman Notation.

    David

  • How to collect statistics on the table for tables in a different schema

    Hi all

    I have a table in a schema, and I want to collect statistics for the table in a different schema.

    I gave GRANT ALL ON SCHEMA1. T1 TO SCHEMA2;

    And when I tried to run the command to collect statistics to help

    DBMS_STATS. GATHER_TABLE_STATS (OWNNAME = > 'SCHMEA1', TABNAME = > 'T1');

    The function will fail.

    Is there a way we can collect statistics of the table for tables in a schema into another schema.

    Thank you
    MK.

    You must grant analyze to schema2.

    SY.

  • Compare the table structures in different schemas. help please

    Hi all

    I have a question...


    I have pictures on different schemas something like


    Diagram A
    -------------
    Table 1
    Table 2
    Table 3


    Diagram B
    ------------
    Table 1
    Table 2
    Table 3


    Now situation is table 1 and table 2 will have a similar structure or table 1 in Figure B will have additional columns.

    like so... on... for all other tables...

    example!
    Schema A:
    
    Desc Table 1;
    
    Name                                  Type            Null
    -------------                             -------             -------
    No                                Number            Notnull
    Name                           Varchar2(10)     Not null
    Fee                              Number (10,2)   Not null
    
    
    
    Scheam B;
    
    Desc Table1;
    
    Name                                  Type               Null
    -------------                             -------             -------
    DX_No                                Number            Notnull
    DX_Name                           Varchar2(10)      Not null
    DX_Fee                              Number (10,2)   Not null
    comments                          Varchar(2)        
    Now I need to write some sort of procedure for the thing to compare these tables which are in different in the column names in the schema and get it had exported to an Excel sheet.
    and here it's first three columns SHOULD BE CONSIDERED AS SAME even if the DX_ prefix are from the REST OF the PART OF THE COLUMN NAME IS SAME.

    and the same way commit coloumn new schema B only... So it should be noted that excel sheets...

    I don't know how the ADO or SQL Developer handle this... Is there any plsql block that I can write to do it...

    Thanks in advance...

    Comparison of columns on all the tables in the two schema

    select tc1.owner,tc1.TABLE_NAME,tc1.COLUMN_NAME,
           tc2.owner,tc2.TABLE_NAME,tc2.COLUMN_NAME
    from
      all_tab_columns tc1
      full outer
      join all_tab_columns tc2 on &user1=tc2.owner
                               and tc1.TABLE_NAME=tc2.TABLE_NAME
                               and tc1.COLUMN_NAME like '%'||tc2.COLUMN_NAME
    where
    tc1.owner=&user2
    and tc1.TABLE_NAME in (
                          select t1.table_name
                          from all_tables t1
                          join all_tables t2 on t2.owner=&user2 and t1.table_name=t2.table_name
                          where t1.owner=&user1)
    

    Published by: xtender on 06.11.2010 12:43

  • Create the form on table in the different schema

    Hi all

    in APEX I am logged in as long as user APEX_USER and the table, I'm trying to access the site with the creation on Table Wizard form belongs to the user. I have granted all privileges on a given user APEX_USER table, the wizard allows me to choose this table in the list, but when I press the next button, I get the following error message:

    You do not have access to the schema that you import. Import failed.

    Contact your administrator for the application.

    Seems to me that something similar had been already discussed here, but still no response.

    V4.1 assistants when you use a different schema

    Please, what are the rights must have my APEX_USER to be able to create forms tables belonging to someone else?

    Thank you very much

    Pavel

    Edit: I did the same thing on my laptop (APEX 4.2.6.00.03) here and it works as expected. This error I get to work with APEX 4.2.3.00.08 (of course you should not necessarily be the cause, very likely, I don't have all of the necessary privileges) :-).

    Hi Mike,.

    Thanks again for your response. If the schema was not related to my workspace, I would yet be able to choose the other schema of the selection list.

    In fact, there seems to be a bug in the link in my message original (for example it is still not fixed in version 4.2.3), but fortunately I was able to find a workaround - I created a view with the same name and the same structure as the original table, and then I was able to generate the form with the wizard , finally I gave up the display and modification of processes page manually. So the solution is I have to force the DBA APEX upgraded to the current version :-).

    Best regards

    Pavel

  • FULLT OUTER JOIN on two different selects

    Hello

    I am facing a problem where I don't just get the handle to solve.

    I have two pieces of music with different return values. This value should be compared and joined. Simply put, I do an example where the return of the selection is represented as the table1 and table2
    Here is the example:
    table1
    abc_comp_nr, abc_cnt_emp
    12000, 15
    12500, 10
    13000, 30
    13500, 10
    
    table2
    xyz_comp_nr, xyz_cnt_emp
    12000, 15
    13000, 30
    14000, 20
    
    Output should be this:
    comp_nr, abc_cnt_emp, xyz_cnt_emp
    12000, 15, 15
    12500, 10, 0
    13000, 30, 30
    13500, 10, 0
    14000, 0, 20
    comp_nr is the combination of abc_comp_nr or xyz_comp_nr

    I tried this but did not work as expected:
    Select?, abc_cnt_emp, xyz_cnt_emp
    Of
    Table1 FULL OUTER JOIN table2
    ON abc_comp_nr = xyz_comp_nr

    Hope that someone was in trouble similar and found a good way to work it.

    Thanks in advance

    Tobias

    Hi, Tobias,.

    Tobias Arnhold wrote:
    Hello

    I am facing a problem where I don't just get the handle to solve.

    I have two pieces of music with different return values. This value should be compared and joined. Simply put, I do an example where the return of the selection is represented as the table1 and table2
    Here is the example:

    table1
    abc_comp_nr, abc_cnt_emp
    12000, 15
    12500, 10
    13000, 30
    13500, 10
    
    table2
    xyz_comp_nr, xyz_cnt_emp
    12000, 15
    13000, 30
    14000, 20
    

    Whenever you have a problem, post CREATE TABLE and INSERT statements for the sample data.
    See the FAQ forum {message identifier: = 9360002}

    Output should be this:
    comp_nr, abc_cnt_emp, xyz_cnt_emp
    12000, 15, 15
    12500, 10, 0
    13000, 30, 30
    13500, 10, 0
    14000, 0, 20
    

    comp_nr is the combination of abc_comp_nr or xyz_comp_nr

    I tried this but did not work as expected:
    Select?, abc_cnt_emp, xyz_cnt_emp
    Of
    Table1 FULL OUTER JOIN table2
    ON abc_comp_nr = xyz_comp_nr

    Instead of??? you want to

    NVL (abc_comp_nr, xyz_comp_nr)
    

    The first column is supposed to be the common identifier, abc_comp_nr, or xyz_comp_nr. It doesn't matter which, since the join condition

    ON abc_comp_nr = xyz_comp_nr
    

    said they will be the same, except that it's a FULL OUTER JOIN, if one of them might be null. If you want to display the non NULL when one of them is NULL and or the other (any) when they are both present. It's just that NVL.

    You can use NVL on other columns, too, to display 0 instead of NULL when there is no match:

    SELECT   NVL ( abc_comp_nr, xyz_comp_nr)     AS comp_nr
    ,        NVL ( abc_cnt_emp, 0)               AS abc_cnt_emp
    ,      NVL ( xyz_cnt_emp, 0)               AS xyz_cnt_emp
    FROM              table1
    FULL OUTER JOIN  table2  ON  abc_comp_nr  = xyz_comp_nr
    ;
    

    However, this will display 0 instead of NULL for abc_cnt_emp and xyz_cnt_emp when these columns are NULL for a reason, not just at the time when they do not reach the join condition. If the original paintings contain NULL values and you should keep NULL values in the result set, but you want NULLs which were created by the outer join to show as 0, then you may want something like this:

    SELECT   NVL ( abc_comp_nr, xyz_comp_nr)     AS comp_nr
    ,        NVL2 ( abc_comp_nr, abc_cnt_emp, 0)     AS abc_cnt_emp
    ,      NVL2 ( xyz_comp_nr, xyz_cnt_emp, 0)     AS xyz_cnt_emp
    FROM              table1
    FULL OUTER JOIN  table2  ON  abc_comp_nr  = xyz_comp_nr
    ;
    

    Whenever you use FULL OUTER JOIN, there is an excellent chance that you will want to use NVL (or his brother younger, stronger, COALESCE, or their cousin NVL2) as well.

    Published by: Frank Kulash on 3 March 2013 14:49

  • "import tables to a different scheme."

    Hello
    I use oracle 10g R2 and Ii have created 1 dmp file with the help of oracle export utility that contains the objects of the two schemas (user1 and user2). I have now created a user "gab10" now I want to import the schema tables both.
    Can anyone tell me is it possible using oracle import utility and how.



    Greetings and thanks
    Vikash Chauradia

    Vikash Chauradia (DBA) wrote:
    Hello
    I use oracle 10g R2 and Ii have created 1 dmp file with the help of oracle export utility that contains the objects of the two schemas (user1 and user2). I have now created a user "gab10" now I want to import the schema tables both.
    Can anyone tell me is it possible using oracle import utility and how.

    Yes it is possible, as below

    imp gab10/pass fromuser=(user1,user2) touser=(gab10,gab10) file='your_dmp_file'
    
  • Load data from one table into another table of 2 different schemes

    Hello

    We have a requirement to insert data into a table in a schema of a table that is in other schemas in ODI.

    We are able to do so by creating interfaces and mappings. But we now expect to do using SQL instead of ODI interfaces.

    Is it possible to do this using the SQL statements we have source and target data sources defined in ODI.

    should be like "Insert into src.table select * from tar.table'"

    Thank you...

    Hello

    If you try to load a db to another db using sql (sql free hand) instead of interfaces instructions.

    It is possible using procedures odi too.

    1. Select the project (designer navigator) odi mode

    2. create the new procedure. Then add the command.

    in this command on the source command on the tabs of the target.

    Enter the sql statements. See the screenshots below...

    I think this will help for you,

    Thank you best regards &,.

    A.Kavya

  • Access a table in a different schema

    Hello geniuses.

    I have an APEX application built in the WVUAMS schema. I need to access the WVUMYA_USERS table that exists in the WVUMYA schema. How can I get APEX to allow this? Still running in the WVUAMS schema, my query is: SELECT * FROM WVUMYA. WVUMYA_USERS, but I get an error "table or view does not exist.

    I'm still fairly new to APEX and I have no access DBA or capabilities, then the chances are that I won't be able to do what you suggest on my own, but I'll try or ask someone else to do what you suggest the best I can.

    Thank you in advance!
    Jim

    HI jim,.

    WVUAMS - Application schema
    WVUMYA - owner of the object that you want to access from the schema WVUAMS

    When you run under request as a user WVUAMS
    in the workshop of SQL > SQL commands, you are able to get records of WVUMYA. WVUMYA_USERS?, if so same query should run on apex as well.

    SELECT * FROM WVUMYA.WVUMYA_USERS 
    

    If you get "table or view does not exist ', Flip to the user of WVUMYA and the question

    grant select on WVUMYA_USERS to WVUAMS
    

    Now go back to WVUAMS and run the query, you should be able to display the records of WVUMYA. WVUMYA_USERS

    Tell us just how much exactly you are doing in the apex in the apex, you are trying to run the same query or trying to select the table in the object list?

    To find out if you sqlplus(on windows) start > run > sqlplus

    Please take a look at this also http://docs.oracle.com/cd/B19306_01/server.102/b14200/statements_7001.htm

  • How to join two tables of different schemas of Oracle by using a subquery

    I'm trying to join two different schemas of Oracle tables using a subquery. I can extract data from each of the tables without problem. However, when I combine select statements it by using a subquery I get Oracle error *'ORA-00936: lack of expression ' *. Given that each SELECT statement runs on its own without error I don't understand what's missing. I'm trying to get the result set is matching the LINE_ID of PDTABLE_12_1 in the schema with the table PDTABLE_201 MAT_DESCRIPTION DD_12809 in the RA_12809 schema.

    The query is as follows:

    SQL = "SELECT [DD_12809]. [PDTABLE_12_1]. LINE_ID OF [DD_12809]. [PDTABLE_12_1] JOIN "_".
    + "(SELECT [RA_12809]. [PDTABLE_201]. MAT_DESCRIPTION "_".
    "FROM [RA_12809]. [PDTABLE_201]) AS FAB "_".
    + 'ON [DD_12809]. [PDTABLE_12_1]. PIPING_MATER_CLASS = FAB. PIPING_MATER_CLASS ".

    The format of the request is copied from a manual of programming SQL.

    I also tried running the query uses a right JOIN on the two tables, but got the same results. Any ideas would be useful. Thank you!

    Published by: user11338343 on October 19, 2009 06:55

    The format for the join of two tables in Oracle feels like any other database:

    SELECT a.col1, a.col2, ..., b.col1, b.col2, ...
    FROM   schema1.table1 a,
           JOIN schema2.table2 b ON a.col = b.col and ...
    WHERE  a.other_col = 'FRED'
    AND    ....;
    

    Do not place bracketed identifiers in Oracle. The account that connects to the database must have select privileges on the two tables.

  • Data Pump: export/import tables in different schemas

    Hi all

    I use Oracle 11.2 and I would like to use the data pump to export / import data into the tables between the different schemas. The table already exists in the source and target schemas. Here are the commands that I use:


    Script working export:

    expdp scott/tiger@db12 schema = source include = TABLE:------"IN (\'TB_TEST1 ', \'TB_ABC')\ 'directory = datapump_dir dumpfile = test.dump logfile = test_exp.log

    Script to import all the desks:

    Impdp scott/tiger@db12 remap_schemas = rΘpertoire source: target = datapump_dir dumpfile = test.dump logfile = test_imp.log content = data_only table_exists_action = truncate

    Script error for some tables to import:

    Impdp scott/tiger@db12 remap_schemas = source: target include = TABLE:------"IN (\'TB_TEST1')\' directory = datapump_dir dumpfile = test.dump logfile = test_imp.log content = data_only

    Export is good, I got the folling error when I try to import the table TB_TEST1 only: "ORA-31655: no metadata data_or objectsz selected for employment. The user scott is a DBA role, and it works fine when I try to import all tables being export without the include clause.

    It is possble to import some tables but not all tables in the export file?

    Thanks for the help!

    942572 wrote:

    It's good to import all tables exported through Scott, who do NOT have the clause 'include '.

    I have the error only when I try to import some tables with clause "include".

    Can I import only some table since the export dump file? Thank you!

    you use INCLUDE incorrectly!

    do below yourself

    Impdp help = yes

    INCLUDE

    Include the specific object types.

    For example, INCLUDE TABLE_DATA =.

  • Moved to subpartitions in a table doubles in another schema.

    + NOTE: I asked this question on the forum SQL and PL/SQL , but came here as I think it is more appropriate to this forum. I placed a pointer to this post on the original post. +

    Hello ladies and gentlemen.

    We are currently involved in an exercise on my place of work where we're trying to logically organize our data by world region. For more information, our database of production is currently at version 10.2.0.3 and will soon become 10.2.0.5.

    For the moment, all our data "lives" in the same schema. We are trying to produce a proof of concept to migrate this data to the identically structured (and named) tables in separate database schemas. Each schema to represent a world region.

    In our current schema, our data are partitioned to date range and then list partitioned on a column named OFFICE. I want to spend the subpartitions of OFFICE of a schema in a same table named and structured in a new scheme. The tablespace will remain the same for the two tables with the same name in the two schemas.

    Any of you have an opinion on the best way to do it? Ideally in the new scheme, I would like to create each table an empty array with the appropriate range and list partitions that are defined. I did a few tests in our development environment with the EXCHANGE PARTITION statement, but this needs to be non partitioned, the destination table.

    I was wondering if, for the migration of partition in all drawings bearing the name of the table and tablespace remains constant, there is a formal method of 'best practices' to accomplish such a move subpartition cleanly, quickly and elegantly?

    Welcome any helpful response.

    See you soon.

    James

    You CAN exchange a subpartition in another table by using a 'temporary' (intermediate) as an intermediate table.

    See:

    SQL> drop table part_subpart purge;
    
    Table dropped.
    
    SQL> drop table NEW_part_subpart purge;
    
    Table dropped.
    
    SQL> drop table STG_part_subpart purge;
    
    Table dropped.
    
    SQL>
    SQL> create table part_subpart(col_1  number not null, col_2 varchar2(30))
      2  partition by range (col_1) subpartition by list (col_2)
      3  (
      4  partition p_1 values less than (10) (subpartition p_1_s_1 values ('A'), subpartition p_1_s_2 values ('B'), subpartition p_1_s_3 values ('C'))
      5  ,
      6  partition p_2 values less than (20) (subpartition p_2_s_1 values ('A'), subpartition p_2_s_2 values ('B'), subpartition p_2_s_3 values ('C'))
      7  )
      8  /
    
    Table created.
    
    SQL>
    SQL> create index part_subpart_ndx on part_subpart(col_1) local;
    
    Index created.
    
    SQL>
    SQL>
    SQL> insert into part_subpart values (1,'A');
    
    1 row created.
    
    SQL> insert into part_subpart values (2,'A');
    
    1 row created.
    
    SQL> insert into part_subpart values (2,'B');
    
    1 row created.
    
    SQL> insert into part_subpart values (2,'B');
    
    1 row created.
    
    SQL> insert into part_subpart values (2,'C');
    
    1 row created.
    
    SQL> insert into part_subpart values (11,'A');
    
    1 row created.
    
    SQL> insert into part_subpart values (11,'C');
    
    1 row created.
    
    SQL>
    SQL> commit;
    
    Commit complete.
    
    SQL>
    SQL> create table NEW_part_subpart(col_1  number not null, col_2 varchar2(30))
      2  partition by range (col_1) subpartition by list (col_2)
      3  (
      4  partition n_p_1 values less than (10) (subpartition n_p_1_s_1 values ('A'), subpartition n_p_1_s_2 values ('B'), subpartition n_p_1_s_3 values ('C'))
      5  ,
      6  partition n_p_2 values less than (20) (subpartition n_p_2_s_1 values ('A'), subpartition n_p_2_s_2 values ('B'), subpartition n_p_2_s_3 values ('C'))
      7  )
      8  /
    
    Table created.
    
    SQL>
    SQL> create table STG_part_subpart(col_1  number not null, col_2 varchar2(30))
      2  /
    
    Table created.
    
    SQL>
    SQL> -- ensure that the Staging table is empty
    SQL> truncate table STG_part_subpart;
    
    Table truncated.
    
    SQL> -- exchanging a subpart out of part_subpart
    SQL> alter table part_subpart exchange subpartition
      2  p_2_s_1 with table STG_part_subpart;
    
    Table altered.
    
    SQL> -- exchanging the subpart into NEW_part_subpart
    SQL> alter table NEW_part_subpart exchange subpartition
      2  n_p_2_s_1 with table STG_part_subpart;
    
    Table altered.
    
    SQL>
    SQL>
    SQL> select * from NEW_part_subpart subpartition (n_p_2_s_1);
    
         COL_1 COL_2
    ---------- ------------------------------
            11 A
    
    SQL>
    SQL> select * from part_subpart subpartition (p_2_s_1);
    
    no rows selected
    
    SQL>
    

    I traded subpartition p_2_s_1 out of the part_subpart table in the NEW_part_subpart table - even with a different name for the subpartition (n_p_2_s_1) If you wish.

    NOTE: because the source and target tables are in different schemas, you need to move (or copy) the intermediate table STG_part_subpart from the schema of the first towards the second scheme after that first "Exchange subpartition' is done. You will need to do this for each subpartition to Exchange.

    Hemant K Collette

    Published by: Hemant K deal April 4, 2011 10:19
    Added details for cross-schema exchange.

  • Left join between two tables using two different conditions

    I have following three tables with their data, as shown below.

    CREATE TABLE TIREMASTERPROCESS_TEMP
    (
    PRODUCTIONCODE TANK (12 BYTES),
    FIELDNAME CHAR (12 BYTES),
    DATACHR VARCHAR2 (60 BYTE),
    REVISIONNO TANK (3 BYTES),
    DATANUM NUMBER (9.4)
    )
    Whether the table c. and its sample data are like

    FIELDNAME DATACHR REVISIONNO DATANUM PRODUCTIONCODE
    AB No. Nch 1 100 0
    AB No. Nch 1 108 0
    AB No.-of-Nch 1 1 0
    Ass42 teased dishes 1 0
    Ass42 BTDrumNo1 BTD-051 1 0
    AB53 BTDrumNo1 BTD-051 104 0


    CREATE TABLE materialcode
    (
    UPPERMATERIALCODE CHAR (20),
    PROCESSNO TANK (3),
    PROCESSADOPTDATE TANK (9)

    )
    Whether the table b. and its sample data are like

    UPPERMATERIALCODE PROCESSNO PROCESSADOPTDATE
    Ass42 1 20120717
    AB53 108 20121121
    111 20111104 AS05
    104 20120928 AS30


    CREATE TABLE BUILDINGSCHEDULEMASTER
    (
    BUILDINGSIZE TANK (5 BYTES),
    GTCODE FLOAT (4 BYTES),
    TIREPERCART NUMBER (3.0).
    BUILDINGLOT NUMBER (3.0)
    )
    Whether table and its sample data are like

    BUILDINGSIZE GTCODE TIREPERCART BUILDINGLOT
    AB42A 4 12 ass42
    AB53A 4 88 AB53
    AS30A AS30 4 80
    BF03A 1 90 BF03


    Now, I need to get some data in these fields by using the suite of mappings.

    « PR_ » || Trim (a.BUILDINGSIZE) | ' / MPL2' Processid,--PRIMARY KEY
    TO_DATE (substr (NVL(b.PROCESSADOPTDATE,'19800101'), 7, 2) |) » /'|| SUBSTR (NVL(b.PROCESSADOPTDATE,'19800101'), 5, 2) | » /'|| SUBSTR (NVL(b.PROCESSADOPTDATE,'19800101'), 1, 4). (' 01:00:00 ',' dd-mm-yyyy hh24:mi:ss') starteff, to_date (SUBSTR (NVL(b.PROCESSADOPTDATE,'19800101'), 7, 2) |) » /'|| SUBSTR (NVL(b.PROCESSADOPTDATE,'19800101'), 5, 2) | » /'|| SUBSTR (NVL(b.PROCESSADOPTDATE,'19800101'), 1, 4). (' 01:00:00 ',' dd-mm-yyyy hh24:mi:ss') startDate.
    b.PROCESSNO revisioncodeid,
    a.BUILDINGLOT tirepercart ,
    CASE WHEN c.FIELDNAME = 'BTDrumNo1' then c.DATACHR end drumtype1.
    BOX WHEN (trim (C.DATACHR) = '1' and trim (C.FIELDNAME) = "No. Nch") and THEN click 'YES '.
    ANOTHER 'NO '.
    END may-BUG,
    case
    When c.FIELDNAME = 'Wavy'
    AND c.DATACHR = 'Use' THEN on 'YES '.
    When c.FIELDNAME = 'Wavy'
    AND c.DATACHR <>'Use' THEN 'NO '.
    fine wavy


    Now for the tables A and B I have the simple join as condition

    a.GTCODE = b.UPPERMATERIALCODE

    But I have to use two different left join conditions to join the table B and C to calculate the RESP fields according to the condition.
    Now, I have to use

    (trim (b.UPPERMATERIALCODE)). » -'|| Trim (b.PROCESSNO) = Trim (c.PRODUCTIONCODE) | » -'|| Trim (c.REVISIONNO)

    condition to get the data for the WAVY and DRUMTYPE1 fields.

    But at the same time, I have to use

    substr (Trim (b.UPPERMATERIALCODE), 1, 2). » -'|| Trim (b.PROCESSNO) = Trim (c.PRODUCTIONCODE) | » -'|| Trim (c.REVISIONNO)

    conition to derive the CHAFER field.

    And for this reason I am come so many duplicates and do not correct results for JUNEBUG, WAVY, DRUMTYPE1, and STARTDATE field.

    I need some advice as how can I do so that I get the correct results without duplicates for the PRIMARY KEY.

    Thank you

    Mahesh

    It would have been easier to answer if you gave us your example query that gives incorrect results - which both show us what you are doing and give us a starting point.
    Insert instructions for data, rather than only the data would have helped too, making it more quick to test this point.
    You do not show what you have done with your two outer join criteria, but I think you need to list TIREMASTERPROCESS_TEMP in your query twice, with alias names. Here's what I did:

    select a.BUILDINGSIZE, a.GTCODE, b.PROCESSNO ,  c1.FIELDNAME, c1.DATACHR, C2.FIELDNAME, C2.DATACHR
    , CASE WHEN c1.FIELDNAME='BTDrumNo1' then c1.DATACHR end drumtype1
    , CASE WHEN (trim(c2.DATACHR) = '1' and trim(c2.FIELDNAME) = 'No-of-Nch') THEN 'YES' ELSE 'NO' END CHAFER
    , case when c1.FIELDNAME='Wavy' AND c1.DATACHR='Use' THEN 'YES'
           when c1.FIELDNAME='Wavy' then 'NO' else null end wavy
    from BUILDINGSCHEDULEMASTER        A
    join materialcode b on a.GTCODE=b.UPPERMATERIALCODE
    left outer join TIREMASTERPROCESS_TEMP c1
       ON trim(b.UPPERMATERIALCODE)||'-'||trim(b.PROCESSNO) = trim(c1.PRODUCTIONCODE)||'-'||trim(c1.REVISIONNO)
    left outer join TIREMASTERPROCESS_TEMP c2
       ON substr(trim(b.UPPERMATERIALCODE),1,2)||'-'||trim(b.PROCESSNO) = trim(c2.PRODUCTIONCODE)||'-'||trim(c2.REVISIONNO)
    

    C1 is an alias for the TIREMASTERPROCESS_TEMP line which is necessary for drumtype1 and wavy, c2 is an alias for the TIREMASTERPROCESS_TEMP line required for JuneBug. There was some minor errors in your calculations of field I tried to correct.

    The results are:

    BUILD GTCO PRO FIELDNAME    DATACHR    FIELDNAME    DATACHR    DRUMTYPE1  CHA WAV
    ----- ---- --- ------------ ---------- ------------ ---------- ---------- --- ---
    AB53A AB53 108                         No-of-Nch    1                     YES
    AB42A AB42 1   BTDrumNo1    BTD-051    No-of-Nch    1          BTD-051    YES
    AB42A AB42 1   Wavy         NotUse     No-of-Nch    1                     YES NO
    AS30A AS30 104                                                            NO
    

    Hope this helps,
    David

  • How can I join two tables that belong to two different databases?

    I can build a SQL query in SQL Server Management Studio, which performs a join of a table in a database with a table in another database.  I have a good 'read' name to username/password for the two databases.

    How to do the join in ColdFusion?  The tag < cfquery > requires a unique data source.  I could do like two queries and through comparing, or maybe even some use dbtype = query, but it would be horribly less effective than a direct join.

    I could place the SQL statement in a stored procedure, but that seems like overkill - all the necessary number of fields in the "WHERE" clause will change based on the logic of the ColdFusion program.

    Does anyone know of a way to do this with < cfquery >?

    How do you take in SQL Server Management Studio?  You must do something that I'm not aware, if what you're doing here does not work in a block.

    The way I did in the past is just to fully qualify the names of the tables.  Server.databaseOwner.database.table know if I remember correctly.

    This does not require that the database connected to the name of data source is configured to be allowed to connect to the database.

  • A target table is in charge of two different sources but the same columns, but a source is one database and another in a flat file.

    We all hope you are doing well.

    I have a business problem to implement in ODI 11 G. It's here. I'm trying to load a target table from two sources that have the same column names. But a source is to the file format and the other is in the Oracle database.

    That's what I think I'll create two mappings in the same interface by using the Union between the sources. But I don't know how the interface would connect to different logical architecture to connect to two different sources.

    Thank you

    SM

    You are on the right track, all in a single interface. Follow these steps

    (1) pull model of your data in the designer of the source file and your table model target to the target pane.

    (2) all relevant columns map

    (3) in the source designer to create a new dataset and choose as the UNION join type (this will create a separate tab in the source designer pane)

    (4) select the new dataset tab in the source designer pane and pull your source oracle table data model in the designer of the source. All columns that are relevant to the target card

    (5) make sure that your staging location is set to a relational technology i.e. in this case the target would be an ideal candidate because it is where the ODI will organize the data from source two files and oracle and perform the UNION before loading to the target

    If you want to watch some pretty screenshots showing the steps above, take a look at http://odiexperts.com/11g-oracle-data-integrator-part-611g-union-minus-intersect/

Maybe you are looking for

  • Why the new update disables my internet security?

    I use Kaspersky Total Security, and the update of Firefox says it has disabled because it is "unsigned".

  • Unable to block the port with pfctl(8)

    I try to block the process that is listening on the port on my MacBook Pro 9110 to simulate the network interruption. If I have the following rule: ------------------------------------------------------------------- block fast drop on all proto tcp f

  • When closing my one computer program "" ITIBITI /. ". EXE"appears on the screen prevents the computer shutdown.

    Original title: when closing my computer a program "" ITIBITI /. ". EXE"appears on the screen prevents the closing... the computer needed to force the point to close before I can close the computer I don't know how to describe it better but will try.

  • Problem with E380 Bluetooth

    I am able to pair my phone with E380 and media of car for the first time. But every time I restart the car the pair will happen only with phone not with the media. It says under Bluetooth connected (no media). Whenever I need to re-register the car m

  • I need your help. I forgot my administrator password.

    I can connect to my laptop using the standard user account. My problem is I can not change the security settings, tune up and download any program, because somehow the administrators password has been changed and forgotten and I have not a flashdrive