Outer join for a database view

Dear Experts,
Could you tell me what is the outer join and the example of this?
Is it possible I can create an outer join view for generic extraction?
Thanks.
Arthur

This is what a nested loops would look like in ABAP.  It is not a function module, but it could be made into one very easily.
REPORT zz_temp.
DATA: l_t_tstc    TYPE TABLE OF tstc,
      l_t_tstct   TYPE TABLE OF tstct,
      l_s_tstc    TYPE tstc,
      l_s_tstct   TYPE tstct.
SELECT *
INTO CORRESPONDING FIELDS OF l_s_tstc
FROM tstc AS t.
  SELECT tt~ttext
  INTO CORRESPONDING FIELDS OF l_s_tstct
    FROM tstct AS tt
    WHERE tt~tcode = l_s_tstc-tcode
    AND tt~sprsl = sy-langu.
  ENDSELECT.
  WRITE:/ l_s_tstc-tcode,l_s_tstct-ttext.
ENDSELECT.

Similar Messages

  • Outer joins across multiple databases

    I'm trying to join three tables: 2 from data warehouse and 1 from Siebel database in OBIEE. I create the physical and logical joins (no errors or warnings). The model looks like this: Account Address (table 1) -> Account (table 2) -> Siebel Customer Data (table 3)
    I create two queries in Answers:
    (1) Account.Number and Siebel.Address (the query works)
    (2) Account Address.Zip, Account.Number, and Siebel.Address (the query gets the following error):
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 42019] Join condition, D901.c3 <> 0, contains predicates that are currently not supported for outer joins across multiple databases. (HY000)
    Can someone help me understand why the join between the two databases works for the first query but when I add a second table it fails?
    thanks...

    Either you can link the Oracle DB into Access (by using File/Get External Data/Link Tables)
    or you have to simulate the join in Java by doing two separate queries and looping through the results.

  • What is size limit for a database view?

    hi all..
    can anybody pls tell me about the size category for a database view?

    hi
    check out this document
    http://help.sap.com/saphelp_nw04/helpdata/en/36/74c0358373003ee10000009b38f839/frameset.htm
    this would answer all ur queries
    regards
    Aakash Banga

  • Create a outer Join for a @SecondaryTable in EJB 3.0

    Hello
    I need to create a outer Join for a @SecondaryTable in EJB 3.0, any can help me?
    Thanks in Advance…

    Yes, I have this relations in the entity:
    @Table(name = "RF_HTRANSACTION")
    @SecondaryTables({
    @SecondaryTable(name="RF_CLIENTS",
    pkJoinColumns={@PrimaryKeyJoinColumn(name="NUMERO_CLIENTE", referencedColumnName="NUMERO_CLIENTE")}
    @SecondaryTable(name="RF_SUPPLIER",
    pkJoinColumns={@PrimaryKeyJoinColumn(name="NUMERO_PROVEEDOR", referencedColumnName="NUMERO_PROVEEDOR")}
    @SecondaryTable(name="RFSUPPLIER_PROY",
    pkJoinColumns={@PrimaryKeyJoinColumn(name="NUMERO_PROYECTO", referencedColumnName="NUMERO_PROYECTO")}
    @SecondaryTable(name="RF_REFAGENTS",
    pkJoinColumns={@PrimaryKeyJoinColumn(name="NUMERO_RA", referencedColumnName="NUMERO_RA")}
    I need to create a outer join between RF_HTRANSACTION and RF_REFAGENTS.

  • Alternative for OUTER Join for use in fast refresh materialized view

    Hi ,
    I have two tables as :
    CREATE TABLE TEST_SANDY1
    COL1 NUMBER
    CREATE TABLE TEST_SANDY2
    COL1 NUMBER,
    COL2 VARCHAR2(10 BYTE)
    Data for the tables are :
    INSERT INTO TEST_SANDY1 ( COL1 ) VALUES (
    1);
    INSERT INTO TEST_SANDY1 ( COL1 ) VALUES (
    2);
    INSERT INTO TEST_SANDY1 ( COL1 ) VALUES (
    3);
    COMMIT;
    INSERT INTO TEST_SANDY2 ( COL1, COL2 ) VALUES (
    1, 'a');
    INSERT INTO TEST_SANDY2 ( COL1, COL2 ) VALUES (
    2, 'b');
    INSERT INTO TEST_SANDY2 ( COL1, COL2 ) VALUES (
    4, 'd');
    COMMIT;
    Now when I run the following select statement :
    select
    b.col1
    from
    test_sandy1 a,
    test_sandy2 b
    where
    b.COL1 = a.COL1(+)
    I get :
    COL1
    1
    2
    4
    I want to build a materialized view to generate the same values but it has to be fast refresh. But since I am using outer join I am unable to create a fast refresh one.
    Can someone suggest an alternate select to create fast refresh materialized view.
    Thanks,
    Sandipan

    The select statement was not fitting my problem , so I'll change it as :
    select
    a.col1, nvl(b.col2, 'DEFAULT')
    from
    test_sandy1 a,
    test_sandy2 b
    where
    b.COL1(+) = a.COL1
    I get :
    COL1     VAL
    1     a
    2     b
    3     DEFAULT
    How do I this ?

  • A dimension table outer join across two databases

    I have two databases of the same schema but may have different data that I would like to do comparisons on. For this discussion, each has two tables, Dimension and Fact. I created a common dimension which would show dimension data that exists on both databases. However, I want a common dimension which is a full outer join of the two Dimension tables that can be used to view data on the Fact tables on the two databases; this seems to be a little difference than a fact which may having missing value, isn't it? should this outer join occurs at the physical or logical? Can I even do it at physical if the data are from two different source? Any recommendation on what is the best way to do so? Thanks

    It depends on how you are defining your BM. Always, BM is for creating joins on folders within BM, in the sense that each folder can contain data from within multiple databases. So, create it in Physical layer and also create new joins for your defined facts dimensions in BM. But remember, cross database joins are not recommended. If both your schemas reside on 2 different oracle databases, you would be better off creating a single view (by creating a dblink between these 2 databases). So, create a single view and include that in the physical layer.
    Thanks,
    Venkat
    http://oraclebizint.wordpress.com

  • How to find Inner join or (Left)outer join for Infoset

    Dear Experts,
    We have one Infoset which is based on the Master data and DSO. It is linked 0BPARTNER field From the Master Data and SOLD TO PARTY field from the DSO.
    Here Could you please suggest me how can we able to find that whether this Infoset is based on Inner Join or (Left) outer join.
    Thanks and Regards,
    Suresh.

    HI Suresh,
    If the infoset is based on left outer join , you see the respective table shaded in a dirrerent colour and also displays
    that it is a left outer join in the connection
    refer the below link for the details on left outer join , you can make a join as left outer from the context menu of the
    object required
    http://help.sap.com/erp2005_ehp_04/helpdata/EN/21/af0942b9dc9c39e10000000a155106/frameset.htm
    Regards,
    Sathya

  • Handling Outer Join for hard coded values in the Logical Table Source

    Has anyone tried to apply an outer join in the Logical Table Source Content Tab?
    I have to add this APPLSYS.FND_LOOKUP_VALUES.LANGUAGE (+)= 'US' but the outer join is not allowed. I get this message.... [nQSError: 27002] Near <(>: Syntax error [nQSError: 26012] .
    Could you tell me please how this should be handled? I have a lot of this cases in my project and without this being set-up affects the expected output of my report.
    Thank you in advance.

    hi Ap,
    Pull only Dim_W_LOV_D_Acty_Src column into answers and check whether u r able to see CUST_SRC_ACT or not .Of course, you need to check sql query too
    Thanks,
    Saichand.v

  • Outer Join for 2 Tables?

    Hi,
    i have 3 Tables, one is the "main" table.
    Table1
    Col1
    Col2
    Col3
    Table2
    Col2
    Col4
    Col5
    Table3
    Col4
    Col6
    Now i want all hits from Table 1, all outer join hits from table 2 and the regarding rows from table 3.
    The join from Table1 to Table2 is no problem, but how to add table3?
    SELECT *
        FROM table1 AS t1
              LEFT OUTER JOIN table2 AS t2
                    ON t2col2 = t1col2
       INTO CORRESPONDING FIELDS OF TABLE      result
        WHERE t1~col1 IN so_col1.

    Hi,
    a right table in an outer join cannot become a part of an inner join or an outer join. So you will have to use some other technique.
    meaing table1 connects to table2 with an outer join resulting in all rows table1 and cooresponding if existing from table2, now table2 is the right table it cannot make a join with table3. inner or outer.
    regards,
    Khusro Habib

  • How to do outer join in data model view?

    Hi,
    I have 2 queries are needed to be joined in Oracle Report 6i Data Model View. What I want to do is below:
    where table1.receipt_no(+)=table2.receipt_no
    How do I use the 'Data Link' to do this in Data Model view?
    Thanks.
    Jun

    Hi
    You need to use data links. Refer data link section in BUilding Reports manual at http://otn.oracle.com/products/reports/htdocs/getstart/docs/B10310_01/orbr_concepts1.htm#1013156.
    Thanks
    Rohit

  • Can do explict join for database view?

    Hi all,
    I would like to ask whether there is a way to specify the join condition to be outer join for database view. It is because I need to map 2 tables in the view and I want to be able to find the record in the view table if the record exists in Table A but not Table B.

    Hi Jaya,
    A Maintenance View helps you to maintain data that is distributed across different or multiple database tables. So, it becomes an easy way to update data and without any programing effort. You can create a Maintenance View across multiple tables with one Table as Primary Table and others as Secondary Tables. But the tables must be related with each other with a Foreign Key Relationship.
    Have a look at the following link which tell you about the procedure of creating the Maintenance Views :
    http://help.sap.com/saphelp_nw04s/helpdata/en/cf/21ed2d446011d189700000e8322d00/frameset.htm
    Hope this helps.
    Thanks,
    Samantak.

  • Outer join query for SQL server from Oracle

    Hi All,
    My question is regarding making queries from Oracle to SQL Server database thorugh DBLink.
    In my oracle database I have a DBLink emp.world for SQL Server database.
    I need to query SQL Server data from oracle (so that this query can be combined with other oracle tables).
    Query is given below:
    SELECT
            a."EmpID" as "Employee ID",
            a."EmpStatus" "Employee Status"
            b."EmpSub" as "Employee Subjects"
    FROM
            [email protected] a
            left outer join [email protected] b on a."EmpID" = b."suEmpID"
    ORDER BY  a."EmpID";My problem is when I run the same query from oracle, it does not show the EmpID that does not exist in Subjects table, but when run from actual SQL Server database, it shows all the records.
    Samples are given below:
    Run from Oracle
    Employee ID      Employee Status     Employee Subjects
    101                     Active                     Maths
    102                     Active                     Maths
    102                     Active                     Physics
    104                   Inactive                  Chemistry
    Run form SQL Server
    Employee ID      Employee Status     Employee Subjects
    101                     Active                     Maths
    102                     Active                     Maths
    102                     Active                     Physics
    103                 Active                       NULL
    104             Inactive            ChemistryI am not sure why in oracle outer join for SQL server tables is not working. What is the right way for outer join in this case.
    I am using oracle database 10gR2 and SQL Server 2005.
    Please Help.
    Thanks.

    SELECT
    a."EmpID" as "Employee ID",
    a."EmpStatus" "Employee Status"
    b."EmpSub" as "Employee Subjects"
    FROM
    [email protected] a
    left outer join [email protected] b on a."EmpID" = b."suEmpID"
    ORDER BY a."EmpID";
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/queries006.htm#sthref3175
    From your description, it appears you may need a right outer join. You want to get back all the rows from 'B', not from 'A'. Try a right join and let us know.

  • Set operator NE in Database View creation in  join condition

    Hi Experts,
         I have a requirement to set NE(not equal) operator in join condition of Database View creation. Could you please help me how to set in operator.
    Join condition :
    Ex : BSAK-AUGBL NE BSAK-BELNR.
    You know that by default operator is '='. i want to set NE in place of '='.
    Thanks,

    Hi Chinna,
    Check whether if there is any possibility or not to include more key fields like bukrs, lifnr, gjahr etc in the where condition, so that you query may result faster. Then, there won't be any necessary to create the view.
    Hope this helps.
    Please reward if useful.
    Thanks,
    Srinivasa

  • Peoplesoft Query Outer join with MAX EFFDT

    I have this criteria in my PS Query
    where A.emplid = B.emplid
    and B.effdt = (select max( B1.effdt ) from PS_TABLE_B B1 where B1.effdt <= SYSDATE )
    Need to do an OUTER JOIN for B.
    Ie. If no row found in B, then return blank so that row in A can be returned by query.
    It's OK for A.emplid = B.emplid(+)
    But how to approach for and B.effdt = (select max ... ?
    Please advise

    If I remember it right, if you write outer joins using ( + ), there shouldn't be any other non-outer join criteria in your SQL, otherwise it will negate its being an 'outer join'.
    so for your (1) this highlighted SQL block negates your 'outer join' condition
    AND A.EMPLID =  C.EMPLID(+)
    AND ( C.EFFDT = (SELECT MAX( D.EFFDT)
                             FROM PS_D D
                            WHERE D.EMPLID = C.EMPLID
                              AND D.ACTION_REASON = 'MAT'
                              AND ( D.RETURN_DT IS NULL OR D.RETURN_DT > SYSDATE))
                OR C.EFFDT IS NULL) )
    you should see more from here http://docs.oracle.com/cd/B28359_01/server.111/b28286/queries006.htm#SQLRF52336
    From that article, it says.. "If A and B are joined by multiple join conditions, then you must use the operator in all of these conditions. If you do not, then Oracle Database will return only the rows resulting from a simple join, but without a warning or error to advise you that you do not have the results of an outer join."
    What I suggest, create a SQL view to replace C that retrieves exactly what C has to retrieve.. probably something like this
    SELECT D.*
    FROM PS_D D
    WHERE D.ACTION_REASON = 'MAT'
      AND( D.RETURN_DT IS NULL OR D.RETURN_DT > SYSDATE )
      AND D.EFFDT = (SELECT MAX(EFFDT) ... )
    and reference that new SQL view for C.. so that in your query, it should only look something like
    AND A.EMPLID = C.EMPLID(+)
      AND( C.EFFDT =
      (SELECT MAX( D.EFFDT )
         FROM PS_D D
        WHERE D.EMPLID = C.EMPLID
        AND D.ACTION_REASON = 'MAT'
        AND( D.RETURN_DT IS NULL
        OR D.RETURN_DT > SYSDATE )
      OR C.EFFDT IS NULL ) )
    Hope this helps

  • Dynamic From statement in select query and/or outer join not working

    Dear Experts, I have a select query where the select columns are dynamic, the where condition is also dynamic. It is of the below format:
    Select (dynamic columns) INTO <wa>
    FROM a inner join b on af1 = bf1
    inner join c on af2 = cf2......
    WHERE (dynamic conditios)
    ORDER BY ( dynamic sort condition).
    Now I have to include some tables (dynamically depending on the user input) in the inner join statement which will give description for the selected fields. And these database tables may or may no be empty. So in this case, my select query will not return any data if these tables are empty. And I dont want that.
    I tried using outer join for the extra tables but it gave me a runtime error. I also tried forming the inner join statement dynamically but it was not supporting.
    Kindly give me pointers.
    Thanks

    Hey thanks for the reply, but the problem is not solved.
    I am already using  ( fileds, value) like table in my where condition and the select statement was working properly.
    the problem is that now I have to include some tables in the join statement which can be empty and so i want to use Outer join.
    But I am getting a runtime error as below:
    Error analysis
        An exception occurred that is explained in detail below.
        The exception, which is assigned to class 'CX_SY_DYNAMIC_OSQL_SYNTAX', was not
         caught in
        procedure "ZATSCSNG_RFC_READ_TABLE" "(FUNCTION)", nor was it propagated by a
         RAISING clause.
        Since the caller of the procedure could not have anticipated that the
        exception would occur, the current program is terminated.
        The reason for the exception is:
        The running ABAP program wanted to execute a SELECT statement whose
        WHERE condition was (partly) specified dynamically. The part that is
        specified in an internal table at runtime is compared to a field of the
        right table of an LEFT OUTER JOIN. Such comparisons are not supported by
         all database systems and are therefore not allowed.

Maybe you are looking for

  • Weblogic proxy plugin closes keep-alive connections to clients randomly

    In short we have following arhitecture: clients ---> wl proxy plugin 1 ----> weblogic 1 clients ---> wl proxy plugin 2 ----> weblogic 2 Beacuse of the application/installation specific requirements, we are not using failover, one wl proxy always forw

  • JBO-35007 in Portletized ADF Faces Page and alternative scenarios

    Hi all, I've started a new thread to address one of the problems referred to here Issues with Faces -> Portlet Bridge and ADF Faces In short, the issue arises when portletizing an existing ADF Faces page that uses an ADF BC bound af:Table on the page

  • Get Column sum, count in sql developer

    Dear All seniors, I need help in oracle sql developer that after select statement when we got our result in below rows and coloums, then how to get its sum, count, etc. as in pl sql developer we simply right click at a column and then click on the de

  • Need to add new fields in transaction UDM_DISPUTE.

    Hi Friends, This is regarding UDM_DISPUTE transaction in FSCM. I need to add new fields (drop down lists) in transaction UDM_DISPUTE. Program Name: SAPLSRMCLFRM2 Screen Number: 100 Can any one please suggest me with the name of exit using which I can

  • Best workflow for creating logsheets before ingesting.

    I'm looking for the best workflow for creating detailed log sheets of my avchd footage before ingesting/transferring it to FCP. I have many hours of footage shot with my Sony NX5U and only want to ingest the necessary clips. I'm using FCP 6.5 on a Ma