Sender JDBC Adapter : Fetch records from multiple tables

Hi Friends,
I am using sender JDBC adapter to select few records from DB2 database table.
This scenario is working fine.
Now my requirement is to fetch records from 3 tables. These table are independent to each other. There is no primary key or foreign key.
Please let me know how to write the sql in sender JDBC adapter to fetch records from these 3 tables.
Thanks,
Sandeep Maurya

hi sandeep...
if the tables are completely independent and do not share any primary / foreign key relation ship...
why dont u think towards creating a seperate interface for each of them..
or if u still want to select from multiple table at once..the best way would be to write a stored procedure on the sender side which do all the fetching n processing and pass the final resultset to PI
or u can think towards fetching the data from 1 table and then in UDF do lookup from other tables..which again is tricky and performace intensive

Similar Messages

  • Generic datasource by function module to fetch data from multiple tables?

    I'm writing a function module to fetch price, for generic datasource.
    At first, extract test is OK. But InfoPackage never stop  when loading data to PSA in BW.
    And I find the example codes:
         OPEN CURSOR WITH HOLD S_CURSOR FOR
          SELECT (S_S_IF-T_FIELDS) FROM SFLIGHT
                                   WHERE CARRID  IN L_R_CARRID AND
                                         CONNID  IN L_R_CONNID.
        ENDIF.                             "First data package ?
    * Fetch records into interface table.
    *   named E_T_'Name of extract structure'.
        FETCH NEXT CURSOR S_CURSOR
                   APPENDING CORRESPONDING FIELDS
                   OF TABLE E_T_DATA
                   PACKAGE SIZE S_S_IF-MAXSIZE.
        IF SY-SUBRC <> 0.
          CLOSE CURSOR S_CURSOR.
          RAISE NO_MORE_DATA.
        ENDIF.
        S_COUNTER_DATAPAKID = S_COUNTER_DATAPAKID + 1.
      ENDIF.
    There using Cursor to fetch data package by package, and raise exception NO_MORE_DATA to stop the loading process.
    Now I fetch data from multiple tables, I don't think I can use Cursor.
    Then How can I handle this?  
    Thanks a lot.

    Thanks
    IF IT_999[] IS INITIAL.
        SELECT A~KNUMH A~MATNR A~KSCHL VKORG VTWEG A~DATBI A~DATAB KBETR KMEIN KPEIN C~MTART APPENDING CORRESPONDING FIELDS OF
          TABLE TP_DATA
            FROM A999 AS A
              INNER JOIN KONP AS B
                  ON A~KNUMH = B~KNUMH
              INNER JOIN MARA AS C
                 ON A~MATNR = C~MATNR
    *          FOR ALL ENTRIES IN IT_999
                    WHERE
    *      A~KNUMH = IT_999-KNUMH  AND
           ( ( A~KSCHL = 'ZPRC' AND VKORG = 'Z000' AND VTWEG = 'Z1' ) OR
                          ( A~KSCHL = 'ZPRD' AND VKORG = 'A000' AND VTWEG = 'Y3' ) ) AND
    *                      A~DATBI >= SY-DATUM AND
                          LOEVM_KO = ''.
        SELECT A~KNUMH A~MATNR A~KSCHL VKORG VTWEG A~DATBI A~DATAB KBETR AS KHETR  KMEIN KPEIN C~MTART APPENDING CORRESPONDING FIELDS OF
          TABLE TP_DATA
            FROM A999 AS A
              INNER JOIN KONP AS B
                  ON A~KNUMH = B~KNUMH
              INNER JOIN MARA AS C
                 ON A~MATNR = C~MATNR
    *          FOR ALL ENTRIES IN IT_999
                    WHERE
    *      A~KNUMH = IT_999-KNUMH AND
          A~KSCHL = 'ZPR3' AND A~VKORG = 'I000' AND
    *                      DATBI >= SY-DATUM AND
                          LOEVM_KO = ''.
      ENDIF.
      IF IT_997[] IS INITIAL.
        SELECT A~KNUMH A~MATNR A~KSCHL VTWEG A~DATBI A~DATAB KBETR AS KHETR KMEIN KPEIN C~MTART APPENDING CORRESPONDING FIELDS OF
          TABLE TP_DATA
            FROM A997 AS A
              INNER JOIN KONP AS B
                  ON A~KNUMH = B~KNUMH
              INNER JOIN MARA AS C
                 ON A~MATNR = C~MATNR
    *          FOR ALL ENTRIES IN IT_997
                    WHERE
    *      A~KNUMH = IT_997-KNUMH      AND
          A~KSCHL = 'ZPRA' AND VTWEG = 'Y1' AND
    *                      DATBI >= SY-DATUM AND
                      LOEVM_KO = ''.
      ENDIF.
      IF IT_996[] IS INITIAL.
        SELECT A~KNUMH A~MATNR A~KSCHL A~DATBI A~DATAB KBETR AS KHETR KMEIN KPEIN C~MTART APPENDING CORRESPONDING FIELDS OF
           TABLE TP_DATA
             FROM A996 AS A
               INNER JOIN KONP AS B
                   ON A~KNUMH = B~KNUMH
               INNER JOIN MARA AS C
                  ON A~MATNR = C~MATNR
    *          FOR ALL ENTRIES IN IT_996
                    WHERE
    *      A~KNUMH = IT_996-KNUMH AND
          A~KSCHL = 'ZPRB' AND
    *                       DATBI >= SY-DATUM AND
          LOEVM_KO = ''.
      ENDIF.
      SELECT   MATNR     "u7269u6599u53F7u7801
               MEINH     "u4ED3u50A8u5355u4F4Du7684u5907u7528u8BA1u91CFu5355u4F4D
               UMREZ     "u57FAu672Cu8BA1u91CFu5355u4F4Du8F6Cu6362u5206u5B50
               UMREN     "u8F6Cu6362u4E3Au57FAu672Cu8BA1u91CFu5355u4F4Du7684u5206u6BCD
          FROM MARM
          INTO CORRESPONDING FIELDS OF TABLE IT_MARM
           FOR ALL ENTRIES IN TP_DATA
         WHERE MATNR = TP_DATA-MATNR AND  MEINH = TP_DATA-KMEIN.
      LOOP AT TP_DATA.
        IF TP_DATA-KPEIN NE 0.
          TP_DATA-KBETR =  TP_DATA-KBETR / TP_DATA-KPEIN.
          TP_DATA-KHETR =  TP_DATA-KHETR / TP_DATA-KPEIN.
        ENDIF.
        IF TP_DATA-KSCHL = 'ZPRA'.
    *       TP_DATA-MEINH = 'ZI'.
    *      TP_DATA-KSCHL = 'B4'.
          IF TP_DATA-KMEIN = 'ZI'.
            TP_DATA-KBETR = TP_DATA-KHETR / '1.17'.
          ELSE.
            READ TABLE IT_MARM INTO WA_MARM1 WITH KEY MATNR = TP_DATA-MATNR MEINH = TP_DATA-KMEIN.
    *           READ TABLE IT_MARM INTO WA_MARM2 WITH KEY MATNR = TP_DATA-MATNR MEINH = 'CT'.
            TP_DATA-KHETR = TP_DATA-KHETR * WA_MARM1-UMREN / WA_MARM1-UMREZ.
    *           * WA_MARM2-UMREZ / WA_MARM2-UMREN.
            TP_DATA-KBETR = TP_DATA-KHETR / '1.17'.
          ENDIF.
        ELSEIF TP_DATA-KSCHL = 'ZPRB'.
    *      TP_DATA-KSCHL = 'L0'.
    *       TP_DATA-MEINH = 'ZI'.
          IF TP_DATA-KMEIN = 'ZI'.
            TP_DATA-KBETR = TP_DATA-KHETR / '1.17'.
          ELSE.
            READ TABLE IT_MARM INTO WA_MARM1 WITH KEY MATNR = TP_DATA-MATNR MEINH = TP_DATA-KMEIN.
    *           READ TABLE IT_MARM INTO WA_MARM2 WITH KEY MATNR = TP_DATA-MATNR MEINH = 'BAG'.
            TP_DATA-KHETR = TP_DATA-KHETR * WA_MARM1-UMREN / WA_MARM1-UMREZ.
    *           * WA_MARM2-UMREZ / WA_MARM2-UMREN.
            TP_DATA-KBETR = TP_DATA-KHETR / '1.17'.
          ENDIF.
        ELSEIF TP_DATA-KSCHL = 'ZPRC' OR TP_DATA-KSCHL = 'ZPRD'.
    *       TP_DATA-MEINH = 'ZI'.
          IF TP_DATA-KMEIN = 'ZI'.
            TP_DATA-KHETR = TP_DATA-KBETR * '1.17'.
          ELSE.
            READ TABLE IT_MARM INTO WA_MARM1 WITH KEY MATNR = TP_DATA-MATNR MEINH = TP_DATA-KMEIN.
    *           READ TABLE IT_MARM INTO WA_MARM2 WITH KEY MATNR = TP_DATA-MATNR MEINH = 'WZI'.
            TP_DATA-KBETR = TP_DATA-KBETR * WA_MARM1-UMREN / WA_MARM1-UMREZ.
    *           * WA_MARM2-UMREZ / WA_MARM2-UMREN.
            TP_DATA-KHETR = TP_DATA-KBETR * '1.17'.
          ENDIF.
        ELSEIF TP_DATA-KSCHL = 'ZPR3'.
    *      TP_DATA-KSCHL = 'B2'.
          IF TP_DATA-KMEIN = 'ZI'.
            TP_DATA-KBETR = TP_DATA-KHETR / '1.17'.
          ELSE.
            READ TABLE IT_MARM INTO WA_MARM1 WITH KEY MATNR = TP_DATA-MATNR MEINH = TP_DATA-KMEIN.
    *           READ TABLE IT_MARM INTO WA_MARM2 WITH KEY MATNR = TP_DATA-MATNR MEINH = 'BAG'.
            TP_DATA-KHETR = TP_DATA-KHETR * WA_MARM1-UMREN / WA_MARM1-UMREZ.
    *           * WA_MARM2-UMREZ / WA_MARM2-UMREN.
            TP_DATA-KBETR = TP_DATA-KHETR / '1.17'.
          ENDIF.
        ENDIF.
        TP_DATA-MEINH = '01'.
        MODIFY TP_DATA.
    E_T_DATA-MATNR =   TP_DATA-MATNR.
    E_T_DATA-KSCHL =   TP_DATA-KSCHL.
    E_T_DATA-KHETR =   TP_DATA-KHETR.
    E_T_DATA-KBETR =   TP_DATA-KBETR.
    E_T_DATA-KMEIN =   TP_DATA-KMEIN.
    E_T_DATA-DATAB =   TP_DATA-DATAB.
    E_T_DATA-DATBI =   TP_DATA-DATBI.
    APPEND E_T_DATA.
        CLEAR WA_MARM1.
        CLEAR WA_MARM2.
      ENDLOOP.
    Edited by: Shen Peng on Oct 20, 2010 10:09 AM

  • Delete records from multiple table

    Hi,
    I need to delete records from multiple tables using a single delete statement. Is it possible ? If so please let me know the procedure.
    Kindly Help.
    Thanks,
    Alexander.

    Hi Tim,
    Syntax of DELETE statement does not allow for multiple tables to be specified in this way. Infact, none of the DMLs allow you to specify table names like this.
    Technically, there are other ways of deleting from multiple tables with one statement.
    1. "Use a trigger":
    What was probably meant by this is that you have a driving-table on which you create a on-delete trigger. In this trigger, you write the logic for deleting from other tables that you want to delete from.
    This does mean a one-time effort of writing the trigger. But the actual DML operation of deleting from all the tables would be simply triggered by a delete on driving-table.
    2. Dynamic SQL:
    Write a PL/SQL code to open a cursor with table-names from which you want the data to be deleted from. In the cursor-for loop, write a dynamic SQL using the table-name to delete from that table.
    3. Using Foreign-Key constraint with Cascade-Delete:
    This I feel is a more 'cleaner' way of doing this.
    Having to delete data from multiple tables means that there is some kind of parent-child relationship between your tables. These relationships can be implemented in database using foreign-key constraints. While creating foreign-key constraint give the 'on delete cascade' clause to ensure that whenever data is deleted from parent-table, its dependent data is deleted from child-table.
    Using foreign-key constraint you can create a heirarchy of parent-child relationships and still your DELETE would be simple as you would only have to delete from parent-table.
    IMPORTANT: Implementing foreign-key constraints would also impact other DML operations that you should keep in mind.

  • Records from multiple tables

    Hi,
    I have a method that has to access records from multiple tables and store them all in a file. It's something like this:
    switch (tableId){
    case 'A' : query="SELECT * FROM TABLE_A
    WHERE ID = '" + tempId + "'";
    ResultSet rs = stmt.executeQuery (query);
    rs.close();
    break;
    case 'B' : query="SELECT * FROM TABLE_B
    WHERE ID = '" + tempId + "'";
    rs = stmt.executeQuery (query);
    rs.close();
    break;
    case 'C' : query="SELECT * FROM TABLE_C
    WHERE ID = '" + tempId + "'";
    rs = stmt.executeQuery (query);
    rs.close();
    break;
    My problem is that I get an "Invalid cursor" error the second time I enter the loop. I've been reading up on cursors but I still don't know what to do. Can I use ResultSet to return multiple rows from multiple tables? If not, what can I use? Please help!
    Thanks in advance.

    remove the "rs.close()" from the switch statement. use "rs.close()" after your loop ends.
    prem

  • How can i fetch records from 3 tables in a single query  without using join

    Hi.
    Can any body please tell me <b>How can i fetch records from 3 tables with a single query  without using joins</b>
    Thanx
    prabhudutta

    Hi Prabgudutta,
    We can fetch the data by using the views concept.
    Go throuth this info we can know the how to create view and same like database table only we can fetch the data.
    Views conatin the data at runtime only.
    Four different view types are supported. These differ in the
    way in which the view is implemented and in the methods
    permitted for accessing the view data.
    Database views are implemented with an equivalent view on
    the database.
    Projection views are used to hide fields of a table (only
    projection).
    Help views can be used as selection method in search helps.
    Maintenance views permit you to maintain the data
    distributed
    on several tables for one application object at one time.
    step by step creation of Maintenance view:
    With the help of the table maintenance generator, you are able to maintain the ENTRIES of the table in SM30 transaction.
    It can be set in transaction SE11 - Tools - Table maintenance generator.
    Table maintanance Generator is used to manually input values using transaction sm30
    follow below steps
    1) go to se11 check table maintanance check box under attributes tab
    2) utilities-table maintanance Generator-> create function group and assign it under
    function group input box. Also assign authorization group default &NC& .
    3) select standard recording routine radio in table table mainitainence generator to move table
    contents to quality and production by assigning it to request.
    4) select maintaience type as single step.
    5) maintainence screen as system generated numbers this dialog box appears when you click on create button
    6) save and activate table
    One step, two step in Table Maintenance Generator
    Single step: Only overview screen is created i.e. the Table Maintenance Program will have only one screen where you can add, delete or edit records.
    Two step: Two screens namely the overview screen and Single screen are created. The user can see the key fields in the first screen and can further go on to edit further details.
    SM30 is used for table maintenance(addition or deletion of records),
    For all the tables in SE11 for which Table maintenance is selected , they can be maintained in SM30
    Sm30 is used to maintain the table ,i.e to delete ,insert or modify the field values and all..
    It creates the maintenance screen for u for the aprticular table as the maintenance is not allowed for the table..
    In the SE11 delivery and maintenance tab, keep the maintenance allowed..
    Then come to the SM30 and then enter the table name and press maintain..,
    Give the authorization group if necessary and give the function group and then select maintenance type as one step and give the screen numbers as system specified..
    Then create,,,
    Then u will able to see the maintenance view for the table in which u can able to insert and delete the table values...
    We use SM30 transaction for entering values into any DB table.
    First we create a table in SE11 and create the table maintenance generator for that Table using (utilities-> table maintenance generator) and create it.
    Then it will create a View.
    After that from SM30, enter the table name and Maintain, create new entries, change the existing entries for that table.
    Hope this resolves your query.
    Reward all the helpful answers.
    Rgds,
    P.Naganjana Reddy

  • Need assistance searching records from multiple tables - Please Help!

    Hi, I've been trying to solve this problem for several weeks now, and I have exhausted all of my knowledge and experience.  I need help, and I hope someone here can give me some direction.
    I am using VB 2008, and the CR that comes bundled with VS 2008 Pro.  My database is a SQL Server 2005 CE v3.5 (a *.sdf file).  I am connecting to the database through a dataset, and I am displaying the report in a CrystalReportViewer.
    My dataset consistes of two tables:
    1) tblCustomers which has a primary key "CustID", and contains only customer contact and personal information. 
    2) tblDateVisited which has a primary key of "VisitID", but it also has a column titled "CustID". Basically, every time a customer visits the business, details of that visit are recorded in tblDateVisited, and that record is associated with the customer by their CustID.
    Here's what I'm trying to accomplish:  I want to be able to display only Customer records when the customer has visited and that visit matches certain criteria.  Right now, I am trying to match visits from the "tblVisitDate.PlayerType" column.  If the customer has ever had a visit where they matched a particular player type, I want to see those customer records.
    I don't know what I'm doing wrong, though.  I can search a dataset if I am only querying one table and pulling records from that table.  However, whenever I try to add a second table and perform queries on that table to get records from the first table, I can't return any records. 
    If it helps, I am trying to use one CrystalReportViewer to display multiple reports (user choice) and here's how I'm loading the report into the viewer:
    Me.tblCustomersTableAdapter.Fill(Me.dsPlayerTypeReports.tblCustomers)
    Me.tblDateVisitedTableAdapter.Fill(Me.dsPlayerTypeReports.tblDateVisited)
    Me.ReportFile.SetDataSource(dsPlayerTypeReports.Tables(1))
    I am suspicious that my problem is in the Tables(1) method.  It confuses me that I can only assign one table as a datasource when I obviously need access to two tables to make this selection work. 
    Whatever the case, I'm at the end of my rope with this one.  I'm not prone to giving up, but I'm at a dead end currently. 
    Any attempt to assist me with this will be greatly appreciated, successful or not.
    Thanks in advance!
    -Will

    No, I am connected via ADO.NET.  I don't think SQL CE can connect through ODBC (or if it can, I haven't been able to figure out how, yet).  So this isn't a stored procedure.
    When I examine the link, I can only choose an Inner Join or a Left Outer Join.  Right Outer and Full Outer are not available.  Could this be a problem with the dataset I'm using?
    Could you explain what you mean by display all of the records and then choose the selection criteria?

  • Extracting Records from multiple tables

    hi
    I have to extract almost 1 lack  records from 3 tables.
    Please help me in ABAP CODE.
    PLease it is very urgent.

    Which tables are they ?  Refer to link below for more hints abt performance.
    Re: select query - optimization

  • How to write ABAP Logic in SAP Query to fetch records from many Tables

    Hi Expert,
    I have one requirement, want to display all BOM (Equipment BOM, Function Location BOM and Meterial BOM) from a particular plant.
    List of tables as below:
    EQST: Equipment to BOM Link
    TPST: Link Between Functional Location and BOM
    MAST: Material to BOM Link
    STPO:BOM item
    Requirement: When user enters Plant then SAP Query should execute and fetch all BOMs (as mentioned above) from STPO Table.
    I have done so far is as follows:
    I create User Group, Infoset and SAP Query.
    While creating INFOSET, i used 4 tables (EQST,TPST,MAST & STPO) and link between then is as follows:
    STPO-STLNR ---> EQST-STLNR : Left Outer Join
    STPO-STLNR ---> TPST-STLNR : Left Outer Join
    STPO-STLNR ---> MAST-STLNR : Left Outer Join
    Now its showing all BOM from all plants though I enter one Plant value.
    Please advise me to write SAP Query and Logic to fetch all BOM from selected Plant Value.
    Thanks,
    Jay.
    Edited by: jaykrishna007 on Jul 29, 2011 11:41 AM

    Hi FCannavo,
    Thanks for your quick reply.
    See, now I changed my Infoset design.
    I added one Plant Table (T001W) and then
    T001W-WERKS--->EQST-WERKS
    T001W-WERKS--->MAST-WERKS
    T001W-WERKS--->TPST-WERKS
    and then
    EQST-STLNR--->STPO-STLNR
    MAST-STLNR--->STPO-STLNR
    TPST-STLNR--->STPO-STLNR
    on selection screen, user will enter Plant Value.
    Now its showing some records, but i dont think so i would be correct output or not, please guide me whether it is correct or not?
    Thanks,
    Jay.

  • Trouble fetching record from Internal table

    Hi all,
    I am using a binary search read for retrieving data from an internal table, but i am not able to fetch a particular record even while it is present in the internal table.

    Check if you are sorting the table. When you are not sorting the table, the read fetch the next highest key field from the table e.g.
    Suppose if you have an internal table with following keys:
    12
    9
    13
    2
    22
    the read will pick only 12,13 & 22 record.
    Regards,
    Prashant.

  • How to fetch rows from multiple tables

    I have a page with items from 3 tables. I need to populate these items with values from the database. The page does not allow me to use multiple automated fetches. So instead I decided to use a pl/sql page process that runs a cursor to get my field values and the uses apex_util.set_session_state to set the field item values. IS there any isues with doing this? Is there a better way?

    These tables are not really related so I gues I will stick with the pl/sql to populate and then page process to insert/update/delete. Here is the code I'm using.
    Chris
    DECLARE
    CURSOR get_info IS
    select A.FK_STU_BASE, A.FK_CONTACT, A.FK_RELATION, A.PRIORITY, A.CAN_PICK_UP_STUDENT,
    A.GETS_STX, A.GETS_STG, A.GETS_STA, A.GETS_DIS, A.GETS_THX, A.GETS_MED,
    A.GETS_MAIL, A.NOTES as STUDENT_NOTES, A.USER_FLD1, A.USER_FLD2, A.USER_FLD3,
    A.USER_FLD4, A.USER_FLD5, A.LAST_UPDATE_DATE, A.LAST_UPDATE_USER,
    B.PK_ID as CONTACT_PK_ID, B.FIRST_NAME, B.LAST_NAME, B.MIDDLE_INIT, B.PREFIX,
    B.SUFFIX, B.FK_LANGUAGE, B.PHONE, B.PHONE_UNLISTED, B.PHONE_EXTENSION,
    B.PHONE_DESCRIPTION, B.EMERGENCY_PHONE, B.EMERGENCY_UNLISTED, B.EMERGENCY_EXTENSION,
    B.EMERGENCY_DESCRIPTION, B.CELL_PHONE, B.CELL_UNLISTED, B.CELL_EXTENSION,
    B.CELL_DESCRIPTION, B.CELL2_PHONE, B.CELL2_UNLISTED, B.CELL2_EXTENSION,
    B.CELL2_DESCRIPTION, B.WORK1_PHONE, B.WORK1_UNLISTED, B.WORK1_EXTENSION,
    B.WORK1_DESCRIPTION, B.WORK2_PHONE, B.WORK2_UNLISTED, B.WORK2_EXTENSION,
    B.WORK2_DESCRIPTION, B.FAX_PHONE, B.FAX_DESCRIPTION, B.EMAIL1, B.EMAIL2,
    B.NOTES as CONTACT_NOTES, B.FK_LODGING, B.FK_EDUCATION_LEVEL,
    C.PK_ID as LODGING_PK_ID, C.FK_ZIP, C.FK_DISTRICT, C.HOUSE_NO, C.LETTER,
    C.DIRECTION, C.STREET, C.STREET2, C.PLUS4, C.APT, C.FK_GRIDCODE,
    C.FK_MUNICIPALITY, C.OPTIONAL_INFO1, C.OPTIONAL_INFO2, C.OPTIONAL_INFO3,
    C.FK_DWELLING, C.OPTIONAL_ZIPCODE
    from contact_link A,
    contact B,
    lodging C
    where A.PK_ID = :P470_CONTACT_LINK_PK_ID and
    B.PK_ID (+) = A.FK_CONTACT and
    C.PK_ID (+) = B.FK_LODGING;
    BEGIN
    FOR x in get_info LOOP
    -- Set Contact Link Items
    APEX_UTIL.SET_SESSION_STATE('P470_FK_STU_BASE',X.FK_STU_BASE);
    APEX_UTIL.SET_SESSION_STATE('P470_FK_CONTACT',X.FK_CONTACT);
    APEX_UTIL.SET_SESSION_STATE('P470_FK_RELATION',X.FK_RELATION);
    APEX_UTIL.SET_SESSION_STATE('P470_PRIORITY',X.PRIORITY);
    APEX_UTIL.SET_SESSION_STATE('P470_CAN_PICK_UP_STUDENT',X.CAN_PICK_UP_STUDENT);
    APEX_UTIL.SET_SESSION_STATE('P470_GETS_STX',X.GETS_STX);
    APEX_UTIL.SET_SESSION_STATE('P470_GETS_STG',X.GETS_STG);
    APEX_UTIL.SET_SESSION_STATE('P470_GETS_STA',X.GETS_STA);
    APEX_UTIL.SET_SESSION_STATE('P470_GETS_DIS',X.GETS_DIS);
    APEX_UTIL.SET_SESSION_STATE('P470_GETS_THX',X.GETS_THX);
    APEX_UTIL.SET_SESSION_STATE('P470_GETS_MED',X.GETS_MED);
    APEX_UTIL.SET_SESSION_STATE('P470_GETS_MAIL',X.GETS_MAIL);
    APEX_UTIL.SET_SESSION_STATE('P470_STUDENT_NOTES',X.STUDENT_NOTES);
    APEX_UTIL.SET_SESSION_STATE('P470_USER_FLD1',X.USER_FLD1);
    APEX_UTIL.SET_SESSION_STATE('P470_USER_FLD2',X.USER_FLD2);
    APEX_UTIL.SET_SESSION_STATE('P470_USER_FLD3',X.USER_FLD3);
    APEX_UTIL.SET_SESSION_STATE('P470_USER_FLD4',X.USER_FLD4);
    APEX_UTIL.SET_SESSION_STATE('P470_USER_FLD5',X.USER_FLD5);
    APEX_UTIL.SET_SESSION_STATE('P470_LAST_UPDATE_DATE',X.LAST_UPDATE_DATE);
    APEX_UTIL.SET_SESSION_STATE('P470_LAST_UPDATE_USER',X.LAST_UPDATE_USER);
    --Set Contact Items
    APEX_UTIL.SET_SESSION_STATE('P470_CONTACT_PK_ID',X.CONTACT_PK_iD);
    APEX_UTIL.SET_SESSION_STATE('P470_FIRST_NAME',X.FIRST_NAME);
    APEX_UTIL.SET_SESSION_STATE('P470_LAST_NAME',X.LAST_NAME);
    APEX_UTIL.SET_SESSION_STATE('P470_MIDDLE_INIT',X.MIDDLE_INIT);
    APEX_UTIL.SET_SESSION_STATE('P470_PREFIX',X.PREFIX);
    APEX_UTIL.SET_SESSION_STATE('P470_SUFFIX',X.SUFFIX);
    APEX_UTIL.SET_SESSION_STATE('P470_FK_LANGUAGE',X.FK_LANGUAGE);
    APEX_UTIL.SET_SESSION_STATE('P470_PHONE',X.PHONE);
    APEX_UTIL.SET_SESSION_STATE('P470_PHONE_UNLISTED',X.PHONE_UNLISTED);
    APEX_UTIL.SET_SESSION_STATE('P470_PHONE_EXTENSION',X.PHONE_EXTENSION);
    APEX_UTIL.SET_SESSION_STATE('P470_PHONE_DESCRIPTION',X.PHONE_DESCRIPTION);
    APEX_UTIL.SET_SESSION_STATE('P470_EMERGENCY_PHONE',X.EMERGENCY_PHONE);
    APEX_UTIL.SET_SESSION_STATE('P470_EMERGENCY_UNLISTED',X.EMERGENCY_UNLISTED);
    APEX_UTIL.SET_SESSION_STATE('P470_EMERGENCY_EXTENSION',X.EMERGENCY_EXTENSION);
    APEX_UTIL.SET_SESSION_STATE('P470_EMERGENCY_DESCRIPTION',X.EMERGENCY_DESCRIPTION);
    APEX_UTIL.SET_SESSION_STATE('P470_CELL_PHONE',X.CELL_PHONE);
    APEX_UTIL.SET_SESSION_STATE('P470_CELL_UNLISTED',X.CELL_UNLISTED);
    APEX_UTIL.SET_SESSION_STATE('P470_CELL_EXTENSION',X.CELL_EXTENSION);
    APEX_UTIL.SET_SESSION_STATE('P470_CELL_DESCRIPTION',X.CELL_DESCRIPTION);
    APEX_UTIL.SET_SESSION_STATE('P470_CELL2_PHONE',X.CELL2_PHONE);
    APEX_UTIL.SET_SESSION_STATE('P470_CELL2_UNLISTED',X.CELL2_UNLISTED);
    APEX_UTIL.SET_SESSION_STATE('P470_CELL2_EXTENSION',X.CELL2_EXTENSION);
    APEX_UTIL.SET_SESSION_STATE('P470_CELL2_DESCRIPTION',X.CELL2_DESCRIPTION);
    APEX_UTIL.SET_SESSION_STATE('P470_WORK1_PHONE',X.WORK1_PHONE);
    APEX_UTIL.SET_SESSION_STATE('P470_WORK1_UNLISTED',X.WORK1_UNLISTED);
    APEX_UTIL.SET_SESSION_STATE('P470_WORK1_EXTENSION',X.WORK1_EXTENSION);
    APEX_UTIL.SET_SESSION_STATE('P470_WORK1_DESCRIPTION',X.WORK1_DESCRIPTION);
    APEX_UTIL.SET_SESSION_STATE('P470_WORK2_PHONE',X.WORK2_PHONE);
    APEX_UTIL.SET_SESSION_STATE('P470_WORK2_UNLISTED',X.WORK2_UNLISTED);
    APEX_UTIL.SET_SESSION_STATE('P470_WORK2_EXTENSION',X.WORK2_EXTENSION);
    APEX_UTIL.SET_SESSION_STATE('P470_WORK2_DESCRIPTION',X.WORK2_DESCRIPTION);
    APEX_UTIL.SET_SESSION_STATE('P470_FAX_PHONE',X.FAX_PHONE);
    APEX_UTIL.SET_SESSION_STATE('P470_FAX_DESCRIPTION',X.FAX_DESCRIPTION);
    APEX_UTIL.SET_SESSION_STATE('P470_EMAIL1',X.EMAIL1);
    APEX_UTIL.SET_SESSION_STATE('P470_EMAIL2',X.EMAIL2);
    APEX_UTIL.SET_SESSION_STATE('P470_CONTACT_NOTES',X.CONTACT_NOTES);
    APEX_UTIL.SET_SESSION_STATE('P470_FK_LODGING',X.FK_LODGING);
    APEX_UTIL.SET_SESSION_STATE('P470_FK_EDUCATION_LEVEL',X.FK_EDUCATION_LEVEL);
    --Set Lodging Items
    APEX_UTIL.SET_SESSION_STATE('P470_LODGING_PK_ID',X.LODGING_PK_ID);
    APEX_UTIL.SET_SESSION_STATE('P470_FK_ZIP',X.FK_ZIP);
    APEX_UTIL.SET_SESSION_STATE('P470_FK_DISTRICT',X.FK_DISTRICT);
    APEX_UTIL.SET_SESSION_STATE('P470_HOUSE_NO',X.HOUSE_NO);
    APEX_UTIL.SET_SESSION_STATE('P470_LETTER',X.LETTER);
    APEX_UTIL.SET_SESSION_STATE('P470_DIRECTION',X.DIRECTION);
    APEX_UTIL.SET_SESSION_STATE('P470_STREET',X.STREET);
    APEX_UTIL.SET_SESSION_STATE('P470_STREET2',X.STREET2);
    APEX_UTIL.SET_SESSION_STATE('P470_PLUS4',X.PLUS4);
    APEX_UTIL.SET_SESSION_STATE('P470_APT',X.APT);
    APEX_UTIL.SET_SESSION_STATE('P470_FK_GRIDCODE',X.FK_GRIDCODE);
    APEX_UTIL.SET_SESSION_STATE('P470_FK_MUNICIPALITY',X.FK_MUNICIPALITY);
    APEX_UTIL.SET_SESSION_STATE('P470_OPTIONAL_INFO1',X.OPTIONAL_INFO1);
    APEX_UTIL.SET_SESSION_STATE('P470_OPTIONAL_INFO2',X.OPTIONAL_INFO2);
    APEX_UTIL.SET_SESSION_STATE('P470_OPTIONAL_INFO3',X.OPTIONAL_INFO3);
    APEX_UTIL.SET_SESSION_STATE('P470_FK_DWELLING',X.FK_DWELLING);
    APEX_UTIL.SET_SESSION_STATE('P470_OPTIONAL_ZIPCODE',X.OPTIONAL_ZIPCODE);
    END LOOP;
    END;

  • Search a record from Multiple Tables

    Is there a pl/sql command or way that searches for a specific record (text, number) in multiple tables? Given that you don't know the column you are searching from.

    There is no built in method, but you can roll your own.
    I posted one way Re: How to find out a tablename
    HTH
    John

  • Using ResultSet to read records from multiple tables

    Im using a ResultSet object to read records from tables.
    I have a database with 5 tables. Initially, I got it to work fine with one of those tables. What Im exactly trying to do is check if there is a record in a table which matches a given string, and if it does, display some text on some JTextFields. I got that to work fine with one table.
    Problem is, how do I get it to work with all 5 tables at the same time?
    i.e. instead of searching through one table, I want it to look through all 5 tables and look for the matches.
    Any help greatly appreciated.
    Thanks

    After the first interaction with the first table, I
    used a stmt.getMoreResults() followed by instructions
    to get data from the second table, and so on.
    Worked fine.Sounds remarkably inefficient. (Potential for lots of network traffic.)
    is this another way of doing it?Sounds more like a document search type of thing than a database query. What about Lucene? Could it help here?
    %

  • Problem fetching data from multiple tables

    Hi,
    I am facing a problem in fetching data from 3 different tables. i am able to get the data from 2 tables but when i try accessing data from other table, i am getting redundant data. please help, my query is as under.
    select a.*,b.*, c.BidAmount from carregister a , watchlist b, Bidmaster c where a.CarID= b.CarID and b.UserID = 23 and c.BidAmount=(select max(BidAmount) from BidMaster where carid=a.carid group by c.BidAmount);
    Regards,
    Ujjwal B Soni
    <Software Developer>
    Baroda Gujarat India

    Hi,
    I got the solution. The solved query is as under :
    select a.*,b.*,(select max(BidAmount) from BidMaster where carid=b.carid) as MAX_AMT from carregister a , watchlist b where a.CarID= b.CarID and b.UserID=23;
    Thank you all for replying me.
    Warm Regards,
    Ujjwal B Soni
    <Software Developer>
    <Baroda Gujarat India>

  • Records from multiple table in Forms using Structure

    Hi all,
    I thought of bringing records from more than one table to smart forms.I have done the same by using two internal tables but not using with globally declared structure.Is it like this:
    1.Create the global structure
    2.In driver program create a internal table
    3.Pull the data using select statement
    4.Pass the internal table to smartforms-> Here I dont understand how.Usually In smartforms we declare internal tables of table type like 'itable type zgkmaster'
    How to pass the internal table we created using structure to smartforms?
    Thanks

    Hi Gopi,
    the procedure u r telling is correct.
    create the structure(ex:zstruc) in se11 as the structure of the internal table.
    *popluate the data into internal table.
    *in smartform, u declare the internal table as that structure i.e itab type zstruc.
    i.e in smartforms when u declare internal table, u r telling that ur internal table having the structure similar to the structure ZSTRUC.
    In smartforms u can declare the table type using either ...type <db table> or ... type <structure>.
    san

  • How to Concatenate Multiple Column Records from multiple tables

    my question is
    there are three tables like A,B,C
    i want the data from these tables with the help of relation
    select a.simno,b.item_code,c.desc
    from A a,B b,C c
    WHERE a.ms=b.ms and
    b.item_code=c.item_code
    and a.ms=c.ms
    the output for this query which i am getting is
    simno item_code desc
    1 i1 abc
    1 i2 def
    1 i3 xyz
    2 i4 gtr
    2 i5 poi
    but i want the output in this
    simno details
    1 abc#def#xyz
    2 gtr#poi
    and so on
    if it dispayes the output inthis manner i can save as ".csv" file

    Hi,
    There are different Solutions you can achieve
    Refer to Asktom : http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:2196162600402
    SQL> create table test(simno number, itemcode varchar2(5), desc1 char(5))
    Table created.
    SQL> insert into test(simno,itemcode,desc1) values (1 ,'i1' ,'abc');
    1 row created.
    SQL> insert into test(simno,itemcode,desc1) values (1 ,'i2' ,'def') ;
    1 row created.
    SQL> insert into test(simno,itemcode,desc1) values (1 ,'i3' ,'xyz') ;
    1 row created.
    SQL> insert into test(simno,itemcode,desc1) values (2 ,'i4' ,'gtr');
    1 row created.
    SQL> insert into test(simno,itemcode,desc1) values (2 ,'i5' ,'poi');
    1 row created.
    SQL> select simno,wmsys.wm_concat(desc1) CONCAT
      2  from test
      3  group by simno;
         SIMNO
    CONCAT
             1
    abc  ,def  ,xyz
             2
    gtr  ,poi- Pavan Kumar N

Maybe you are looking for

  • Restoring Backed Up Library

    I backed up my library onto 9 DVDs, copied a total of 7562 tunes, now when i insert the backup disks, it says at the bottom of itunes that there is, for example 796 tunes on the disk, then at the top it says copying x of 648. It is like this on every

  • How do i get my entire photostream from my iphone to my pc?

    how do i get my entire photostream from my iphone to my pc?

  • Call a function inside a package from a stored procedure

    Hello: I am kind of new to the stored procedure. Does anyone know how to call a function inside a package from another stored procedure? I have a existing function (func_b) inside a package (pack_a) and it returns a cursor. I want to call this functi

  • Error: Arthmetic over/underflow in Adobe LiveCycle 7.0

    This should be very easy and straightforward, but I cannot seem to get this error message to GO AWAY!!! I am trying to input an arithmetic formula using Formcalc that will calculate the percenter of change between two numeric fields. The two fields I

  • CSS rendering in design window

    I am doing some simple CSS layout (nothing tricky at all), and noticing that there are significant differences between how the page looks in a browser, and how it looks in Dreamweaver. The layout is 3 floated columns with header and footer - a total