Retrieval of Data from More Than Two tables

Hi Experts,
How to get the data from more than two tables.
By using Jdbc, and through only core java.
I mean if i entered some empid at command prompt,
then the complete data (where empid is presented at some tables like L1,L2,L3,L4.) is to be displayed.
Bye
TulsiRam Mohan.
     Message #196971

Is creating view on these 4 tables is an option ?
Something like :
Select * from a
union all
select * from b
... and so on ?

Similar Messages

  • JDBC-XI-FILE scenario. How to extract data from more than one table in JDBC

    Hi,
    I was asked a question like in JDBC-XI-FILE scenario........ How to extract data from more than one tables (i.e from JDBC system) ?? What is the logic to do the same ??
    I am not sure whether this is a valid question..........but any help in this regards is highly appreciated.
    Regards
    Kumar

    HI,
    Yes it can be possible ,please see the following links
    JDBC  Receiver with Oracle Stored Procedures
    configuring jdbc adapter with multiple tables
    RFC -> XI -> JDBC Scenario Updating Multiple Tables
    /people/alessandro.berta/blog/2005/10/04/save-time-with-generalized-jdbc-datatypes
    JDBC Adapter multiple Selects
    https://www.sdn.sap.com/irj/sdn/advancedsearch?query=jdbc%20with%20multiple%20tables&cat=sdn_all
    Regards
    Chilla..

  • How can I download to one excel sheet from more than two table?

    Hi.
    as you know
    <SAP_BW_URL CMD='EXPORT' FORMAT='XLS' DATA_PROVIDER='DATAPROVIDER_T1' >
    this script can make download excel sheet which is same cotents of table or chart in web template.
    but if template has more than two tables how can we get excel sheet from tables?
    <SAP_BW_URL CMD='EXPORT' FORMAT='XLS' DATA_PROVIDER_1='DATAPROVIDER_T1' DATA_PROVIDER_2='DATAPROVIDER_T2'>
    I hope this gonna work but result was fail same as I expected.
    is there any way put two tables download one excel sheet?

    Welcome to SDN.
    Post this in Business Explorer forum for quicker resposne.
    SAP Business Explorer (SAP BEx)
    Regards
    Raja

  • Looking data from more than one table and inserting into another.

    Hello,
    I am giving you the Table structures as per my requirement..
    CREATE TABLE TEMP_A
    (NAME VARCHAR2(100) primary key);
    CREATE TABLE TEMP_B
    (STRUCTURE VARCHAR2(10));
    CREATE TABLE TEMP_C
    ( NAME VARCHAR2(100),
    STRUCTURE VARCHAR2(10),
    VALUE VARCHAR2(10));
    Alter table TEMP_C
    add constraint fk_name_tempc foreign key(name) references TEMP_A(name)
    INSERT INTO TEMP_A VALUES('SMITH');
    INSERT INTO TEMP_A VALUES('ALLEN');
    INSERT INTO TEMP_A VALUES('WARD');
    INSERT INTO TEMP_A VALUES('JONES');
    COMMIT;
    INSERT INTO TEMP_B VALUES('IN');
    INSERT INTO TEMP_B VALUES('IN_MIN');
    INSERT INTO TEMP_B VALUES('IN_TYP');
    INSERT INTO TEMP_B VALUES('IN_MAX');
    INSERT INTO TEMP_B VALUES('DIP');
    INSERT INTO TEMP_B VALUES('TIM');
    COMMIT;
    INSERT INTO TEMP_c VALUES('SMITH','C1','');
    INSERT INTO TEMP_c VALUES('SMITH','C2','');
    INSERT INTO TEMP_c VALUES('SMITH','D1','');
    INSERT INTO TEMP_c VALUES('ALLEN','D2','');
    INSERT INTO TEMP_c VALUES('ALLEN','R1','');
    INSERT INTO TEMP_c VALUES('WARD','R2','');
    COMMIT;
    i want to say is it should insert into table 'TEMP_C' values as :
    For 'SMITH' there should be (6 * 3) = 18 records.
    ( 6 distinct values of TEMP_B for SMITH to be inserted into TEMP_C against 'C1')
    ( 6 distinct values of TEMP_B for SMITH to be inserted into TEMP_C against 'C2')
    ( 6 distinct values of TEMP_B for SMITH to be inserted into TEMP_C against 'D1')
    For 'ALLEN' there should be (6 * 2) = 12 records.
    ( 6 distinct values of TEMP_B for ALLEN to be inserted into TEMP_C against 'D2')
    ( 6 distinct values of TEMP_B for ALLEN to be inserted into TEMP_C against 'R1')
    For 'WARD' there should be (6 * 1) = 6 records.
    ( 6 distinct values of TEMP_B for WARD to be inserted into TEMP_C against 'R2')
    Like this if there are records for JONES also , it should also do the same way( Depending on the No. of records present
    in the table 'TEMP_C' for 'JONES').
    Thanks in advance,
    Amkotz

    Is this what you are looking for?
    SQL> insert into temp_c (name, structure, value)
      2  select c.name, c.structure, b.structure
      3  from temp_a a, temp_c c, temp_b b
      4  where a.name = c.name
      5  ;
    36 rows created.
    SQL> select * from temp_c;
    NAME    STRUCTURE  VALUE
    SMITH   C1
    SMITH   C2
    SMITH   D1
    ALLEN   D2
    ALLEN   R1
    WARD    R2
    SMITH   C1         IN
    SMITH   C1         IN_MIN
    SMITH   C1         IN_TYP
    SMITH   C1         IN_MAX
    SMITH   C1         DIP
    SMITH   C1         TIM
    SMITH   C2         IN
    SMITH   C2         IN_MIN
    SMITH   C2         IN_TYP
    SMITH   C2         IN_MAX
    SMITH   C2         DIP
    SMITH   C2         TIM
    SMITH   D1         IN
    SMITH   D1         IN_MIN
    SMITH   D1         IN_TYP
    SMITH   D1         IN_MAX
    SMITH   D1         DIP
    SMITH   D1         TIM
    ALLEN   D2         IN
    ALLEN   D2         IN_MIN
    ALLEN   D2         IN_TYP
    ALLEN   D2         IN_MAX
    ALLEN   D2         DIP
    ALLEN   D2         TIM
    ALLEN   R1         IN
    ALLEN   R1         IN_MIN
    ALLEN   R1         IN_TYP
    ALLEN   R1         IN_MAX
    ALLEN   R1         DIP
    ALLEN   R1         TIM
    WARD    R2         IN
    WARD    R2         IN_MIN
    WARD    R2         IN_TYP
    WARD    R2         IN_MAX
    WARD    R2         DIP
    WARD    R2         TIM
    42 rows selected.
    SQL>

  • Retriving data from more than one table

    I have 6 tables with name A,B,C,D,E,F all of them have 1 column as common. I need help in developing a sql query which will give me name of table where record is present and number of its occurrences.

    926085 wrote:
    I have 6 tables with name A,B,C,D,E,F all of them have 1 column as common. I need help in developing a sql query which will give me name of table where record is present and number of its occurrences.You can check the table_name where column value is present by
    select table_name, AVG_COL_LEN from user_tab_columns where column_name='ID' and AVG_COL_LEN != 0;You'll get the results if you have all these table analyzed

  • How to specify more than Two Tables in NATURAL JOIN

    Hi,
    I am using Oracle9i R-2. I want help in writing a Query using Two Tables in SQL*PLUS. I am using ANSI/ISO Standrard for table-joins:
    select col1, col2, descr
    from tab1 natural join tab2
    There are two columns col1 & col2 is common between thse two tables. So, it will join them and query execute well.
    How can i use 3rd table tab3 in the same way in Natural Join...? If column col1 & col2 is available in tab3 also.
    I tried this way, but it gives me error:
    select col1, col2
    from tab1 natural join tab2 natural join tab3
    Is it possible to specify more than two tables in Natural Join Clause.
    Please check that out & help please. Thanks.
    Regards,
    Kamesh Rastogi

    I do not get an error when I try the same thing on the same version, as demonstrated below. Can you post your table structure and a copy and paste of a run of your actual query with the error that you are receiving?
    scott@ORA92> select banner from v$version
      2  /
    BANNER
    Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
    PL/SQL Release 9.2.0.1.0 - Production
    CORE     9.2.0.1.0     Production
    TNS for 32-bit Windows: Version 9.2.0.1.0 - Production
    NLSRTL Version 9.2.0.1.0 - Production
    scott@ORA92> select * from tab1
      2  /
          COL1       COL2 COL3
             1          1 A
            10         10 B
    scott@ORA92> select * from tab2
      2  /
          COL1       COL2 COL4
             1          1 C
            20         20 D
    scott@ORA92> select * from tab3
      2  /
          COL1       COL2 COL5
             1          1 E
            30         30 F
    scott@ORA92> select col1, col2, col3, col4, col5
      2  from tab1 natural join tab2 natural join tab3
      3  /
          COL1       COL2 COL3 COL4 COL5
             1          1 A    C    E
    scott@ORA92>

  • How to delete contents from more than 1 table

    How to delete the entire contents from more than 1 table in a single query.
    It is very urgent,
    Thanks in advance
    John

    Goto SE11 ->Open table ->Utility ->data base utility ->delete database table.
    BTW, Do not do it.
    Thanks,
    Ashish

  • More than two tables in crystal report.

    Was wondering if anyone new of a patch for reports with more than 2 tables. This does not seem to work when there are more than 2 tables in a report...it worked in 7.3.

    22222
    null

  • Not able to view data from more than one data package in PSA

    Hi Friends,
    Desparetly trying to view data in PSA. Problem :
    If i mark more than one datapackage this error raises:
    You must only select one data packet when entering data record numbers
    Message no. RSAODS127
    And there is no change to reset data record numbers.
    What is wrong ?
    Thanks in advance for help.
    Joe
    BW3.5, SP21
    Edited by: J.F.B. on Jul 2, 2009 11:40 AM

    Hi again,
    Seems I'm too stupid for this issue.......
    As I understand there are two ways to view PSA :
    1. PSA maintenance in RSA1
    2. In SE11/SE16 viewing the underlaying transparent table
    ad 1.
    When I try to filter erroneous records for more than one datapackage situation is as described above.
    ad 2.
    Trying to view the table works, but where is the chararcteristic/field marking a  record as erroneous
    in table /BIC/Bxxxxxxxx (table containing PSA-Data) ?
    Thanks
    Joe

  • Submitting data to more than one table

    I want to be able to use one form to submit data to two or
    more tables in the same database. Does anyone know if this is
    possible and if so how would I go about it. I understand how to use
    a form to submit to one table I am just stuck on more than one.
    I am using Access 2000 and DW MX 2004
    thanks in advance

    It's usually best to use a stored procedure to handle
    this.

  • Left Outer Join with more than two tables in both CR 8.5 and XIR2

    I am trying to create a report and I have tried two versions of Crystal but I ultimately need the report in CR8.5 for compatibility with the client's system.  I think I am starting to figure out what might be wrong and it might be my understanding of SQL, but I can't see why someone hasn't needed this in the past. Ultimately I want to see all projects and any journal entry that might be posted for that project.
    Database is MySQL 5.0.38 and using MySQL ODBC driver 3.51.19.
    Project header table information will be populated. Each line item on a journal entry can be tagged with the project ID. But for me to pull the journal entry date I need also to link to a third table for the journal entry header info.
    I want to see all projects, whether a journal entry has been posted or not.
    So the links are like this
    ProjectHeader --->Left Outer Join ---> JELines ---> Inner Join ---> JEHeader
    I think in this scenerio Crystal is treating the LOJ as an IJ.
    I created two brand new reports today, one in CR8.5 and one in CR XIR2. Once I edited the automatic CR8.5 SQL statement (which I have been doing for years, usually without problem), they both ran properly. I linked customers to their invoices. Customers without invoices showed properly. But then I linked the invoices to the payments of the invoices and immediately lost customers without orders in both reports.
    So apparently only two tables are allowed in Outer Joins. Does this make sense?  I checked out the w3schools tutorial on SQL and it doesn't mention this limitation and I can't find anywhere else that it specifically indicates this but all samples of code I have seen only show two tables.  I just thought for presentation as a sample that was easiest to understand and we could expand as necessary.
    If this is correct, how does one go about accounting for this kind of thing?  One solution that goes through my mind is creating a view at the database level for the link between journal entry lines and journal entry headers.  Would this be a good solution under normal circumstances?
    A second option that I had to implement because of timelines, is to use a subreport linked to the main report through the project ID to pull the information for the journal entries and just pass the totals I need to the main report through a shared variable.
    These aren't normal circumstances because I don't have access to the database so I can't create the view.  I have come across this concept several times and I have been able to use subreports to solve it but I am trying to find a better solution for the future as sometimes subreports can be slow.  So are there any alternatives I have not considered here?
    TIA rasinc

    So after some more work and another post.  I was able to get this to work.
    Items disappear when linking to another table
    My issues were two fold.  I was selecting on the tables on the right-side of the original Inner Join.  However, I was checking for Nulls.  This apparently is correct but you must check for the Nulls first eg. (IsNull (JEHeader.Field1) OR JEHeader.Field1 <= 100).  I had my original statement reversed checking for <= 100 before checking for Nulls.
    I also did not set all links to be Left Outer Join.  I had the Inner Join.  I actually have about 6 tables in this report so all the links need to be set Outer Join.  So this now seems to be corrected.
    Thanks

  • ADF delete from more than one table with single delete operation

    Hi all,
    I have a scenario in which I am trying to delete record(s) from 3 tables.
    My jspx page looks like this:
    Column1:drop down from 1st table
    Column2:drop down from 2nd table
    Column3:drop down from 3rd table
    Delete Commit
    I have created a view object which has these three tables as entities. I drag dropped the view object and displayed these three columns.
    Now when i select any one or all three or any two out of these and click delete, only the "column 1" gets deleted from 1st table. The remaining two tables remain unaffected.
    Y is this so?
    Can't I use one delete operation for all three tables' DML operation in single go?
    Thanks.

    If you have a business case that requires deleting from 3 tables at once when removing a single row in a view object then you may look for the problem in you data model...
    Until then I'd suggest to create a database view providing the information you need (plus the PKs fron the individual tables) and creating entity and view objects based on this view. An "instead of dele" trigger attached to the view can do the actual delete operation on the 3 tables.
    bye
    TPD

  • How to manage a Database Application with more than two tables

    Hello All,
    I need to manage (reconciliation and provisioning) a database application where user attributes are strored in seven tables.
    Reference guide for Database Applications Table connector says that only two tables can be managed using this connector.
    Which is the best way to solve this problem? Could I create a view in my database ? are database views supported? Must I create a new conector?
    Thanks in advance.

    Hi ,
    I developed it from scratch due to complex requirements for accessing tables and their relationship. You can use current connector for your reference.at higher level you need to do only two change (1) build query from xml files to add,update,delete* record across seven tables - (2) changing oim elememnt ( use connector guide for changing element to match your needs)
    To develop new connector :
    (1) study relationship between these tables (1:*) and fields of interest and also ,as earlier mentioned timestamps for fetching changed record. based on your requirement.
    (2) create OIM elements , something you have when you deployed DB app. connector. modify it for requirement. i.e fields .. trusted , non trusted. process task,adapter
    (3) Develop classes to get execute query on database. create adapters to perform add/update/delete operation on 7 tables.

  • Get data from more than 1 subtype using RP_PROVIDE_FROM LAST

    Hi all,
    I need to get data from infotype 2013 subtype 90 and subtype 91.
    Currently the codes only allow me to use it one time for the same infotype. If I use it again for the same infotype, pnp-sw-found will equal to zero. Anyone have any idea on this?
    Example:
    Get pernr.
    Start of selection.
    rp_provide_from_last p2013 0090 pn-begda pn-endda.
      IF pnp-sw-found =  1.
    **--> Populate internal table
        MOVE p2013-ktart TO ls_quota-ktart.
        MOVE p2013-aedtm to ls_quota-aedtm.
        MOVE p2013-uname to ls_quota-uname.
        MOVE p2013-accnu to ls_quota-accnu.
        MOVE p2013-accop to ls_quota-accop.
      ELSE.
        REJECT.
      ENDIF.
    End of selection.

    Using RP_PROVIDE_FROM_LAST you can only use for one infotype and one subtype. For reading data for IT2013 with subtypes 90 and 91....you have to use following....
    Get pernr.
    Start of selection.
    rp_provide_from_last p2013 0090 pn-begda pn-endda.
    IF pnp-sw-found = 1.
    **--> Populate internal table
        MOVE:
               p2013-ktart TO ls_quota-ktart,
               p2013-aedtm to ls_quota-aedtm,
               p2013-uname to ls_quota-uname,
               p2013-accnu to ls_quota-accnu,
               p2013-accop to ls_quota-accop.
    ELSE.
      rp_provide_from_last p2013 0091 pn-begda pn-endda.
      IF pnp-sw-found = 1.
         **--> Populate internal table
         MOVE:
               p2013-ktart TO ls_quota-ktart,
               p2013-aedtm to ls_quota-aedtm,
               p2013-uname to ls_quota-uname,
               p2013-accnu to ls_quota-accnu,
               p2013-accop to ls_quota-accop.
       ELSE.
           REJECT.
       ENDIF.
    ENDIF.
    End of selection.
    Hope this answer is helpful

  • Creating data source in R/3 system from more than one table.

    Hi All,
    Currently I have a requirement where I need to bring  data in BW from 5 different table in the CM (our R/3 system) system.
    How do I achieve this?
    If I create a generic datasource, how can I map 5 tables in a single datasource?
    Please detail the process to achieve this.
    Regards,
    Kironmoy Banerjee

    Hi  ,
    We can create the DS based on No.Of tables.
    But need to check the below points.
    1. Is there any relation ship between the tables (Means common Key).
          -       If the above condition is Ok then directly you can use view.
    2. If there is no relation you have to FM.
    - Please check the below link (Pdf Document) for how to to create FM in Generic :
          http://www.sdn.sap.com/irj/scn/index;jsessionid=(J2EE3417100)ID0102005850DB00995891084283618218End?rid=/library/uuid/c062a3a8-f44c-2c10-ccb8-9b88fbdcb008&overridelayout=true
    Regards
    Ram.

Maybe you are looking for

  • How to reset display resolution on a MacBook Pro

    Hi, My MBP 15.4 /2.4GHz display is stuck at a low colour display and I am unable to get it back to normal. I was working in MS Remote Desktop Connection, switched into OS X's Universal Access in System Preferences and that's when the fun started. I'v

  • Combining multiple rows into a single row

    Hi all, I have a tricky situation in a HR select. Imagine I have a dataset as below, simplified of course. Name Start Date End date Job Title Salary Tom 01/01/07 02/03/08 Gopher £500 Tom 03/03/08 jobsworth £600 Rick 04/05/09 Painter £500 Harry 02/06/

  • BISM Content Type is not available

    Hi All, I'm trying to add BISM connection in Sharepoint site for PowerPivot report, however i'm not able to find the content type in Business Intelligence. I have enabled PowerPivot Integration Site Collection Feature as well and also in advance sett

  • Export to jpeg issue: ROES can't preview the files

    We are using InDesign to create album layouts which we then order from our lab using their ROES software. Annoyingly, the jpegs created by InDesign cannot be previewed by the ROES software. I have to open them all in Photoshop and resave, which is ve

  • Photos the question is why?

    Foe some extraordinary reason Apple has decided to downgrade the previously very useful iPhoto. Photos is a bit like buying a new car. It looks nice, its shiny and comfortable and even has that nice new car smell. Unfortunately they took out the engi