Updating one row of data using CMP

Hi,
How should I update a single row mapped with a CMP persitence, should I write a differetnt method for update , pl clarify in detail.

Hi,
How should I update a single row mapped with a CMP
P persitence, should I write a differetnt method for
update , pl clarify in detail.Hi,
You can just find that particular Row using the findByPrimaryKey method the entity.
This method actually returns the Remote Interface for the Entity which contains taht particular row of record.
Use The setters of the Remote interface to update your existing Row.

Similar Messages

  • Using a ommand to generate more than one row of data in utl file

    Hi Guys
    This might be a pretty long one. But I require help with regards to using outer and inner loops within my code.
    Here is the task:
    Each account involved with the DCA Allocation has an entry in the DCAACCOUNTALLOCATION table to track its progress. The STATUS value of the entry shows the position of the account in the DCA Allocation process.
    The status entry being tested is 3.
    Below is the code:
    create or replace
    PROCEDURE DCA_BMW_OUT
    IS
    -- Declare all variables as reference
    v_out_file UTL_FILE.FILE_TYPE;
    v_row_Count NUMBER;
    r_bmw NUMBER;
    v_out_directory all_directories.directory_path%type;
    v_out_filehandle UTL_FILE.FILE_TYPE := NULL;
    v_out_buffer varchar2 (32767);
    v_records NUMBER;
    body_output varchar2(32759 BYTE);
    dictionary_guarantorsexist varchar2 (1 Char);
    -- Text required within this part of the procedure
    v_body varchar2(32767 BYTE);
    v_header VARCHAR2(32759 BYTE);
    BEGIN
    FOR r_bmw IN
    ( SELECT *
    FROM dcaadditionaldata
    WHERE directory_name IS NOT NULL
    ) LOOP
    BEGIN
    -- Output file to be added into the directory specified
    v_out_file := utl_file.fopen (r_bmw.directory_name, 'DCAExport_1_' || TRIM(TO_CHAR(SYSDATE,'DDMMYYYY_HH24MISS')) || '.txt', 'W');
    -- The Header data which will be outputted to the file
    v_header := 'KennzeichenBrgschaftsforderungGesamtforderung|Währung|Übergabedatum|DifferenzierungAnwalts-oderInkassofall|MainMarktpartnernummer|
    MainAnrede|MainTitel|MainName|MainVorname|MainStraße|MainHausnummer|MainPLZ|MainOrt|MainLand|MainGeburtsdatum|MainTelefonnr.Schuldner|G1Marktpartnernummer
    G1Anrede      G1Titel      G1Name      G1Vorname      G1Straße      G1Hausnummer      G1PLZ      G1Ort      G1Land      G1Geburtsdatum      G1Telefonnr.Schuldner      G2Marktpartnernummer      G2Anrede      G2Titel
    G2Name|G2Vorname|G2Straße|G2Hausnummer|G2PLZ|G2Ort|G2Land|G2Geburtsdatum|G2Telefonnr.Schuldner|G3Marktpartnernummer|G3Anrede|G3Titel|G3Name|G3Vorname|
    G3Straße|G3Hausnummer|G3PLZ|G3Ort|G3Land|G3Geburtsdatum|G3Telefonnr.Schuldner|G4Marktpartnernummer|G4Anrede|G4Titel|G4Name|G4Vorname|G4Straße|G4Hausnummer|
    G4PLZ|G4Ort|G4Land|G4Geburtsdatum|G4Telefonnr Schuldner|G5Marktpartnernummer|G5Anrede|G5Titel|G5Name|G5Vorname|G5Straße|G5Hausnummer|G5PLZ|G5Ort|G5Land|
    G5Geburtsdatum|G5Telefonnr.Schuldner|Kundennr.|Bestandsnr.|Finanzierungsnr.|KennzeichenFinanzierung/Leasing|Kennzeichenprivat/gewerblich|
    reguläresVertragsende|Laufzeit|Vertragsdatum|Vertragsstatus|Ratenbetrag|Filiale/Gebiet|Finanzierungstyp|BankverbindungKonto|BankverbindungBLZ|
    RSVKennzeichen|Kündigungsdatum|Modell|Fahrgestellnummer|KFZKennzeichen|KFZZulassungsdatum|CoD1Marktpartnernummer|CoD1Anrede|CoD1Titel|CoD1Name|
    CoD1Vorname|CoD1Straße|CoD1Hausnummer|CoD1PLZ|CoD1Ort|CoD1Land|CoD1Geburtsdatum|CoD1Telefonnr.Schuldner|CoD2Marktpartnernummer|CoD2Anrede|CoD2Titel|
    CoD2Name|CoD2Vorname|CoD2Straße|CoD2Hausnummer|CoD2PLZ|CoD2Ort|CoD2Land|CoD2Geburtsdatum|CoD2Telefonnr.Schuldner|CoD3Marktpartnernummer|CoD3Anrede|
    CoD3Titel|CoD3Name|CoD3Vorname|CoD3Straße|CoD3Hausnummer|CoD3PLZ|CoD3Ort|CoD3Land|CoD3Geburtsdatum|CoD3Telefonnr.Schuldner|CoD4Marktpartnernummer|
    CoD4Anrede|CoD4Titel|CoD4Name|CoD4Vorname|CoD4Straße|CoD4Hausnummer|CoD4PLZ|CoD4Ort|CoD4Land|CoD4Geburtsdatum|CoD4Telefonnr.Schuldner|
    CoD5Marktpartnernummer|CoD5Anrede|CoD5Titel|CoD5Name|CoD5Vorname|CoD5Straße|CoD5Hausnummer|CoD5PLZ|CoD5Ort|CoD5Land|CoD5Geburtsdatum|
    CoD5Telefonnr.Schuldner Y|Y|5830,99|EUR|20/08/2009|DCA|4|123456|Herr||Mueller|Rainer|Messigasse|33|84432|Filz|Deutschland|01/07/1957|08912345|234567|Frau|Dr|Mueller|Rita|Messigasse|33|84432|Filz|Deutschland|13/12/1955|08912345|||||||||||||||||||||||||||||||||||||||||||||||||76543|5000234567||Lease|Privat|12/12/2013|60|12/12/2008||250,50|US|Rate|1234567890|32343450|N||BMW 320 i|W34567890PA34567|M-H-3456|09/12/2008||||||||||||||||||||||||
    N|450,80|EUR|20/08/2009|DCA|4|987654|Frau||Meier|Heide|Beinstr.|44|86353|Laus|Deutschland|03/06/1949|08987654|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||87654||8765675585|Loan|Gewerblich|14/03/2012|72|14/03/2006||500,01|DF|Select|976579657|32343450|N||BMW 500 sl|W94567890PA34568|M-H-3457|10/03/2006|34343434|Herr|Dipl|Meier|Rudolf|Heislestr.|69|85433|Maus|Deutschland|28/05/1945|08934567|234567|Frau|Dr|Mueller|Rita|Messigasse|33|84432|Filz|Deutschland|13/12/1955|08912345
    Y|33970,50|EUR|20/08/2009|Lawyer|4|64646464|Frau||Schmidt|Susanne|Hueftgasse|55|89363|Maus|Deutschland|23/08/1933|08934567|34343434|Herr|Dipl|Meier|Rudolf|Heislestr.|69|85433|Maus|Deutschland|28/05/1945|08934567|234567|Frau|Dr|Mueller|Rita|Messigasse|33|84432|Filz|Deutschland|13/12/1955|08912345|||||||||||||||||||||||||||||||||||||98757|5000785675||Lease|Privat|11/11/2009|48|11/11/2005||380,70|GH|Zielrate|234567899|32343450|Y||BMW 380 s|W54567890PA34569|M-H-3458|07/11/2005||||||||||||||||||||||||
    N|10040,20|EUR|20/08/2009|Lawyer|4|4865465|Herr||Schulz|Karl|Nasenweg|77|83354|Schuh|Deutschland|18/01/1965|08972545|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||46789|50004765787||Lease|Privat|16/09/2012|60|16/09/2007||1234,56|OS|ZUS|98765432|32343450|Y||BMW 280 i|W74567890PA34570|M-H-3459|12/09/2007||||||||||||||||||||||||';
    utl_file.PUT_LINE(v_out_file,v_header,TRUE);
    -- Below will output a row of data which satisfy the requirements.
    FOR body_output IN
    ( SELECT
    AccountDetails.CUSTOMERNUMBER, AccountDetails.ACCOUNTNUMBER, CUSTOMERDETAILS.CDTITLE, CUSTOMERDETAILS.CDFIRSTNAME, CUSTOMERDETAILS.CDLASTNAME, AccountDetails.ACCOUNTTYPE,
    AccountDetails.ORIGINALCONTRACTENDDATE, AccountDetails.CONTRACTTERM, AccountDetails.CONTRACTENDDATE, AccountDetails.BRANCHAREA, AccountDetails.PRODUCTTYPE,
    AccountDetails.HOUSEBANKACCOUNT, AccountDetails.CARMODEL, AccountDetails.CARLICENCE, AccountDetails.ARREARSBALANCE, AccountDetails.CODEBTOR, AccountDetails.GUARANTORNUMBER
    FROM AccountDetails
    JOIN CUSTOMERDETAILS ON AccountDetails.CUSTOMERNUMBER = CUSTOMERDETAILS.CUSTOMERS1
    WHERE EXISTS
    ( SELECT *
    FROM Dcaaccountallocation
    JOIN DebtEpisodes ON DebtEpisodes.ACCOUNTID = Dcaaccountallocation.ACCOUNTID
    WHERE Dcaaccountallocation.dcaid = 41
    AND Dcaaccountallocation.status = 3
    AND DebtEpisodes.DCASentDate IS NULL
    AND Dcaaccountallocation.ACCOUNTID = AccountDetails.ACCOUNTNUMBER
    AND DebtEpisodes.DCAORLAWYER = 'DCA'
    LOOP
    UTL_FILE.PUT_LINE (v_out_file,
    body_output.CUSTOMERNUMBER|| '|' || body_output.ACCOUNTNUMBER|| '|' ||body_output.CDTITLE|| '||' ||body_output.CDFIRSTNAME || '|||||' ||
    body_output.CDLASTNAME|| '||||' || body_output.ACCOUNTTYPE|| '|' ||body_output.ORIGINALCONTRACTENDDATE|| '||||' ||body_output.CONTRACTTERM || '|||||' ||
    body_output.CONTRACTENDDATE|| '|' || body_output.BRANCHAREA|| '||' ||body_output.PRODUCTTYPE|| '||' ||
    body_output.HOUSEBANKACCOUNT|| '|||' || body_output.CARMODEL|| '||||' ||body_output.CARLICENCE|| '|' ||
    body_output.ARREARSBALANCE|| '||||' || body_output.CODEBTOR|| '|' ||body_output.GUARANTORnumber);
    END LOOP;
    UTL_FILE.fclose (v_out_file);
    EXCEPTION
    WHEN OTHERS THEN
    UTL_FILE.put_line (v_out_file, 'failed');
    -- If any errors occur when closing the file, then we close the opened file.
    IF utl_file.is_open(v_out_file) THEN
    UTL_FILE.fclose (v_out_file);
    END IF;
    END;
    UPDATE DebtEpisodes
    SET handoverdate = null
    WHERE DCAORLAWYER = 'DCA'
    AND accountid IN
    ( SELECT accountid
    FROM Dcaaccountallocation
    WHERE Dcaaccountallocation.status = 3
    AND Dcaaccountallocation.dcaid = 41
    END LOOP;
    END DCA_BMW_OUT;
    Currently, the above codes issue is that although many rows of data have been inputted in all the tables, with regards to the select criteria above (in italics), it only produces one row of data when i expect more than one to appear.
    If the query only outputs one row but you're expecting it to produce more than one row, then you need to dissect the statement to find out where the output is being unduly restricted
    I was told maybe an outerloop or an inner loop would do the trick, but really stuck on how and where to put it.
    Hope this makes sense guys and I would really appreciate your time.
    Thanks

    if i run this particular code
    ( SELECT
    AccountDetails.CUSTOMERNUMBER, AccountDetails.ACCOUNTNUMBER, CUSTOMERDETAILS.CDTITLE, CUSTOMERDETAILS.CDFIRSTNAME, CUSTOMERDETAILS.CDLASTNAME, AccountDetails.ACCOUNTTYPE,
    AccountDetails.ORIGINALCONTRACTENDDATE, AccountDetails.CONTRACTTERM, AccountDetails.CONTRACTENDDATE, AccountDetails.BRANCHAREA, AccountDetails.PRODUCTTYPE,
    AccountDetails.HOUSEBANKACCOUNT, AccountDetails.CARMODEL, AccountDetails.CARLICENCE, AccountDetails.ARREARSBALANCE, AccountDetails.CODEBTOR, AccountDetails.GUARANTORNUMBER
    FROM AccountDetails
    JOIN CUSTOMERDETAILS ON AccountDetails.CUSTOMERNUMBER = CUSTOMERDETAILS.CUSTOMERS1
    WHERE EXISTS
    ( SELECT *
    FROM Dcaaccountallocation
    JOIN DebtEpisodes ON DebtEpisodes.ACCOUNTID = Dcaaccountallocation.ACCOUNTID
    WHERE Dcaaccountallocation.dcaid = 41
    AND Dcaaccountallocation.status = 2
    AND DebtEpisodes.DCASentDate IS NULL
    AND Dcaaccountallocation.ACCOUNTID = AccountDetails.ACCOUNTNUMBER
    AND DebtEpisodes.DCAORLAWYER = 'DCA'
    This returns 1 row of data
    However if i run a small part of the above code...
    SELECT *
    FROM Dcaaccountallocation
    JOIN DebtEpisodes ON DebtEpisodes.ACCOUNTID = Dcaaccountallocation.ACCOUNTID
    WHERE Dcaaccountallocation.dcaid = 41
    AND Dcaaccountallocation.status = 2
    It returns a lot of rows with a status of 2
    Now i presume what I am going to do is to ensure that all the fields provide satisfactory requirements, with regards to the above code. Although I have many records in all the stated tables already.
    :(

  • Update one row at a time, Data Grid

    Is it possible to update one row of a mx:DataGrid at a time.  I want to be able to have a user push a button and info populates one row of the data grid, user changes some properties and pushes the button again and another row of values populate the DataGrid.  Everything I see does a mass population from an XML or what have you.
    Thanks

    I did this this to work, so for those of you who may find this info helpfull here is how I solved the issue.
    I instantiated an ArrayCollection object like so:
    private var _rowValues:ArrayCollection = new ArrayCollection();
    I simply referenced the .addItem() property of my ArrayCollection.
    I then added values to the ArrayCollection as follows
    _rowValues.addItem({Ingredient:ingredient, Amount:amount, Category:category}); //dataField:value
    and referenced the dataField proerpty of the DataGrid... so in my case my 3 dataField properties (in my mxml compontent) were as fillows:
    dataField="Ingredient"
    dataField="Amount"
    dataField="Category"
    all done, and it works.

  • How to update one row in AdvancedDataGrid

    My App have a AdvancedDataGrid and it has so much rows. Some
    data rows for AdvancedDataGrid has changed and i don't want to
    update all rows ... But i don't know how to update one row for my
    AdvancedDataGrid
    Some body help me ...
    Thanks so muchs !

    thanks ntsii.
    my problem is:
    [Bindable]
    var dp:ArrayColection = new ArrayColection({...});
    <mx:AdvancedDataGrid dataProvider="{dp}">
    <mx:groupedColumns>
    </mx:groupedColumns>
    </mx:AdvancedDataGrid>
    //==================================
    in my dp have more rows and some time one of them is changed
    then i guess the AdvancedDataGrid must build all rows when
    it's dataProvider (dp) have changed.
    And i don't want to that...
    But i am not sure the AdvancedDataGrid buld all rows from
    begin to end ... i don't know.. !

  • JTable - trying to delete a row of data using an Abstract TableModel

    Hi Guys,
    I am trying to delete a row of data on a JTable. What I am trying to accomplish is to highlight the row by a mouseclick,
    then from the menu bar I am having the user select a "delete row" option. I am working with an abstract
    Table Model with a deleteRow method. I know I am doing something wrong in this method but I'm not sure what... it is not deleting nor dynamically reflecting the deleted row of data on the JTable gui:
    P.S. I am using a Vector of Vectors to store the data
    Here are snippets of my main class and Abstract Table Model :
    Main Class
    Table definition and mouse listener:
    usermodel = new DataFileTableModel("UserCtl.dat") ;
    userTable = new JTable();
    userTable.setModel(usermodel);
    userTable.createDefaultColumnsFromModel();
    userTable.addMouseListener(new MouseAdapter() {
    public void mouseClicked(MouseEvent evt) {
    upoint = evt.getPoint();
    rowToBeDeleted = userTable.rowAtPoint(upoint);
    Menu Selection which calls the deleteRow Method in the model:
    deleteitem = new JMenuItem("Delete Row",'D');
    editmenu.add(deleteitem) ;
    deleteitem.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    int delresp = JOptionPane.showConfirmDialog(null,"Are you sure you wish to delete this row ?",null, JOptionPane.YES_NO_OPTION) ;
    switch(delresp) {
    case JOptionPane.NO_OPTION:
    return;
    case JOptionPane.YES_OPTION:
    switch (tabnum)
    case 0:
    usermodel.deleteRow(rowToBeDeleted);
    break ;
    Here is my Abstract Table Model... the deleteRow method is at the bottom:
    import javax.swing.*;
    import javax.swing.table.*;
    import javax.swing.event.*;
    import java.io.*;
    import java.util.*;
    public class DataFileTableModel extends AbstractTableModel {
    protected Vector data;
    protected Vector columnNames ;
    protected String datafile;
    public DataFileTableModel(String f){
    datafile = f;
    initVectors();
    public void initVectors() {
    String aLine ;
    data = new Vector();
    columnNames = new Vector();
    try {
    FileInputStream fin = new FileInputStream(datafile);
    BufferedReader br = new BufferedReader(new InputStreamReader(fin));
    // extract column names
    StringTokenizer st1 =
    new StringTokenizer(br.readLine(), "|");
    while(st1.hasMoreTokens())
    columnNames.addElement(st1.nextToken());
    // extract data
    while ((aLine = br.readLine()) != null) {
    StringTokenizer st2 =
    new StringTokenizer(aLine, "|");
    while(st2.hasMoreTokens())
    data.addElement(st2.nextToken());
    br.close();
    catch (Exception e) {
    e.printStackTrace();
    public int getRowCount() {
    return data.size() / getColumnCount();
    public int getColumnCount(){
    return columnNames.size();
    public String getColumnName(int columnIndex) {
    String colName = "";
    if (columnIndex <= getColumnCount())
    colName = (String)columnNames.elementAt(columnIndex);
    return colName;
    public Class getColumnClass(int columnIndex){
    return String.class;
    public boolean isCellEditable(int rowIndex, int columnIndex) {
    return true;
    public Object getValueAt(int rowIndex, int columnIndex) {
    return (String)data.elementAt( (rowIndex * getColumnCount()) + columnIndex);
    public void setValueAt(Object aValue, int rowIndex, int columnIndex) {
    data.setElementAt(aValue, (rowIndex * getColumnCount())+columnIndex) ;
    fireTableCellUpdated(rowIndex, columnIndex);
    public void addRow(Object[] aRow) {
    for (int i=0; i < aRow.length; i++)
    data.add(aRow);
    int size = getRowCount();
    fireTableRowsInserted(size-1,size-1);
    public void deleteRow(int rowNo)
         if (rowNo < 0 || rowNo >= getRowCount())
         return;
         int colCount = getColumnCount();
         int index = colCount * rowNo;
         System.out.println("in deleteRow Row = " + rowNo);
         System.out.println("colCount = " + colCount);
         System.out.println("index = " + index) ;
         for (int d = index; d <= colCount; d++)
         data.remove(d) ;
         fireTableRowsDeleted(rowNo,rowNo) ;

    Hi,
    I can see one obvious problem. Your method to delete contains
    for (int d = index; d <= colCount; d++)
    data.remove(d) ;
    which I think should be
    for (int d = index; d <= colCount; d++)
    data.remove(index) ;
    because every time you remove the value at 'index' it replaces it with the value at 'index+1'.
    I'm not sure that this is the only problem but ...
    Roger

  • Update multiple rows with datas from the same table

    i have a table like
    name version value1 value2
    2 A 4,31 3,5
    3 A 3,45 10
    2 B 6,97 12
    4 B 12 16
    so name + version is unique
    i have to update the datas value1 and value2 ( version A) with the datas from version B where the name ( VersionA) = name version B
    i.e the result should be
    name version value1 value2
    2 A 6,97 12
    3 A 3,45 10
    2 B 6,97 12
    4 B 12 16
    is it possible to do this in sql? ( sql. 8.1)

    ... if your table does not contain exactly what you expect you could get:
    'single row sub-query returns more than one row'
    To prevent that, put a unique index on (name, version). If this combination is not always unique, you will need to cater for the possibility in the update statement.

  • Trouble updating multiple rows in table using subquery

    Hi everyone, I'm having trouble updating multiple rows with a subquery. Here's the setup:
    create table mytable (
    col_a number primary key,
    col_b number,
    col_c number,
    col_d number);
    insert into mytable values (1 ,1,1,15);
    insert into mytable values (2 ,1,2,7 );
    insert into mytable values (3 ,1,3,11);
    insert into mytable values (4 ,1,4,23);
    insert into mytable values (5 ,1,5,14);
    insert into mytable values (6 ,2,1,50);
    insert into mytable values (7 ,2,2,41);
    insert into mytable values (8 ,2,3,13);
    insert into mytable values (9 ,2,4,12);
    insert into mytable values (10,2,5,19);
    insert into mytable values (11,3,1,10);
    insert into mytable values (12,3,2,92);
    insert into mytable values (13,3,3,81);
    insert into mytable values (14,3,4,17);
    insert into mytable values (15,3,5,66);
    insert into mytable values (16,4,1,54);
    insert into mytable values (17,4,2,41);
    insert into mytable values (18,4,3,22);
    insert into mytable values (19,4,4,24);
    insert into mytable values (20,4,5,17);For this example, using an update statement (or merge if that's better), say I want to set the values for col_d where col_b = 3 equal to the values for col_d where col_b = 1 and col_c equal each other. Results should look like the following after the update:
    col_a col_b col_c col_d
    1     1     1     15
    2     1     2     7
    3     1     3     11
    4     1     4     23
    5     1     5     14
    6     2     1     50
    7     2     2     41
    8     2     3     13
    9     2     4     12
    10    2     5     19
    11    3     1     15
    12    3     2     7
    13    3     3     11
    14    3     4     23
    15    3     5     14
    16    4     1     54
    17    4     2     41
    18    4     3     22
    19    4     4     24
    20    4     5     17I can see it right there at my fingertips using this query, where I want to set b_col_d = a_col_d, but I'm missing something, as this query returns too many rows when used in the update statement.
    select * from (
      select col_a as a_col_a, col_b as a_col_b, col_c as a_col_c, col_d as a_col_d
      from mytable
      where col_b = 1
      ) a, (
      select col_a as b_col_a, col_b as b_col_b, col_c as b_col_c, col_d as b_col_d
      from mytable
      where col_b = 3
      ) b
    where a.a_col_c = b.b_col_cupdate mytable set column_d = (select ??? where exists ???)
    Can someone help me get there? I'm using 10GR2.
    Thanks!
    Mark

    Hopefully this is what you are looking for:
    SQL > UPDATE mytable myt1
      2  SET    col_d = ( SELECT myt2.col_d
      3                   FROM   mytable myt2
      4                   WHERE  myt2.col_b = 1
      5                   AND    myt1.col_c = myt2.col_c
      6                 )
      7  WHERE  col_b = 3
      8  AND    EXISTS
      9         ( SELECT NULL
    10           FROM   mytable myt2
    11           WHERE  myt2.col_c = myt1.col_c
    12         )
    13  ;
    5 rows updated.
    SQL > SELECT * FROM mytable ORDER BY col_a;
                   COL_A                COL_B                COL_C                COL_D
                       1                    1                    1                   15
                       2                    1                    2                    7
                       3                    1                    3                   11
                       4                    1                    4                   23
                       5                    1                    5                   14
                       6                    2                    1                   50
                       7                    2                    2                   41
                       8                    2                    3                   13
                       9                    2                    4                   12
                      10                    2                    5                   19
                      11                    3                    1                   15
                      12                    3                    2                    7
                      13                    3                    3                   11
                      14                    3                    4                   23
                      15                    3                    5                   14
                      16                    4                    1                   54
                      17                    4                    2                   41
                      18                    4                    3                   22
                      19                    4                    4                   24
                      20                    4                    5                   17
    20 rows selected.Thank you so much for providing the sample data in an easy to consume form, as well as the expected output.

  • How to write one row of data at a time to "Write to File"

    I am trying to write 10 parameters to the LV "Write to File". This is for just one row at a time. This happens evertime I get a failure in my test routine. I am not quite sure how to accomplish this task. If I get another failure I write one row again. I testing 4 DUTS at a time so I write this row of data to each file. I am sure it is very simple.
    Thanks
    Philip

    Assuming your 10 parameters are an numeric array with 10 elements,  use "write to spreadsheet" file with append set to true. (... and if they are scalars, built the array first ).
    LabVIEW Champion . Do more with less code and in less time .

  • The session getattributes lost one row of data in the html input table

    Deal all,
    I have input three rows of data in a html table. But I found
    the last row will disappear and lost when it return the data to
    backend. I think that maybe caused there is an error checking which
    prompts an error and after that , I change the value of the last(3rd)
    row and try to save it. The last row disappear in the UI and being not
    sent to the back end. Here is my code of the JSP
    RosterCodeSetupCommand rosterCodeSetupCommand =
    (RosterCodeSetupCommand)request.getSession().getAttribute("rosterCodeSetupCommand");
    int cmd = rosterCodeSetupCommand.getCmd();
    int pageNo = rosterCodeSetupCommand.getPageNo();
    EtWorkTime etWorkTime = rosterCodeSetupCommand.getEtWorkTime();
    List policyList = rosterCodeSetupCommand.getPolicyList();
    As you can see, the EtWorkTime is get from the rosterCodeSetupCommand.
    Usually, the rosterCodeSetupCommand will have all the rows in the
    table. But now in EtWorkTime, I found last row data is lost.
    And in the UI, when I press Save, the last row is disappear. So I
    guess the problem is happened in
    request.getSession().getAttribute("rosterCodeSetupCommand"); But I
    can't figure out what can make the last row lost in this sentence.
    Would you mind to give me some hints on what will make this happen and
    I will try to trace the code by myself. Thanks.

    Hi,
    I am not sure are you using spring framework or what. if yes you can populate data in command object in referenceData method of simpleformcontroller and that data will be available to the UI.

  • Update Schedule line Delivery date using Bapi_po_Change

    Hi all,
    I am using Bapi_po_change to Update the Schedule line Delivery date(EKET-EINDT) for the PO based on the Item and the Schedule line.
    I am passing the PO number, Po header, Item structure, Schedule line Structure.
    But the Date is not getting updated in the Eket table.
    Please suggest.

    Hi Sukriti,
    Thanks for the Response, yes i have used the Bapi Transaction Commit Also .
    The point is I am able to Update the Statistical Delivery Date in the Same EKET table using BAPI_PO_Change .I have Checked all the Ways to update the EKET-EINDT(Delivery Date)but no Unable to do it.

  • Problem in Creating new row & inserting data using CreateInsert and Commit

    Hello All,
    I have created a page there are few input text and i want to insert the data into a database table. I have created an Application Module I am using CreateInsert and Commit operation but there is one problem.
    At first it created a row in database after that it is not creating the new row instead it is updating the same row with the new values.
    In bindings of my jspx page I have created two binding for action (1) CreateInsert for the VO of that Application Module (2) Commit operation of that Application Module.
    Here is the code snippet of my application:
    BindingContainer bindings = getBindings();
    OperationBinding operationBinding = bindings.getOperationBinding("CreateInsert");
    Object result = operationBinding.execute();
    *if (!operationBinding.getErrors().isEmpty()) {*
    return null;
    OperationBinding operationBinding1 = bindings.getOperationBinding("Commit");
    Object result1 = operationBinding1.execute();
    *if (!operationBinding1.getErrors().isEmpty()) {*
    return null;
    I have tried using Execute+Commit and Insert+Commit case also in every case it is updating the same row and not inserting a new row.
    Is there anything I am missing?
    Please Help.

    hi user,
    i dono. why are trying with codes. adf provides zero lines codes.
    a wonderful drag and drop functionality provide by the framework.
    while double click the button the codes are  registered in your bean
        public String cb6_action() {
            BindingContainer bindings = getBindings();
            OperationBinding operationBinding = bindings.getOperationBinding("CreateInsert");
            Object result = operationBinding.execute();
            if (!operationBinding.getErrors().isEmpty()) {
                return null;
            return null;
        public String cb8_action() {
            BindingContainer bindings = getBindings();
            OperationBinding operationBinding = bindings.getOperationBinding("Commit");
            Object result = operationBinding.execute();
            if (!operationBinding.getErrors().isEmpty()) {
                return null;
            return null;
        public String cb7_action() {
            BindingContainer bindings = getBindings();
            OperationBinding operationBinding = bindings.getOperationBinding("Delete");
            Object result = operationBinding.execute();
            if (!operationBinding.getErrors().isEmpty()) {
                return null;
            return null;
        public String cb14_action() {
            BindingContainer bindings = getBindings();
            OperationBinding operationBinding =
                bindings.getOperationBinding("Delete4");   // some different here. after deleting usually do commit
            OperationBinding operationBinding1 =  
                bindings.getOperationBinding("Commit");    // so here commit operation.
            Object result = operationBinding.execute();
            Object result1 = operationBinding1.execute();
            if (!operationBinding.getErrors().isEmpty()) {
                return null;
            if (!operationBinding1.getErrors().isEmpty()) {
                //add error handling here
                return null;
            return null;
        }if am not understud correctly. please some more explanation need.

  • Updating one row updates every row in the table

    I'm having a weird problem in which I insert a row into a table, select that row, and update its columns, and all the rows in the table end up with those columns all set to the new value. Like this:
    A B C
    1 4 7
    2 3 8
    9 6 7
    Statement s1 = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
    s1.execute("INSERT INTO table (A) VALUES (5)");
    Statement s2 = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
    RecordSet rs = s2.executeQuery("SELECT * FROM table WHERE A=5");
    if (rs.next()) {
      rs.updateInt("B", 4);
      rs.updateInt("C", 6);
      rs.updateRow();
    A B C
    1 4 6
    2 4 6
    9 4 6
    5 4 6I'm using Mac OS X 10.4.9, OpenBase Solo 10.0.5, and Java 1.5. I hope someone has experienced this before because it has me befuddled.
    Here is the actual code from my program:
    Statement st;
    ResultSet rs;
    st = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
    rs = st.executeQuery("SELECT * FROM characters WHERE UniqueID=\""+uid+"\"");
    if (rs.next()) {
         JOptionPane.showMessageDialog(this, "The Unique ID \""+uid+"\" is already taken by "+com.kreative.mccm.Character.flName(rs)+".", "", JOptionPane.ERROR_MESSAGE);
         return false;
    rs = st.executeQuery("SELECT * FROM characters WHERE CodePoint="+cp);
    if (rs.next()) {
         JOptionPane.showMessageDialog(this, "The code point "+h(cp,4)+" is already taken by "+com.kreative.mccm.Character.flName(rs)+".", "", JOptionPane.ERROR_MESSAGE);
         return false;
    st.close();
    st = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
    st.execute("INSERT INTO characters (UniqueID, CodePoint) VALUES (\""+uid+"\", "+cp+")");
    st.close();
    this.uid = uid;
    this.cp = cp;
    this.ch.setUniqueIDString(uid);
    this.ch.codePoint = cp;
    st = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
    rs = st.executeQuery("SELECT * FROM characters WHERE UniqueID=\""+ch.getUniqueIDString()+"\"");
    if (rs.next()) {
         ch.writeResultSet(rs, false, false); /* (this does the updates) */
         rs.updateRow();
         charSaveChanges.setEnabled(false);
    } else {
         throw new SQLException();
    rs.close();
    st.close();

    OpenBase powers Apple's online store, so I wouldn't think that's the problem. I'm placing all the blame on the JDBC driver.
    Funnily, I started updating ResultSets that way because executing UPDATE statements directly gave me this problem before. Doing it this way made the problem go away, until now.
    I tried replacing the INSERT with two fields with one with all the fields, and now it throws a SQL error that is most definitely bogus:
    java.sql.SQLException: SQL ERROR - [position 569, near '' in ', 0, 0, 0, ''] insert error: comma expected but not found in data.
    SQL: INSERT INTO characters (UniqueID, CodePoint, NameFirst, NameMiddle, NameLast, NameMaiden, NameCommFirst,
    NameCommMiddle, NameCommLast, NameCommFull, Title, Classification, Subclassification, Considerable, SexString,
    TransitionString, GenderString, OrientationString, TitleString, PronounString, SGO, BirthDay, BirthMonth, BirthYear,
    Generation, FirstOfSet, ParentBio, Parent1, Parent2, Parent3, ParentBioType, Parent1Type, Parent2Type, Parent3Type)
    VALUES ('bomb', 123, 'Ziggy', 'Boogy', 'Doog', '', '', '', '', '', '', -1, -1, 1, '', '', '', '', '', '', 0, 0, 0, 0, 0, '', '', '', '', '', 0, 0, 0, 0)Bogus because there are the same number of data items as field names, and position 569 is a comma.
    At this point I have to ask myself why I ever chose OpenBase in the first place. (That's right, I had a RealBasic plugin for it. shudders) I'm sure OpenBase itself is fine, but its JDBC driver is trash. MySQL here I come.
    (Message was edited to prevent looooong horizontal scrolling)

  • How to return the correct row of data using diffferent conditions?

    I am having some problems with an sql query and I hope someone can help please?
    The data I am using is customers with multiple transactions. If a customer contains one transaction where the transaction type = 'W' then I need to set the output value to be transaction.ValueA. If the customer does not contain any transactions where the transaction type is 'W' then I need to set the output value to be
    the most recent transaction.ValueB where transaction.transaction_date <= customer.cust_mod_date.
    Here is an example of the data. For each test customer 10 and 20 I have put a star against the value I want to return
    CUSTOMER_ID CUST_MOD_DATE TX_DATE      TX_TYPE TX_VALUEA TX_VALUEB
    10          15/07/2009 16/07/2009     A     110      95
    10          15/07/2009 14/07/2009     A     100      90(*)          
    10          15/07/2009 13/07/2009     A     90          10
    10          15/07/2009 12/07/2009     A     80          5
    20          15/07/2009 15/07/2009     A     60          10
    20          15/07/2009 14/07/2009     W     50(*)     20
    20          15/07/2009 13/07/2009     A     40          30
    ie
    CREATE TABLE
    TMP_CUSTOMER (CUSTOMER_ID NUMBER, CUST_MOD_DATE DATE);
    insert into tmp_customer
    values(10, to_date('15/07/2009','dd/mm/yyyy'));
    insert into tmp_customer
    values(20, to_date('15/07/2009','dd/mm/yyyy'));
    CREATE TABLE
    TMP_TRANSACTION (TX_ID NUMBER, CUSTOMER_ID NUMBER, TX_DATE DATE, TX_TYPE VARCHAR2(1), TX_VALUEA NUMBER, TX_VALUEB NUMBER);
    INSERT INTO TMP_TRANSACTION
    VALUES (1,10, to_date('16/07/2009','dd/mm/yyyy'),'A',110,95);
    INSERT INTO TMP_TRANSACTION
    VALUES (2,10, to_date('14/07/2009','dd/mm/yyyy'),'A',100,90);
    INSERT INTO TMP_TRANSACTION
    VALUES (3,10, to_date('13/07/2009','dd/mm/yyyy'),'A',90,10);
    INSERT INTO TMP_TRANSACTION
    VALUES (4,10, to_date('12/07/2009','dd/mm/yyyy'),'A',80,5);
    INSERT INTO TMP_TRANSACTION
    VALUES (5,20, to_date('15/07/2009','dd/mm/yyyy'),'A',60,10);
    INSERT INTO TMP_TRANSACTION
    VALUES (6,20, to_date('14/07/2009','dd/mm/yyyy'),'W',50,20);
    INSERT INTO TMP_TRANSACTION
    VALUES (7,20, to_date('13/07/2009','dd/mm/yyyy'),'A',40,30);
    The query I have so far is
    (SELECT CUSTOMER_ID, CUST_MOD_DATE, TX_DATE, TYPE_FLAG, TX_VALUEA, TX_VALUEB, RN
    FROM (SELECT CUST.CUSTOMER_ID, CUST.CUST_MOD_DATE,TRANS.TX_DATE, TRANS.TYPE_FLAG, TRANS.TX_VALUEA,TRANS.TX_VALUEB,
    ROW_NUMBER() OVER (partition BY TRANS.CUSTOMER_ID ORDER BY TRANS.TX_DATE DESC) RN
    FROM TMP_CUSTOMER CUST,
    --- Return all transactions creating a type_flag field where Y = type W, else N ---
    SELECT CUST.CUSTOMER_ID, TX.TX_DATE, TX.TX_VALUEA, TX.TX_VALUEB, CUST.CUST_MOD_DATE, TX.TX_TYPE,
    CASE WHEN NVL(TX.TX_TYPE,'0') <> 'W' THEN 'N'
    WHEN NVL(TX.TX_TYPE,'0') = 'W' THEN 'Y'
    ELSE 'N'
    END AS TYPE_FLAG
    FROM TMP_TRANSACTION TX, TMP_CUSTOMER CUST
    WHERE TX.CUSTOMER_ID = CUST.CUSTOMER_ID
    AND CUST.CUSTOMER_ID in
    '10','20'
    ) TRANS
    WHERE CUST.CUSTOMER_ID = TRANS.CUSTOMER_ID
    --AND   TRANS.TX_DATE <= CUST.CUST_MOD_DATE
    AND CUST.CUSTOMER_ID in
    ('10','20'
    Can anyone please help with how I extract the record I am looking for
    ie customer 10 has amount 90
    customer 20 has amount 50.
    Thanks :-)
    GB

    SQL> select c_id
      2  ,      cust_mod_date
      3  ,      tx_date
      4  ,      tx_type
      5  ,      tx_valuea
      6  ,      tx_valueb
      7  from ( select c.customer_id c_id
      8         ,      c.cust_mod_date
      9         ,      t.tx_date
    10         ,      t.tx_type
    11         ,      t.tx_valuea
    12         ,      t.tx_valueb
    13         ,      row_number() over (partition by c.customer_id order by t.customer_id, t.tx_date desc) rn
    14         from   tmp_customer c
    15         ,      tmp_transaction t
    16         where  t.customer_id = c.customer_id     
    17         and    t.tx_date <= c.cust_mod_date
    18       )
    19  where case
    20          when tx_type = 'W' then 1
    21          when rn = 1
    22          and  not exists ( select null
    23                            from   tmp_transaction t2
    24                            where  t2.customer_id = c_id
    25                            and    t2.tx_type = 'W'
    26                          )
    27          then 1
    28        end = 1;
          C_ID CUST_MOD_ TX_DATE   T  TX_VALUEA  TX_VALUEB
            10 15-JUL-09 14-JUL-09 A        100         90
            20 15-JUL-09 14-JUL-09 W         50         20
    2 rows selected.

  • Update multiple rows in table using ODataModel.

    I have tied ODataModel with table using "TwoWay" binding. I need to allow user to edit the rows of the table at the bottom of which I have 'Save' button. Currently though the table is editable I am unable to edit the entries in multiple rows of the table.
    Please find my code below:
    var oTable = new sap.ui.table.Table("dprTable",{
      visibleRowCount: 4,
      visible: true,
      navigationMode: sap.ui.table.NavigationMode.Paginator
      var oColumn = new sap.ui.table.Column({
      label: new sap.ui.commons.Label({text: "DBR/DPR"}),
      template: new sap.m.Link({
      "target": "_blank",
      press:[controller.onClickDemoNo,controller]
      }).bindProperty("text","DemoId"),
      width: "auto",
      tooltip: "DBR/DPR"
      oTable.addColumn(oColumn);
      oTable.addColumn(new sap.ui.table.Column({
      label: new sap.ui.commons.Label({text: "Description"}),
      template: new sap.ui.commons.TextView().bindProperty("text", "DemoDesc"),
      width: "auto",
      tooltip: "Description"
      oTable.addColumn(new sap.ui.table.Column({
      label: new sap.ui.commons.Label({text: "Required Date"}),
      template: new sap.ui.commons.DatePicker("",{
      value:{
      path:"ReqDate",
      type: new sap.ui.model.type.Date({pattern: "dd-MM-yyyy"})
      change: function(){
      console.log('the date is changed and it\'s value is'+value);
      width: "auto",
      tooltip: "Required Date"
      oTable.addColumn(new sap.ui.table.Column({
      label: new sap.ui.commons.Label({text: "Requestor"}),
      template: new sap.ui.commons.TextView().bindProperty("text", "RequestorName"),
      width: "auto",
      tooltip: "Requestor"
      oTable.addColumn(new sap.ui.table.Column({
      label: new sap.ui.commons.Label({text: "Requestor/Project Lead"}),
      template: new sap.ui.commons.TextView().bindProperty("text", "LeadName"),
      width: "auto",
      tooltip: "Requestor/Project Lead"
      oTable.addColumn(new sap.ui.table.Column({
      label: new sap.ui.commons.Label({text: "Solution"}),
      template: new sap.ui.commons.TextView().bindProperty("text", "SolutionText"),
      width: "auto",
      tooltip: "Solution"
      oTable.addColumn(new sap.ui.table.Column({
      label: new sap.ui.commons.Label({text: "Start Date"}),
      template: new sap.ui.commons.DatePicker("",{
      value:{
      path:"StartDate",
      type: new sap.ui.model.type.Date({pattern: "dd-MM-yyyy"})
      width: "auto",
      tooltip: "Start Date"
      oTable.addColumn(new sap.ui.table.Column({
      label: new sap.ui.commons.Label({text: "End Date"}),
      template: new sap.ui.commons.DatePicker("",{
      value:{
      path:"StartDate",
      type: new sap.ui.model.type.Date({pattern: "dd-MM-yyyy"})
      width: "auto",
      tooltip: "End Date"
      oTable.addColumn(new sap.ui.table.Column({
      label: new sap.ui.commons.Label({text: "Estimated Duration"}),
      template: new sap.ui.commons.TextView().bindProperty("text", "EstDuration"),
      width: "auto",
      tooltip: "Estimated Duration"
      oTable.addColumn(new sap.ui.table.Column({
      label: new sap.ui.commons.Label({text: "Hours"}),
      template: new sap.m.Input("",{}).bindProperty("value", "ActDuration"),
      width: "auto",
      tooltip: "Hours"
      oTable.addColumn(new sap.ui.table.Column({
      label: new sap.ui.commons.Label({text: "Status"}),
      template: new sap.ui.commons.ComboBox({items: [
      new sap.ui.core.ListItem({text: "New",key:"1"}),
      new sap.ui.core.ListItem({text: "In Process",key:"2"}),
      new sap.ui.core.ListItem({text: "Completed",key:"3"})
      ]}).bindProperty("value","StatusText"),
      width: "auto",
      tooltip: "Status"
      oTable.setBusyIndicatorDelay(1);
      //oData service call
      var oModel = new sap.ui.model.odata.ODataModel("/sap/opu/odata/sap/ZSECENTRAL_SRV",true);
      oModel.setDefaultBindingMode("TwoWay");
      oModel.attachRequestSent(function (oEvent) {
      console.log('request sent');
      oTable.setBusy(true);
      oModel.attachRequestCompleted(function () {
      console.log('request completed');
      oTable.setBusy(false);
      });os
      oModel.attachRequestFailed(function () {
      oTable.setBusy(false);
      oTable.setModel(oModel);
      oTable.bindRows("/DEOPENDBRSet");
    Is there something pending in the settings? And to update the multiple records in the table do I have to make use of some batch operations? Any help would be appreciated.
    Thanks,
    Supriya Kale

    Hi Supriya,
    your code is missing call of oModel.submitChanges() when Save button is called.
    You can find the example here SAPUI5 SDK - Demo Kit
    Regards,
    Peter

  • Issue in update of PA & PD data using same form scenario

    Hi All,
         We're in the process of implementing HCM PF.  As per the requirement the form should be able to change PA, PSA, EG, ESG and Job of a position on PD & PA(of corresponding pernr) side.  The process is started as a PA form (selection by pernr). 
         I'm able to change the PA, PSA, EG, ESG of the position attribute but whenever I change the Job it gets updated on the PD side but not the PA side (it still holds the previous job prior to effective date).
         In my form scenario I have one PA & one PD service.
         Any help will be appreciated and rewarded in resolving this issue.
    Thanks,
    Mani.
    Edited by: mramamoorthy on Mar 14, 2011 7:01 PM

    Hi,
    Please check ur ISR Scenario,:
    Goto-> Process Form Scenario for Personnel Admin. Infotypes (Service SAP_PA):
    Define Operations:
    0001->M change
    Define Assignment of Fields:
    Field Name     Number     Infotype     Subtype     Screen Structure                       Field Name     Data Index
    Job     1     0001     1     HCMT_BSP_PA_XX_R0001     Job     1
    and do Synchronizing Form Fields.
    Then Do->Check Consistency of Form Scenarios in IMG activity.
    If you get green light then all configuration are correctly update.
    Otherwise problem in configuration side.
    Thanks

Maybe you are looking for

  • Apple remote not working

    My Apple remote is not working with my MacBook. The Mac OS X 10.5 Help Knowledge Base says to go to Security > Systems > and Disable remote control infrared receiver. I don't have a systems button or box nor the checkbox to Disable remote control inf

  • Create entry for table FILENAMECI

    Hi, I want to create physical file path for my logical file in table FILENAMECI. The problem is this table allows maintenance with restriction the I cannot maintain through SE16 or SM30 (for V_FileName). Please let me know how can I create new entry

  • Run script failed when compile for device

    Hello, I run a perl script at build time, in order to insert svn revision of my code into info.plist (CFBundleVersion) It is working except when I build for the device. I got a codesign error. myApp.app: object file format invalid or unsuitable Do yo

  • Will not sync photos

    Hi, I can not sync photos beyond a few, error message says insufficient memory but there is >12G memory for<1G photos

  • Numbers '08 - Why can't I put a formula in the header row? i.e. in cell H1  =SUM(H2:H46)

    When I try to add the SUM formula to H1 and press ENTER, the formula automatically moves to every cell within column H and disappears from H1. If I instead press the Function icon then SUM, while in the H1 cell, the formula automatically moves to the