How to Query Multiple Fields from different Tables using Toplink Expression

Hi,
I am trying to prepare an Oracle Toplink Expression to qurey the multiple columns of different tables. the query as following. Please can anyone help?
SELECT CYCLE.CYCLE_ID,
CYCLE.ASPCUSTOMER_ID,
CYCLE.FACILITYHEADER_ID,
CYCLE.ADDUSER,
ASP.FIRSTNAME || ' ' || ASP.LASTNAME ADDUSERNAME,
CYCLE.ADDDATE,
CYCLE.LASTUPDATEUSER,
ASP.FIRSTNAME || ' ' || ASP.LASTNAME LASTUPDATEUSERNAME,
CYCLE.LASTUPDATEDATE,
CYCLE.CYCLENAME,
CYCLE.CYCLENUMBER,
CYCLE.DESCRIPTION
FROM CYCLE,ASPUSER ASP
WHERE CYCLE.ADDUSER = ASP.ASPUSER_ID
and then i want to send that expression to readAllObjects method as a parameter
Expression exp = (..............this is the required qurey expression...................)
Vector employees = session.readAllObjects(getClass(), exp);
thanks,

You havent given any information on the mapping between Cycle and Asp. I presume there is a one to one mapping between them. Also it appears there is no "WHERE" clause to limit the number of cycles being retrieved. If that is the case then I presume you want to load all cycles in the system.
Thats just a clientSession.readAllObjects(Cycle.class). If you have indirection turned on the Asp should get loaded when you do a cycle.getAsp().
I presume that SQL you posted loads all the columns of CYCLE and ASP. If you are interested in a subset of CYCLE or ASP then you should do a ReportQuery or partial object read.
Hi,
I am trying to prepare an Oracle Toplink Expression
to qurey the multiple columns of different tables.
the query as following. Please can anyone help?
SELECT CYCLE.CYCLE_ID,
CYCLE.ASPCUSTOMER_ID,
CYCLE.FACILITYHEADER_ID,
CYCLE.ADDUSER,
ASP.FIRSTNAME || ' ' || ASP.LASTNAME ADDUSERNAME,
CYCLE.ADDDATE,
CYCLE.LASTUPDATEUSER,
ASP.FIRSTNAME || ' ' || ASP.LASTNAME
LASTUPDATEUSERNAME,
CYCLE.LASTUPDATEDATE,
CYCLE.CYCLENAME,
CYCLE.CYCLENUMBER,
CYCLE.DESCRIPTION
FROM CYCLE,ASPUSER ASP
WHERE CYCLE.ADDUSER = ASP.ASPUSER_ID
and then i want to send that expression to
readAllObjects method as a parameter
Expression exp = (..............this is the required
qurey expression...................)
Vector employees = session.readAllObjects(getClass(),
exp);
thanks,

Similar Messages

  • How to update multiple columns from different tables using cursor.

    Hi,
    i have two tables test1 and test2. i want to udpate the column(DEPT_DSCR) of both the tables TEST1 and TEST2 using select for update and current of...using cursor.
    I have a code written as follows :
    DECLARE
    v_mydept1 TEST1.DEPT_CD%TYPE;
    v_mydept2 TEST2.DEPT_CD%TYPE;
    CURSOR C1 IS SELECT TEST1.DEPT_CD,TEST2.DEPT_CD FROM TEST1,TEST2 WHERE TEST1.DEPT_CD = TEST2.DEPT_CD AND TEST1.DEPT_CD = 'AA' FOR UPDATE OF TEST1.DEPT_DSCR,TEST2.DEPT_DSCR;
    BEGIN
    OPEN C1;
         LOOP
              FETCH C1 INTO v_mydept1,v_mydept2;
              EXIT WHEN C1%NOTFOUND;
              UPDATE TEST2 SET DEPT_DSCR = 'PLSQL1' WHERE CURRENT OF C1;
              UPDATE TEST2 SET DEPT_DSCR = 'PLSQL2' WHERE CURRENT OF C1;
         END LOOP;
         COMMIT;
    END;
    The above code when run says that it runs successfully. But it does not updates the desired columns[DEPT_DSCR].
    It only works when we want to update single or multiple columns of same table...i.e. by providing these columns after "FOR UPDATE OF"
    I am not sure what is the exact problem when we want to update multiple columns of different tables.
    Can anyone help me on this ?

    oops my mistake.....typo mistake...it should have been as follows --
    UPDATE TEST1 SET DEPT_DSCR = 'PLSQL1' WHERE CURRENT OF C1;
    UPDATE TEST2 SET DEPT_DSCR = 'PLSQL2' WHERE CURRENT OF C1;
    Now here is the upated PL/SQL code where we are trying to update columns of different tables --
    DECLARE
    v_mydept1 TEST1.DEPT_CD%TYPE;
    v_mydept2 TEST2.DEPT_CD%TYPE;
    CURSOR C1 IS SELECT TEST1.DEPT_CD,TEST2.DEPT_CD FROM TEST1,TEST2 WHERE TEST1.DEPT_CD = TEST2.DEPT_CD AND TEST1.DEPT_CD = 'AA' FOR UPDATE OF TEST1.DEPT_DSCR,TEST2.DEPT_DSCR;
    BEGIN
    OPEN C1;
    LOOP
    FETCH C1 INTO v_mydept1,v_mydept2;
    EXIT WHEN C1%NOTFOUND;
    UPDATE TEST1 SET DEPT_DSCR = 'PLSQL1' WHERE CURRENT OF C1;
    UPDATE TEST2 SET DEPT_DSCR = 'PLSQL2' WHERE CURRENT OF C1;
    END LOOP;
    COMMIT;
    END;
    Please let us know why it is not updating by using using CURRENT OF

  • How to display multiple data from different table in one table? please help

    Hi
    I got sun java studio creator 2(the separate installation not the one in the net beans)....
    My question is about displaying data that have been taken from the database.... I know how to display data in a table(just click on the table "bind data" )... but my question is that:
    when i want to use a sql statement that taken the data from different table...
    how can i display that data in the table(that will be shown in the web) ??? when i click bind data on the table i can only select one table i can't select more than one....
    Note:
    1) i'm using the rowset for displaying the data in the table, since the sql statement is depending on a condition(i.e. select a from b where c= ? )...
    2) i mean by different table is that( i.e. select a from table1,table2 )..
    thanks in advance...

    Hi,
    937440 wrote:
    Hi every one, this is my first post in this portal. Welcome to the forum!
    Be sure to read the forum FAQ {message:id=9360002}
    I want display the details of emp table.. for that I am using this SQL statement.
    select * from emp where mgr=nvl(:mgr,mgr);
    when I give the input as 7698 it is displaying the corresponding records... and also when I won't give any input then it is displaying all the records except the mgr with null values.
    1)I want to display all the records when I won't give any input including nulls
    2)I want to display all the records who's mgr is null
    Is there any way to incorporate to include all these in a single query..It's a little unclear what you're asking.
    The following query always includes rows where mgr is NULL, and when the bind variable :mgr is NULL, it displays all rows:
    SELECT  *
    FROM     emp
    WHERE     LNNVL (mgr != :mgr)
    ;That is, when :mgr = 7698, it displays 6 rows, and when :mgr is NULL it displays 14 rows (assuming you're using the Oracle-supplied scott.emp table).
    The following query includes rows where mgr is NULL only when the bind variable :mgr is NULL, in which case it displays all rows:
    SELECT     *
    FROM     emp
    WHERE     :mgr     = mgr
    OR       :mgr       IS NULL
    ;When :mgr = 7698, this displays 5 rows, and when :mgr is NULL it displays 14 rows.
    The following query includes rows where mgr is NULL only when the bind variab;e :mgr is NULL, in which case it displays only the rows where mgr is NULL. That is, it treats NULL as a value:
    SELECT     *
    FROM     emp
    WHERE     DECODE ( mgr
                , :mgr, 'OK'
                )     = 'OK'
    ;When :mgr = 7698, this displays 5 rows, and when :mgr is NULL, it displays 1 row.

  • How to do a SELECT from different tables into an internal table?

    How to do a SELECT from different tables into an internal table?
    I want to select data from MARA, MARC and ZPERSON and populate my ITAB_FINAL
    REPORT  zinternal_table.
    TABLES:
      mara,
      marc,
      zperson.
    TYPES:
    BEGIN OF str_table1,
      v_name LIKE zperson-zname,
      v_matnr LIKE marc-matnr,
      v_emarc LIKE marc-emarc,
      v_werks_d LIKE marc-werks_d,
      v_dstat LIKE marc-dstat,
      END OF str_table,
      i_table1 TYPE STANDARD TABLE OF str_table1.
    DATA:
    BEGIN OF str_table2,
    v_mandt LIKE mara-mandt,
    v_ernam LIKE mara-ernam,
      v_laeda LIKE mara-laeda,
    END OF str_table2,
    itab_final LIKE STANDARD TABLE OF str_table2.

    first find the link between mara , marc and zperson , if u have link to 3 tables then u can jus write a join and populate the table u want ( thats final table with all the fields).
    u defenitely have alink between mara and marc so join them and retrieve all data into one internal table.
    then for all the entries in that internal table retrieve data from zperson into another internal table.
    then loop at one internal table
    read another internal table where key equals in both the tables.
    finally assign fileds if sy-subrc = 0.
    gs_finaltable-matnr = gs_table-matnr
    etc...
    and finally append gs_finaltable to gt_finaltable.
    there u go ur final table has all the data u want.
    regards
    Edited by: BrightSide on Apr 2, 2009 3:49 PM

  • Best practice for deleting multiple rows from a table , using creator

    Hi
    Thank you for reading my post.
    what is best practive for deleting multiple rows from a table using rowSet ?
    for example how i can execute something like
    delete from table1 where field1= ? and field2 =?
    Thank you

    Hi,
    Please go through the AppModel application which is available at: http://developers.sun.com/prodtech/javatools/jscreator/reference/codesamples/sampleapps.html
    The OnePage Table Based example shows exactly how to use deleting multiple rows from a datatable...
    Hope this helps.
    Thanks,
    RK.

  • How to delete multiple rows from ADF table

    How to delete multiple rows from ADF table

    Hi,
    best practices when deleting multiple rows is to do this on the business service, not the view layer for performance reasons. When you selected the rows to delete and press submit, then in a managed bean you access thetable instance (put a reference to a managed bean from the table "binding" property") and call getSeletedRowKeys. In JDeveloper 11g, ADF Faces returns the RowKeySet as a Set of List, where each list conatins the server side row key (e.g. oracle.jbo.Key) if you use ADF BC. Then you create a List (ArrayList) with this keys in it and call a method exposed on the business service (through a method activity in ADF) and pass the list as an argument. On the server side you then access the View Object that holds the data and find the row to delte by the keys in the list
    Example 134 here: http://blogs.oracle.com/smuenchadf/examples/#134 provides you with the code
    Frank

  • Urgent......  how to select few fields, from database table, (dynamic ita.)

    Dear all experts,
    I am able to populate all fields data from database table, using dynamic table creation.
    eg,
    SELECT *    FROM (w_tabname)    INTO    TABLE <t_itab>.
    where w_tabname is the table name given by the user, and t_itab is field symbol.
    but some requirement is like that i need to pick up only few fields, <b>which user will give at the runtime.</b>
    <b>I can</b> take those fields from file into any internal table,
    but the problem is that instead of <b>select *</b>, i need to put selected the fields given by user.
    i have tried with field symbol, it is not working (as per my knowledge.)
    do i need to create any structures dynamically ?
    Can anybody please help in this regards ?
    Your help will be surely rewarded with points.
    Waiting for reply..
    Regards
    Vinay

    Hi Vinay ,
    Adding to the below code , you can use some more fields in the select stmt as below:-
    REPORT ychatest.
    PARAMETERS : p_field1 LIKE dd03l-fieldname,
                             P_field2 LIKE dd03l-fieldname,
                             p_table LIKE dd03l-tabname.
    FIELD-SYMBOLS : <fs> TYPE STANDARD TABLE.
    SELECT (p_field1) (p_field2) ( FROM (p_table) INTO TABLE <fs>.
    Now p_field1 & p_field2  belong to the same table since you have give the user to enter only one table name.
    This should work fine.
    please try & let me know .
    Thanks & Regards,
    Daniel

  • How to store Multiple Ec\xcels into Table Using sql loder

    Plese guide me to store Multiple Ec\xcels into Table Using sql loder

    I am not clear with your question. Do you want to load multipel Excel Files into a table. If so you can follow this link.
    http://www.orafaq.com/wiki/SQL*Loader_FAQ#Can_one_load_data_from_multiple_files.2F_into_multiple_tables_at_once.3F
    Thanks,
    Karthick.

  • How to get multiple records from internal table through BDC

    PERFORM DYNPRO USING:
      'X'  'SAPMM61L'  '0500',
      ' '  'BDC_OKCODE'  '=NEWC',
      'X'  'SAPMM61L'  '0500',
      ' '  'BDC_CURSOR'  'PLPTU-PLWRK(01)',
      ' '  'BDC_OKCODE'  '=TAKE',
      ' '  'PLPTU-PLWRK(01)' '2531'. (2531 is a plant)
    This is the recording used to get plant via BDC of MS31.
    Using this code i can get only single plant...
    If i want to get multiple plants from an internal table,how i can change this code?
    Since it is a recording i cant put this code in LOOP..ENDLOOP.
    Suggest any method for doing this....
    Awaiting for ur reply...

    Hi,
    While recording also record the scroll down button.
    The you can place different plant in the BDC using loop and endloop
    Regards
    Arun

  • How to Select Data from different Tables Using Linq

    Hi,
    I have two different tables, I just want to collect data from tables using Linq to SQL Queries.
    The tables looks like This 
    ID Name ImageUrl 
    Other Table is
    ID EmpID CheckInTime CheckOutTime 
    What I want to Collect data from CheckInTime and want to place it in a that is in a list view
    Same thing I want to do it for CheckOutTime And One thing I want to tell is both tables are joined by a FK EmpID with ID.
    What Are the suggestions for me 
    I have Used this code
    var data = from emp in db.Employees
    join chk in db.CheckInCheckOuts on emp.ID equals chk.EmpID
    select new EmployeeCheckInOut
    Name = emp.Name,
    ImageUrl = emp.ImageUrl,
    CheckIn = emp.CheckInCheckOuts,
    CheckOut = emp.CheckInCheckOuts
    Here the CheckInCheckOuts is another table, I don't how do I access fields of the Other table "CheckInCheckOuts"
    Thank you
    Ali

    Mitja,
    Kind of Tables, I don't Know but I can Tell you that these are Two table, first Table Have Data in It, Name, ImageUrl I have filled this table with names and ImageUrls And are string type.Other Table is for the CheckInTime And CheckOutTime of the employee.
    What I need that when I click on the Image button it Should displays The Current Datetime into the label below the Image button.
    So I have Problem accessing my CheckInCheckOut Table because I may not have Idea about.Did you understand what I need to do, if you have more question please ask to me.
    Thanks
    Ali

  • How to dynamically copy cells from different tables?

    Hi,
    I've created an invoice and have 2 different tables. First is at top with Recipient information, the invoice number, their address, etc. Below that, I have a 2nd table laying out the items they are being charged for.
    I would like to copy the invoice number from the 1st table, to a cell in the 2nd table or a 3rd table I will create later on. I know how to copy cells in 1 table, ie. =D4. But not sure how to target a different table altogether.
    Also, is it possible to copy a cell from 1 table to a text box field?
    Thanks!!

    Yvan's point is true.  Please use the User Guides first; they're actually pretty readable.
    However, there's a very quick & easy way to try it out as well.  Go to the cell where you want your data to end up.  Type "=" (without quotes) to indicate you're going to input a formula of some kind.  Then without clicking inside any tables, use the list of sheets and tables to the left to get to your source table and click on the cell that contains the data you want to copy.  Presto!  Go back to your destination cell, and the formula is now filled in, following the scheme Yvan provided.
    Vince

  • How to read specific fields from BW table  into ABAP?

    Hi Experts,
    Can someone help me how to use to FM: RFC_READ_TABLE to read specific fields from a BW  table '/bic/zcust_chO01' which DOESN't EXIST IN ABAP.
    I am getting an error in OPTIONS & DATA parameters.
    Any help would be higly appreciated with points.
    Thanks
    Dan

    Dan,
    FM: RFC_READ_TABLE is a RF FM so by providing BW system's RF destination you can get the values from required table.
    TRY this:
    CALL FUNCTION RFC_READ_TABLE destination <BW_RF_destination>
    Susanth.

  • How to get multiple rows from database table?

    hello !
    I need to get multiple rows from a OLEDB database table and display them on a table object.
    I did "Wrap in subfrom" on the table,  set  subform of the table to "flowed", and checked "Repeat row for each data item" of Row1 of the table.
    But I can get only one row on the table object.
    I need your help.
    Thanks

    Hi,
    best practices when deleting multiple rows is to do this on the business service, not the view layer for performance reasons. When you selected the rows to delete and press submit, then in a managed bean you access thetable instance (put a reference to a managed bean from the table "binding" property") and call getSeletedRowKeys. In JDeveloper 11g, ADF Faces returns the RowKeySet as a Set of List, where each list conatins the server side row key (e.g. oracle.jbo.Key) if you use ADF BC. Then you create a List (ArrayList) with this keys in it and call a method exposed on the business service (through a method activity in ADF) and pass the list as an argument. On the server side you then access the View Object that holds the data and find the row to delte by the keys in the list
    Example 134 here: http://blogs.oracle.com/smuenchadf/examples/#134 provides you with the code
    Frank

  • How to compare two fields from different list sharepoint designer?

    hi All,
    I need to add a value to a field using SharePoint designer workflow. The value is from another column.
    for example list A has the field has loginID,  and another list B has loginID  amd another column called Desig.
    i need to compare both and get the Desig field and store it to a column. how do i do that in sharePoint Designer workflow.

    Hi, 
    you can create a workflow variable ex.Test. and add an action set Workflow variable. Then you have to set this variable value using lookUps. something like(in look up window)
    Data source: Choose List B
    Field from source: Choose Desig
    Then under find the list item
    Field: Choose login Id
    Value :(Again open lookup window by clicking "fx") and in this window choose 
        data Source: List A
      field from source :LoginId
    and click ok.
    attached is the image for your reference. (I am using other lists,you can change appropriately )

  • Question reg. how to get a field from a table

    What is EIN? (I think it is employer identification number). My functional consultant told me to get this value from company code. Can you tell me from which table and field I can get this value?
    Thanks,
    Krishen

    i think these tables are helpfull
    /SAPPCE/TDPC01
    /BEV1/RBVBAK
    /BEV1/RBVBAP
    VSVBAK_CN
    VSVBAp_CN
    VBAK and VBAP.
    Regards,
    Pradhan.

Maybe you are looking for

  • Accounting document not generating in billing

    Hi, When try to clearing accounting document through VF02 it showing *"check value field assignment for condition FREE" when I am double click this log it showing message Check value field assignment for condition FREE Message no. KE/AD243 Diagnosis

  • Bitlocker TPM + PIN on MS Surface Pro 3 using MDT

    We are new to MDT 2012 and are trying to create a task sequence for Surface Pro 3 Tablets. Everything is going OK apart from Bitlocker. We are required to enable TPM + PIN (yes I've read the articles saying PIN isn't necessary on tablets, but securit

  • Set "peoples or groups" field with current user "login name" in sharepoint list form using javascript

    hi friends i am trying to set peoples or groups field in sharepoint  list form with current user login name here my code <script src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.9.0.js"></script> <script type="text/javascript"> $(document).ready(f

  • Ios7: iphone mailbox problem :  can anyone help ?

    After installing ios7 i have a problem on my iphone 5. I have two mailboxes - the secondary mailbox keeps greying out so that i can't access it .  A reboot or re-inputting the password cures the problem ( for a couple of hours ).  Is there a permanen

  • Adding application to firewall changes md5 sum

    I was playing World of Warcraft and the application stopped connecting to the server. Firefox worked, mail worked, even Ventrilo worked, but the warcraft app would not connect. I figured maybe i needed to add the application to the firewall exclusion