Insert/delete many to many join in 9.0.3

Can anyone tell me a good way to create/delete an intersection row in a many to many relationship? I can do it programmatically in the client, but I'd rather have the middle tier view object or application module handle the code. Currently I'm creating a JClient application but later I will be putting the application in a browser. I don't want to rewrite the code every time I change my client application.
Thanks

I forgot to mention that I'm using the BC4J framework.
Mike

Similar Messages

  • Insert/delete single cells

    This is a wicked dumb question ... I have a fairly large table of data, and I want to line up the entries in one column with the entries in another. What I need to do is easily insert and delete individual cells? I can insert and delete rows ... I need to insert/delete individual cells.

    Many thanks for the helpful tips. I too had the exact question. The "mark for move" technique works just as expected. Yet, I still cannot delete a single empty cell and have the column move upward one cell. After completing shift-command-x and shift-command-v on a single empty cells leaves an empty cell in the source destination. I wanted to delete it. My spreadsheet was small enough to shift blocks of cells upwards using "mark for move" until all the empty cells were at the bottom, whereby I then evoked the delete rows method. It worked but a bit kludgy. Better than before though as I hadn't used the "mark for move",
    I'm using Numbers 09 on a Jan 2010 MBP running Mac OS X 10.6.7
    regards,
    Michael

  • Many to many join

    Hello,
    Please help me create the many-to-many relationship between these tables that I willl need to do a Master Detail form. The master is tblStandardSheets (PK: ID) the detail is tblSubject (PK: SUBJECTID) and the link is tblLink (PK: RECID, FK: ID, SUBJECTID).
    CREATE TABLE "tblStandardSheets"
    (     "ID" NUMBER NOT NULL ENABLE,
         "SHEET" VARCHAR2(100),
         "TITLE" VARCHAR2(255),
         CONSTRAINT "tblStandardSheets_PK" PRIMARY KEY ("ID") ENABLE
    CREATE OR REPLACE TRIGGER "BI_tblStandardSheets"
    before insert on "tblStandardSheets"
    for each row
    begin
    if :NEW."ID" is null then
    select "TBLSTANDARDSHEETS_SEQ".nextval into :NEW."ID" from dual;
    end if;
    end;
    ALTER TRIGGER "BI_tblStandardSheets" ENABLE
    CREATE TABLE "tblLink"
    (     "ID" NUMBER NOT NULL ENABLE,
         "RECID" NUMBER NOT NULL ENABLE,
         "SUBJECTID" NUMBER NOT NULL ENABLE,
         CONSTRAINT "tblLink_PK" PRIMARY KEY ("RECID") ENABLE
    ALTER TABLE "tblLink" ADD CONSTRAINT "TBLLINK_FK" FOREIGN KEY ("ID")
         REFERENCES "tblStandardSheets" ("ID") ON DELETE CASCADE ENABLE
    ALTER TABLE "tblLink" ADD CONSTRAINT "TBLLINK_FK2" FOREIGN KEY ("SUBJECTID")
         REFERENCES "tblSubject" ("SUBJECTID") ON DELETE CASCADE ENABLE
    CREATE OR REPLACE TRIGGER "BI_tblLink"
    before insert on "tblLink"
    for each row
    begin
    if :NEW."RECID" is null then
    select "TBLLINK_SEQ".nextval into :NEW."RECID" from dual;
    end if;
    end;
    ALTER TRIGGER "BI_tblLink" ENABLE
    CREATE TABLE "tblSubject"
    (     "SUBJECTID" NUMBER NOT NULL ENABLE,
         "SUBJECT" VARCHAR2(255),
         CONSTRAINT "tblSubject_PK" PRIMARY KEY ("SUBJECTID") ENABLE
    CREATE OR REPLACE TRIGGER "BI_tblSubject"
    before insert on "tblSubject"
    for each row
    begin
    if :NEW."SUBJECTID" is null then
    select "TBLSUBJECT_SEQ".nextval into :NEW."SUBJECTID" from dual;
    end if;
    end;
    ALTER TRIGGER "BI_tblSubject" ENABLE
    ALTER TABLE "tblSubject" ADD CONSTRAINT "tblSubject_FK" FOREIGN KEY ("SUBJECTID")
         REFERENCES "tblLink" ("SUBJECTID") ON DELETE CASCADE ENABLE
    ORA-02270: no matching unique or primary key for this column-list
    Edited by: user6753348 on Mar 31, 2009 1:39 PM

    Like this:
      CREATE TABLE "tblStandardSheets"
       (     "ID" NUMBER NOT NULL ENABLE,
         "SHEET" VARCHAR2(100 BYTE),
         "TITLE" VARCHAR2(255 BYTE),
          CONSTRAINT "tblStandardSheets_PK" PRIMARY KEY ("ID")
    CREATE OR REPLACE TRIGGER "BI_tblStandardSheets"
    before insert on "tblStandardSheets"
    for each row
    begin
    if :NEW."ID" is null then
    select "TBLSTANDARDSHEETS_SEQ".nextval into :NEW."ID" from dual;
    end if;
    end;
    ALTER TRIGGER "BI_tblStandardSheets" ENABLE
      CREATE TABLE "tblSubject"
       (     "SUBJECTID" NUMBER NOT NULL ENABLE,
         "SUBJECT" VARCHAR2(255 BYTE),
          CONSTRAINT "tblSubject_PK" PRIMARY KEY ("SUBJECTID")
    CREATE OR REPLACE TRIGGER "BI_tblSubject"
    before insert on "tblSubject"
    for each row
    begin
    if :NEW."SUBJECTID" is null then
    select "TBLSUBJECT_SEQ".nextval into :NEW."SUBJECTID" from dual;
    end if;
    end;
    ALTER TRIGGER "BI_tblSubject" ENABLE
      CREATE TABLE "HR"."tblLink"
       (     "ID" NUMBER NOT NULL ENABLE,
         "RECID" NUMBER NOT NULL ENABLE,
         "SUBJECTID" NUMBER NOT NULL ENABLE,
          CONSTRAINT "tblLink_PK" PRIMARY KEY ("RECID")
          CONSTRAINT "TBLLINK_FK" FOREIGN KEY ("ID")
           REFERENCES "tblStandardSheets" ("ID") ON DELETE CASCADE ENABLE,
          CONSTRAINT "TBLLINK_FK2" FOREIGN KEY ("SUBJECTID")
           REFERENCES "tblSubject" ("SUBJECTID") ON DELETE CASCADE ENABLE
    CREATE OR REPLACE TRIGGER "BI_tblLink"
    before insert on "tblLink"
    for each row
    begin
    if :NEW."RECID" is null then
    select "TBLLINK_SEQ".nextval into :NEW."RECID" from dual;
    end if;
    end;
    ALTER TRIGGER "BI_tblLink" ENABLE
    /You have to create the sequences yourself...
    HTH
    Roel

  • Many-to-many association: inserting in the detail table fails

    I'm using jdeveloper 11g and configured the many-to-many association as described in the documentation, so I have accessors in both directions, with composition association and a many-to-many link view. Using the business component browser, the link view works for viewing the data in both directions, as one would expect, however inserting in the detail table fails as follows: the key of the master table is the new value of the detail table's key column instead of the intersection table's foreign key column. Is this a known problem, or is there something I have done wrong?

    If your m-m join table has additional fields there best solution is normally to define a class for the join table.
    i.e.
    beforeProgram
    -m-m-> Assumption
    Assumption
    -m-m-> Program (optional/read-only)
    -> after
    Program
    -1-m-> ProgramAssumptionAssociation (private-owned)
    ProgramAssumptionAssociation
    -1-1-> Program (pk)
    -1-1-> Assumption (pk)
    - createByUser
    - etc.
    Program
    -1-m-> ProgramAssumptionAssociation (independent/optional)
    You could also enable batch-reading or joining on the 1-1 relationship to read the target objects efficiently.

  • ADF BC: Many-to-Many Insert

    Hi :)
    I have a many-to-many relationship ( person has many cars and cars can have many persons)
    Now i wanted to insert a new car for a given person.
    So i dragged my personview->carView form and readonly table.
    It inserts the new car. But the middle table is not changed.
    Why?

    At row creation time, a view link handles the job of filling in the current value of the respsective foreign key attributes from the current row of the master view. If you have multiple master view objects using multiple view links, then each of them will populate their respective foreign key values. If this is not what you want, then the alternative I suggested that does not use mutlple-master view objects instances would be the way to go.
    I think the simplest thing for you to do is the following:
    (1) Person entity associated to PersonCar entity (1-*)
    (2) Car entity associated to PersonCar entity (1-*)
    (3) Create a PersonView based on Person entity
    (4) Create a PersonCarView based on PersonCar intersection entity, using a secondary Car entity as a reference to display the name of the car
    (5) Create a CarLookupView based on the Car entity (this will be used to present a list of valid cars to pick when adding a new car for a person
    If your PersonEditPage needs to display the current list of cars assigned to that person, then it would show the details from the CarView.
    To add a new car for a person, you create a new row in the CarView that is the detail of the current row in the PersonView.
    The "add a new car for a person" page, would have a dropdown list based on the results of the "CarLookupView" as its valid choices (and it's personId would be filled in automatically from the view link.
    I think this would be the simplest way to address your use case. In practice, rather than using a many-to-many view link, its using just a single view link from PersonView to PersonCarView, and the PersonCarView references the related information about the car using a reference entity usage (which translates to a join in the automatically created SQL for your view object with reference information).

  • [ADF] Adding/deleting entries in a many-to-many relationship

    I am using JDeveloper 10.1.3 and the ADF BC / ADF Model / ADF Faces / JSF technology stack.
    For this question, I am using the SRDemo application as an example, specifically the many-to-many relationship between USERS and PRODUCTS (the Staff Expertise relationship), outlined in red in this schema diagram: Image Link
    Users may have any number of product expertise areas and many users may have the same product expertise area. For the purposes of this example I have added two reference fields from the PRODUCT table into the ExpertiseAreas VO (Name and Description), outlined in red in this data control palette section: Image Link
    I have created a page which shows the details of a user (1), along with a table showing the expertise areas the user has (3), and a table of all the products available (2), numbered on this design page: Image Link and corresponding to the numbered data controls on this data control palette section: Image Link, where 1 is rendered as an ADF Read-only Form, 2 is an ADF Read-only Table with a tableSelectMany element in the selection facet, and 3 is also an ADF Read-only Table.
    What I am trying to do is have the tableSelectMany element reflect which of the products are linked to the current user in the expertise areas relationship (by having the checkbox for currently linked products checked), and when you check or uncheck a product's checkbox, it should add or remove the row in the EXPERTISE_AREAS intersection table, respectively (asume for this example that there are default values for Expertise Level and Notes).
    So far I have been following the process used in section 19.8 of the ADF Developer's Guide for Forms/4GL Developers, which describes how to set up a selectManyShuttle which implements the adding and deleting functionality. So I have a Client Interface method in the Application Module, updateSkillsForCurrentStaff (described in section 10.6.7.2), and I have a selection listener for the assignment table in the backing bean for the page, which calls the updateSkillsForCurrentStaff method:
    public void selectionChanged(SelectionEvent event)
      BindingContainer bc = getBindings();
      DCIteratorBinding productsIB = (DCIteratorBinding)bc.get("ProductListIterator");
      Set keys = getTable1().getSelectionState().getKeySet();
      Iterator iter = keys.iterator();
      List productIds = new Vector();
      while (iter.hasNext())
        String product = ((Key)iter.next()).toStringFormat(true);
        productsIB.setCurrentRowWithKey(product);
        ViewRowImpl productRow = (ViewRowImpl)productsIB.getCurrentRow();
        Number productId = (Number)productRow.getAttribute("Id");
        productIds.add(productId);
      OperationBinding ob = bc.getOperationBinding("updateSkillsForCurrentStaff");
      Map pm = ob.getParamsMap();
      pm.put("productIds", productIds);
      ob.execute();
    All of this works, but I can't work out how to link the selection state of the assignment table to the expertise areas that are linked to the user. Also I think the method listing above must be a bit of a hack, but I don't know enough about this to know if there's an easier way of doing it.
    Any help is appreciated.

    Have a look at this example I cooked up for you.
    http://radio.weblogs.com/0118231/2006/10/03.html#a739
    It might not be the first way one thinks to implement something, but it illustrates a very interesting, model-centric approach to the problem you propose.
    My feelings won't be hurt if you prefer a more view-centric approach, but I wanted to illustrate what was a maximally-model-centric solution (in fact, which doesn't even require a backing bean!) If you like a more view-centric approach, I can help you figure out what's wrong with your key-handling above. For one, I would probably start by passing the Set of Key's directly to the middle tier application module method to eliminate client-side code.
    Check it out and let me know what you think. Try it directly in the Business Components Tester to appreciate one of the benefits a model-centric solution can bring.

  • Cascade delete in many to many association

    Hi All,
        I have a usecase, there is an association with many to many cardinality  between 3 EO's. If i delete  any record in master, the corresponding childs all should delete.
        So appreciate if any alternatives on above usecase. Thanks in advance

    Hi,
    cascade delete is a function of the database. When you enable cascade delete for an entity operation then this only produces the proper SQL code for deleting a data object. If you have a many-to-many relation then this means you have multiple master and child records, which I think makes your "If i delete  any record in master, the corresponding childs all should delete" impossible.
    for what its worth, please read
    Creating a Business Domain Layer Using Entity Objects - 11g Release 2 (11.1.2.3.0)
    to learn how to parse and delete detail records  from an entity object
    http://docs.oracle.com/cd/E35521_01/web.111230/e16182/bcentities.htm#CEGJAFCF
    The last document is about posting orders (e.g. create a master record before you create detail records). However, with a few changes you can reverse this to perform a delete operation (just add this code to the entity impl classes of the entities so they delete their child objects
    Frank

  • Inserting with many to many relationship

    db and dev 10g rel2 ,
    hi all ,
    an application for a laboratory ,( patients and tests)
    i think the relation here is (many to many) , because each patient can have multiple tests, and each test can
    have multiple patients .
    what tables should i create ?
    and finally i should have a block to insert data for patients , and it should have
    the name of the patient and the test he is doing .
    so what tables should i create , and the block for the data entry will be based on which table ? or tables ?
    thanks a lot

    Hi
    First i do strongly recommend collecting reports & forms papers which r filled out by Mrs employees & patients then u stay to decide by ur pen & formalize what r the data required & what type of relationship need to be contracted from scratch off course many modifications Will occure by it Will be easier to modify on papers.
    Then my guess is u.Will need tables for employees , Patients ,Labs & Analysis Types
    Employees & Patients fields in a table r common in ;name, id,address,birthday or age ,
    etc.
    Labs table is needed if only u have many labs types ...
    Analysis Types table is listing...
    Analysis_id , Analysis_name& comments if any...
    Actual_Analysis table which Will have many pk is from all previous tables e.g.
    employees_id,Analysis_id, Patient_id,Lab no
    ,Analysis_date,Delivery_date,
    Analysis time , Delivery or due time.
    Status +-- A flag Which indicates ethe delivery status done or not
    Deposit
    way payment -- can have a table for it.
    total cost
    taxes
    etc.
    --========
    All payments affairs could have a table or more for it
    hope it.helps as a start.
    Amatu Allah

  • Delete entity that participate in many to many association

    Hi all,
    I have two tables related by a many to many relationship (for ex department and employee).
    So I have three tables:
    Department: table of departments
    Employee: table employees
    deptEmp: the association table relating the employees to the departments.
    When a department is deleted, all the corresponding rows in deptEmp table should also be deleted (and same for employee).
    On the entity level, I have created the many to many association (between department and employee) and a one to many association for each of department and employee entities to deptEmp entity (deptEmptAssoc from department to deptEmp and empDeptAssoc employee  to deptEmp).
    I configured the deptEmptAssoc association to be a composition and implement the cascading delete, and it is working fine. When I delete a department, the corresponding rows in deptEmp are deleted.
    The problem is that when I try to do the same for empDeptAssoc, JDev gives me a warning and doesn’t apply the composition neither the cascading delete.
    I tried to override the remove method of employee entity to also remove the corresponding deptEmp but it also didn’t work.
    So any hint or pointer how to achieve this? How to have a many to many association and be able to delete both sides of the association?
    Thank you.

    Hi,
    This behavior can be done by overriding the postChanges method as follow:
      public void postChanges(TransactionEvent transactionEvent) {
            if(getPostState() == STATUS_DELETED){
                RowIterator mmIterator = getMM();
                while (mmIterator.hasNext()){
                    EntityImpl row = (EntityImpl)mmIterator.next();
                    row.remove();
    row.postChanges(transactionEvent);
            super.postChanges(transactionEvent);
    N.B.1  In the xml file of the viewLink, the composition association (and implement cascade delete) should not be checked.
    N.B.2  with these flags unchecked, ADF will not control the posting of entities in case the department and the deptEmp entities were both newly created. To fix the issue, the deptEmp entity should also override the postChanges method as follow:
                        public void postChanges(TransactionEvent transactionEvent) {
            if (getPostState() == STATUS_NEW ||
                  getPostState() == STATUS_MODIFIED) {
                EntityImpl dept = getDept();
                if (dept != null) {
                  if (dept.getPostState() == STATUS_NEW) {
    dept.postChanges(transactionEvent);
                                                    // do the same for the Employee entity if needed
            super.postChanges(transactionEvent);
    Regards.

  • JOIN for many-to-many linked tables?

    I have two tables, A and C, linked by a many-to-many intersection table B.
    I'd like to do a select from A with a LEFT OUTER JOIN to C for items mapped via B. A row in A may or may not have rows in C linked to it.
    I've tried to do a select using sub-selects but then I don't get the rows from A that don't have related rows in C.
    When I try to use the syntax of a LEFT OUTER JOIN I can't figure out how to link A and C via the B table.
    I would appreciate suggestions for how to approach this.
    Thanks in advance,
    George

    EXAMPLE
    SQL> L
      1  with A as (
      2  select 1 col1, 1 col2 from dual union all
      3  select 2     , 1     from dual union all
      4  select 3     , 2     from dual)
      5  ,
      6  B as (
      7  select 1 col2, 1 col3 from dual union all
      8  select 2     , 3     from dual)
      9  ,
    10  C as  (
    11  select 1 col3 from dual union all
    12  select 2      from dual union all
    13  select 3      from dual
    14  )
    15  select *
    16  from      A
    17  LEFT JOIN B ON (A.COL2=B.COL2)
    18* LEFT JOIN C ON (B.COL3=C.COL3)
    SQL> /
          COL1       COL2       COL2       COL3       COL3
             1          1          1          1          1
             2          1          1          1          1
             3          2          2          3          3

  • Limiting a many to many join

    Hello,
    I__m wondering if there is a way to limit a many to many join by a specific
    value in a column in the join table. I have a join table that has the two
    foreign key fields which are the ids to the tables and another column that
    I want to limit on. So the SQL would be something like below but I want
    to do it through ejb3. Any idea how this can be accomplished?
    Select phone.number, __ from company, company_phone, phone where
    company_phone.primay = __Y__ and company.id = company_phone.company_id and
    phone.id = company_phone.phone_id and company.id = __1234__;
    If so does it work for the other relationships (one to many and many to
    one)?
    Thanks,
    Craig

    Kodo does have support for limiting a join based on a constant value; we
    call them "constant joins". See the following documentation, and let us
    know if you have any questions:
    http://solarmetric.com/Software/Documentation/4.0.0EA/docs/full/html/ref_guide_mapping_notes_nonstdjoins.html

  • How many  types of joins are there?

    how many  types of joins are there?
    Edited by: Alvaro Tejada Galindo on Feb 21, 2008 4:58 PM

    Hi,
    Joins are used to fetch data fast from Database tables:
    Tables are joined with the proper key fields to fetch the data properly.
    If there are no proper key fields between tables don't use Joins;
    Important thing is that don't USE JOINS FOR CLUSTER tableslike BSEG and KONV.
    Only use for Transparenmt tables.
    You can also use joins for the database VIews to fetch the data.
    JOINS
    ... FROM tabref1 INNER JOIN tabref2 ON cond
    The data is to be selected from transparent database tables and/or views determined by tabref1 and tabref2. tabref1 and tabref2 each have the same form as in variant 1 or are themselves Join expressions. The keyword INNER does not have to be specified. The database tables or views determined by tabref1 and tabref2 must be recognized by the ABAP Dictionary.
    In a relational data structure, it is quite normal for data that belongs together to be split up across several tables to help the process of standardization (see relational databases). To regroup this information into a database query, you can link tables using the join command. This formulates conditions for the columns in the tables involved. The inner join contains all combinations of lines from the database table determined by tabref1 with lines from the table determined by tabref2, whose values together meet the logical condition (join condition) specified using ON>cond.
    Inner join between table 1 and table 2, where column D in both tables in the join condition is set the same:
    Table 1 Table 2
    A  B  C  D    D  E  F  G  H 
    a1  b1  c1  1    1  e1  f1  g1  h1 
    a2  b2  c2  1    3  e2  f2  g2  h2 
    a3  b3  c3  2    4  e3  f3  g3  h3 
    a4  b4  c4  3    -
    Inner Join
    A  B  C  D  D  E  F  G  H 
    a1  b1  c1  1  1  e1  f1  g1  h1 
    a2  b2  c2  1  1  e1  f1  g1  h1 
    a4  b4  c4  3  3  e2  f2  g2  h2 
    Example
    Output a list of all flights from Frankfurt to New York between September 10th and 20th, 2001 that are not sold out:
    DATA: DATE LIKE SFLIGHT-FLDATE,
    CARRID LIKE SFLIGHT-CARRID,
    CONNID LIKE SFLIGHT-CONNID.
    SELECT FCARRID FCONNID F~FLDATE
    INTO (CARRID, CONNID, DATE)
    FROM SFLIGHT AS F INNER JOIN SPFLI AS P
    ON FCARRID = PCARRID AND
    FCONNID = PCONNID
    WHERE P~CITYFROM = 'FRANKFURT'
    AND P~CITYTO = 'NEW YORK'
    AND F~FLDATE BETWEEN '20010910' AND '20010920'
    AND FSEATSOCC < FSEATSMAX.
    WRITE: / DATE, CARRID, CONNID.
    ENDSELECT.
    If there are columns with the same name in both tables, you must distinguish between them by prefixing the field descriptor with the table name or a table alias.
    In order to determine the result of a SELECT command where the FROM clause contains a join, the database system first creates a temporary table containing the lines that meet the ON condition. The WHERE condition is then applied to the temporary table. It does not matter in an inner join whether the condition is in the ON or WHEREclause. The following example returns the same solution as the previous one.
    Example
    Output of a list of all flights from Frankfurt to New York between September 10th and 20th, 2001 that are not sold out:
    DATA: DATE LIKE SFLIGHT-FLDATE,
    CARRID LIKE SFLIGHT-CARRID,
    CONNID LIKE SFLIGHT-CONNID.
    SELECT FCARRID FCONNID F~FLDATE
    INTO (CARRID, CONNID, DATE)
    FROM SFLIGHT AS F INNER JOIN SPFLI AS P
    ON FCARRID = PCARRID
    WHERE FCONNID = PCONNID
    AND P~CITYFROM = 'FRANKFURT'
    AND P~CITYTO = 'NEW YORK'
    AND F~FLDATE BETWEEN '20010910' AND '20010920'
    AND FSEATSOCC < FSEATSMAX.
    WRITE: / DATE, CARRID, CONNID.
    ENDSELECT.
    Since not all of the database systems supported by SAP use the standard syntax for ON conditions, the syntax has been restricted. It only allows those joins that produce the same results on all of the supported database systems:
    Only a table or view may appear to the right of the JOIN operator, not another join expression.
    Only AND is possible in the ON condition as a logical operator.
    Each comparison in the ON condition must contain a field from the right-hand table.
    If an outer join occurs in the FROM clause, all the ON conditions must contain at least one "real" JOIN condition (a condition that contains a field from tabref1 amd a field from tabref2.
    In some cases, '*' may be specified in the SELECT clause, and an internal table or work area is entered into the INTO clause (instead of a list of fields). If so, the fields are written to the target area from left to right in the order in which the tables appear in the FROM clause, according to the structure of each table work area. There can then be gaps between table work areas if you use an Alignment Request. For this reason, you should define the target work area with reference to the types of the database tables, not simply by counting the total number of fields. For an example, see below:
    Variant 3
    ... FROM tabref1 LEFT OUTER JOIN tabref2 ON cond
    Effect
    Selects the data from the transparent database tables and/or views specified in tabref1 and tabref2. tabref1 und tabref2 both have either the same form as in variant 1 or are themselves join expressions. The keyword OUTER can be omitted. The database tables or views specified in tabref1 and tabref2 must be recognized by the ABAP-Dictionary.
    In order to determine the result of a SELECT command where the FROM clause contains a left outer join, the database system creates a temporary table containing the lines that meet the ON condition. The remaining fields from the left-hand table (tabref1) are then added to this table, and their corresponding fields from the right-hand table are filled with ZERO values. The system then applies the WHERE condition to the table.
    Left outer join between table 1 and table 2 where column D in both tables set the join condition:
    Table 1 Table 2
    A  B  C  D    D  E  F  G  H 
    a1  b1  c1  1    1  e1  f1  g1  h1 
    a2  b2  c2  1    3  e2  f2  g2  h2 
    a3  b3  c3  2    4  e3  f3  g3  h3 
    a4  b4  c4  3    -
    Left Outer Join
    A  B  C  D  D  E  F  G  H 
    a1  b1  c1  1  1  e1  f1  g1  h1 
    a2  b2  c2  1  1  e1  f1  g1  h1 
    a3  b3  c3  2  NULL NULL NULL NULL NULL
    a4  b4  c4  3  3  e2  f2  g2  h2 
    Example
    Output a list of all custimers with their bookings for October 15th, 2001:
    DATA: CUSTOMER TYPE SCUSTOM,
    BOOKING TYPE SBOOK.
    SELECT SCUSTOMNAME SCUSTOMPOSTCODE SCUSTOM~CITY
    SBOOKFLDATE SBOOKCARRID SBOOKCONNID SBOOKBOOKID
    INTO (CUSTOMER-NAME, CUSTOMER-POSTCODE, CUSTOMER-CITY,
    BOOKING-FLDATE, BOOKING-CARRID, BOOKING-CONNID,
    BOOKING-BOOKID)
    FROM SCUSTOM LEFT OUTER JOIN SBOOK
    ON SCUSTOMID = SBOOKCUSTOMID AND
    SBOOK~FLDATE = '20011015'
    ORDER BY SCUSTOMNAME SBOOKFLDATE.
    WRITE: / CUSTOMER-NAME, CUSTOMER-POSTCODE, CUSTOMER-CITY,
    BOOKING-FLDATE, BOOKING-CARRID, BOOKING-CONNID,
    BOOKING-BOOKID.
    ENDSELECT.
    If there are columns with the same name in both tables, you must distinguish between them by prefixing the field descriptor with the table name or using an alias.
    Note
    For the resulting set of a SELECT command with a left outer join in the FROM clause, it is generally of crucial importance whether a logical condition is in the ON or WHERE condition. Since not all of the database systems supported by SAP themselves support the standard syntax and semantics of the left outer join, the syntax has been restricted to those cases that return the same solution in all database systems:
    Only a table or view may come after the JOIN operator, not another join statement.
    The only logical operator allowed in the ON condition is AND.
    Each comparison in the ON condition must contain a field from the right-hand table.
    Comparisons in the WHERE condition must not contain a field from the right-hand table.
    The ON condition must contain at least one "real" JOIN condition (a condition in which a field from tabref1 as well as from tabref2 occurs).
    Note
    In some cases, '*' may be specivied as the field list in the SELECT clause, and an internal table or work area is entered in the INTO clause (instead of a list of fields). If so, the fields are written to the target area from left to right in the order in which the tables appear in the llen in der FROM clause, according to the structure of each table work area. There can be gaps between the table work areas if you use an Alignment Request. For this reason, you should define the target work area with reference to the types of the database tables, as in the following example (not simply by counting the total number of fields).
    Example
    Example of a JOIN with more than two tables: Select all flights from Frankfurt to New York between September 10th and 20th, 2001 where there are available places, and display the name of the airline.
    DATA: BEGIN OF WA,
    FLIGHT TYPE SFLIGHT,
    PFLI TYPE SPFLI,
    CARR TYPE SCARR,
    END OF WA.
    SELECT * INTO WA
    FROM ( SFLIGHT AS F INNER JOIN SPFLI AS P
    ON FCARRID = PCARRID AND
    FCONNID = PCONNID )
    INNER JOIN SCARR AS C
    ON FCARRID = CCARRID
    WHERE P~CITYFROM = 'FRANKFURT'
    AND P~CITYTO = 'NEW YORK'
    AND F~FLDATE BETWEEN '20010910' AND '20010920'
    AND FSEATSOCC < FSEATSMAX.
    WRITE: / WA-CARR-CARRNAME, WA-FLIGHT-FLDATE, WA-FLIGHT-CARRID,
    WA-FLIGHT-CONNID.
    ENDSELECT.

  • Many to many join table with different column names

    Hi have a joint table with different column names as foreign keys in the joining
    tables...
    e.g. i have a many to many reltnshp btwn Table A and Table B ..and join table
    C
    both have a column called pk.
    and the join table C has columns call fk1 and fk2
    does cmd require the same column name in the join table as in the joining table?
    are there any workarounds?
    thanks

    HI,
    No, the foreign key column names in the join table do not have to match the primary
    key names in the joined tables.
    -thorick

  • Could someone please tell me how to delete all my many emails at once on my iPad 2? Thank you

    Could someone please tell me hoe to delete all my many emails on iPad 2 all at once? Thank you

    You can't delete them all at once on the iPad. You have to select them one at a time. Once the emails are in the trash, you can Delete All from there.

  • How to resolve many-to-many join by 2 one-to-many joins

    Hi,
       I was asked many times how to resolve many to many relationship between two tables. I read to use 2 one -to- many relationships to resolve this. Can some expalin me when many to many relationship occurs between two tables and how to reslove them with practicle examples. Is there any article on this?
    Regards,
    Nanda Kishore

    Hi,
    Please check below link.
    http://www.forumtopics.com/busobj/viewtopic.php?p=859029&sid=20d79e3df07b0d8b41aadfbd902bb6b2
    http://blog.oaktonsoftware.com/2011/04/bridge-tables-and-many-to-many.html
    Thanks,
    Amit

Maybe you are looking for

  • Error While calling stored procedure with array

    I am getting following error java.sql.SQLException: Fail to construct descriptor: Invalid arguments at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168) at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:210) at oracle.jdbc

  • Restrict Pricing updates in Sales Order

    Hi All, I have created a pricing conditon formula to get the price for the real time contract price from a third party Contract management system through a RFC call, and assigned the formula to a condition type. In this formula, if there was an error

  • XML based Adobe form is not allowing to input values while display on IE

    Hi Experts I have intergarted an XML based adobe form in webdynpro with inputs fields and submit button. But on display on Internet expolrer it doesn't allow to input values even button dosen't work. Please help me how would it will allow to input va

  • PS3 associate with UC520W Wifi

    Recently I come this weird error when PS3 connect to UC520W Wifi. PS3 version 2.53 UC520W IOS 12.4(22)T Does anyone know what causing this and how can I solve it ? 000193: Dec 22 23:14:23.151: %DOT11-7-AUTH_FAILED: Station 00XX.XXXX.XXXX Authenticati

  • Creating  a  data  base

    hi! how do I create a database in oracle