Cant update Multiple Rows of a table display from DB

Problem encounter is that only 1st row of table can be updated
the rest of it cant seem to be updated
anyone of ya know the problem pls mail me the ans. for this
thks alot
<%@ page import = "java.sql.*" %>
<%@ page import = "java.util.*"%>
<%
String url= "jdbc:odbc:msaccess";
     String id = "iastudent";
     String pass = "iastudent";
     Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
     Connection conn = DriverManager.getConnection(url, id, pass);
     Statement stmt = conn.createStatement();
Enumeration parameters= request.getParameterNames();
while(parameters.hasMoreElements()){
String Type = request.getParameter("a");
String Price = request.getParameter("b");
String Col = request.getParameter("col");
int T = Integer.parseInt(request.getParameter("t"));
try{ 
String Mod="UPDATE PCLOGIC "+
"SET F6 = '"+Type+"', "+
" F7 = '"+Price+"' "+
"WHERE F2 = '"+Col+"' ";
stmt.executeUpdate(Mod);
if(request.getParameter("a")!= null && request.getParameter("b")!= null){
pageContext.forward("LogicPC10.jsp");}
stmt.close();
conn.close();
catch (ArithmeticException e){
out.println("error msg:");%><BR><%     
out.println(e.getMessage());%><BR><%
%>

Enumeration parameters= request.getParameterNames();
while(parameters.hasMoreElements()){
String Type = request.getParameter("a");
String Price = request.getParameter("b");
String Col = request.getParameter("col");
int T = Integer.parseInt(request.getParameter("t"));What he means is to use an array to store the values of your params.
eg,
String[] params = request.getParameterValues();
for(int i=0;i< params.length;i++)
// insert into DB
}

Similar Messages

  • Updating multiple rows in a table in ADF

    Hi
    How do we update multiple rows in a table.
    Onclicking a update button the changed rows must be updated.

    Hi Prince,
    currently I am selecting one row from the table and rendering a region at the top of the table and capturing the user entered data with the following code:
    ViewObjectVOImpl vo = getViewObjectVO1();
    Row CurrentRow = vo.getCurrentRow();
    //After this I perform the checks like user entered value is not null or check input as per business logic.
    if(CurrentRow.getAttribute("attributeName") ==null){
    //Add what message you want to display
    //Add other business logic.
    After making all the checks, i commit it.
    getOADBTransaction().commit();
    Now in my new page I am capturing the user input in the table itself like an excel sheet. Suppose there are ten rows in my advanced table on my page, and each row has one editable field. I have one save button at the bottom of the table.
    Now on clicking the save button I have to capture the user input, check whether there is any null value and if all the entered data is correct then only I should commit it.
    Can you please let me know how we can accomplish that.
    Regards
    Hawker

  • URGENT:Update multiple rows of a table as a transaction

    Hi,
    I am trying to update mutliple rows in one table as a transaction, but only update on the last row is commited to database. Updates on the previous rows is not committed.
    I must be missing some thing which is obvious. Has any got a clueeeeeeeeeee?
    code:
    for (int i = 0; i < selectedFaultNumbers.length; i++) {
    String nationalFaultNumber = selectedFaultNumbers;
    String fault = nationalFaultNumber.substring(0,13);
    national_faultsRowSet2.setCommand("SELECT national_faults.national_fault_number, national_faults.status_id, national_faults.master_fault_number FROM national_faults WHERE national_faults.national_fault_number= '"+fault+"'");
    national_faultsRowSet2.execute();
    if (national_faultsRowSet2.next()) {
    national_faultsRowSet2.updateInt("status_id", FAULT_STATUS_ASSOCIATED);
    national_faultsRowSet2.updateString("master_fault_number",nationalfltno);
    national_faultsRowSet2.updateRow();
    national_faultsRowSet2.execute();
    Any help wil be GREATLY appreciated.
    Cheers
    kush

    Hi Giri,
    Thanks for getting back to me.
    If I understood correct, sample example updates a rowset which is bound to datatable and changes are committed to database using datatablemodel.
    In my case rowset is not bound to a datatable and user is not updating the rowset.
    PageBean has to update few rows in a table when a new row is inserted in to that table.
    Please correct me if I got it wrong. Is there any other solution ???
    Thanks very much
    kush

  • Updating multiple rows of a table at once

    Hi All,
    I am writing a stored procedure which fills out all columns in a table, say Table A with one query except for one column, say column 'ABC' in that table. I have to load this left out column using a different query that is referring to some other tables. How can I update this column 'ABC' with all its rows of data coming from a different query?
    Many Thanks!!

    If you post an update with a create table and insert statements it would help... I think you want to update a table with a select from another table using a join... is that correct?
    update customer c
    set customer_name = (
    select customer_name
    from another_customer_table a
    where a.customer_id = c.customer_id_from_original_customer_table
    where c.customer_id in(select customer_id from another_customer_table)
    The where clause is only needed if you don't want to update missing customer_ids to null.

  • Update Multiple Rows in same table after Update using Trigger

    If i update ACK or ReJ column it should update all the other columns with the same GlobalID.
    create table t_emp(
    empid varchar2(10) not null,
    empname varchar2(50),
    Dep varchar2(50),
    ACk number(5),
    REJ number(5),
    globalID varchar2(10) default '0' );
    insert into t_emp t values ( 'TM01' , 'Logu','Java',null,null,'01');
    insert into t_emp t values ( 'BT01' , 'Logu','Java' ,null,null,'01');
    insert into t_emp t values ( 'Oracle01' , 'Logu','DBA' ,null,null,'01');
    insert into t_emp t values ( 'Google01' , 'Logu','Design' ,null,null,'0');
    insert into t_emp t values ( 'AR02' , 'Uthaya','CRM' ,null,null,'02');
    insert into t_emp t values ( 'RIL02' , 'Uthaya','Java' ,null,null,'02');
    insert into t_emp t values ( 'EA02' , 'Uthaya','DBA' ,null,null,'02');
    insert into t_emp t values ( 'TCS02' , 'Uthaya','Java' ,null,null,null);
    insert into t_emp t values ( 'P05' , 'Krish','.Net' ,null,null,'05');
    insert into t_emp t values ( 'TCS06' , 'Krish','.Net' ,null,null,'06');
    insert into t_emp t values ( 'IBM06' , 'Krish','.Net' ,null,null,'06');
    CREATE OR REPLACE TRIGGER t_emp_update
    AFTER UPDATE
    ON t_emp
    FOR EACH ROW
    DECLARE
    t_Ack varchar2(15);
    t_Rej varchar2(15);
    t_globalID varchar2(10);
    t_empid varchar2(10);
    BEGIN
    t_globalID := :new.globalID;
    t_Ack := :new.ACk;
    t_Rej := :new.REJ;
    t_empid := :new.empid;
    IF t_Ack is not null then
    DBMS_OUTPUT.PUT_LINE('t_Ack := ' || t_Ack || ', t_globalID := '|| t_globalID ||', t_empid := '||t_empid);
    update t_emp set ACk = t_Ack where globalID = t_globalID and empid != t_empid;
    end if;
    IF t_Rej is not null then
    DBMS_OUTPUT.PUT_LINE('t_REJ := ' || t_Rej || ', t_globalID := '|| t_globalID ||', t_empid := '||t_empid);
    update t_emp set Rej = t_Rej where globalID = t_globalID and empid != t_empid;
    end if;
    END;
    update t_emp v set Rej = 1 where empid = 'TCS06';
    If i Update empid = 'TCS06' it should Update Internally all rows with same globalID (06).
    select * from t_emp order by empname,globalID;
    I am getting some errors in this trigger .
    ORA-04091: table TEST1.T_EMP is mutating, trigger/function may not see it
    ORA-06512: at "TEST1.T_EMP_UPDATE", line 17
    ORA-04088: error during execution of trigger 'TEST1.T_EMP_UPDATE'
    I am using ORACLE 10G
    Kindly Help me ...

    Avoiding Mutating Tables
    http://asktom.oracle.com/pls/asktom/ASKTOM.download_file?p_file=6551198119097816936

  • Update multiple row for different values

    hi,
    Please provide me the sql query to update multiple row in a table with different values.
    i need to change the old date to new date
    we have only 3 column id,name,old date.now i need to update the old date to new date
    ID name old date new date
    1 A 2012-12-20 12/7/2012
    2 B 2012-12-20 12/9/2012
    3 c 2012-12-20 12/5/2012
    thank you.

    Here are two ways to do this. Thanks to ranit for the table creation script, which I adapted.create table test_x
    as
    select 1 id, 'A' name, to_date('2012-12-20','yyyy-mm-dd') old_date
    from dual UNION ALL
    select 2 id, 'B' name, to_date('2012-12-20','yyyy-mm-dd') old_date
    from dual UNION ALL
    SELECT 3 ID, 'C' NAME, TO_DATE('2012-12-20','yyyy-mm-dd') OLD_DATE
    from dual;First method using MERGE:MERGE INTO TEST_X O
    USING (
      select 1 id, to_date('12/7/2012','mm/dd/yyyy') new_date
      from dual UNION ALL
      select 2 id, to_date('12/9/2012','mm/dd/yyyy') new_date
      from dual UNION ALL
      SELECT 3 ID, TO_DATE('12/5/2012','mm/dd/yyyy') NEW_DATE
      FROM DUAL
    ) n
    ON (O.ID = N.ID)
    WHEN MATCHED THEN UPDATE SET OLD_DATE = n.NEW_DATE;Second method using UPDATE:UPDATE TEST_X SET OLD_DATE =
      CASE WHEN ID = 1 THEN TO_DATE('12/7/2012','mm/dd/yyyy')
           WHEN ID = 2 THEN TO_DATE('12/9/2012','mm/dd/yyyy')
           WHEN ID = 3 THEN TO_DATE('12/5/2012','mm/dd/yyyy')
      END
    where id between 1 and 3;
    You probably don't want to use these methods.*
    You say the "user" will enter these values. Will he always enter exactly 3 values?
    The "user" will enter values into a screen I suppose. What language is the user interface programmed in?

  • Updating multiples rows in a trigger

    Hello All,
    I need to update multiple rows in a table based on some condition, do you have any ideas doing it?
    I know we can update single row using :NEW, but this time we need to update like 10 rows in a table.
    Thanks in advance for your reply.
    With Regards,
    SK
    CREATE OR REPLACE TRIGGER stsc.dfutoskuallocfactor_trig
    BEFORE UPDATE
    ON stsc.dfutosku
    FOR EACH ROW
    DECLARE
    v_dmdunit CHAR (30);
    v_dmdgroup CHAR (30);
    v_loc CHAR (30);
    BEGIN
    --dfutosku
    INSERT INTO igpmgr.dfutosku_upd_rec
    VALUES (:OLD.dmdunit, :OLD.dmdgroup, :OLD.dfuloc);
    --FOR rec IN (SELECT DISTINCT dmdunit, dmdgroup, dfuloc, eff, disc
    -- FROM stsc.dfutosku_upd_rec)
    --LOOP
    -- IF (rec.eff <> '01-Jan-1970' OR rec.eff >= SYSDATE)
    -- THEN
    -- DBMS_OUTPUT.put_line ('STAGE3 ' || ' ' || rec.eff);
    v_dmdunit := 'PLY 4-000';
    v_dmdgroup := 'TRD';
    v_loc := '48441';
    IF (v_dmdunit = 'PLY 4-000' AND v_dmdgroup = 'TRD' AND v_loc = '48441')
    THEN
    :NEW.udc_error := 1;
    END IF;
    --igpmgr.
    pkg_updateAllocfactor.allocfactor_update(o_return_code OUT NOCOPY PLS_INTEGER);
    --END IF;
    -- END LOOP;
    END;
    /

    also posted in
    {thread:id=1773210}
    Updating multiple rows of the same table in a trigger

  • Update row in a table based on join on multiple rows in another table

    I am using SQL Server 2005. I have the following update query which is not working as desired.
    UPDATE DocPlant
    SET DocHistory = DocHistory + CONVERT(VARCHAR(20), PA.ActionDate, 100) + ' - ' + PA.ActionLog + '. '
    FROM PlantDoc PD INNER JOIN PlantAction PA on PD.DocID = PA.DocID AND PD.PlantID = PA.PlantID 
    For each DocID and PlantID in PlantDoc table there are multiple rows in PlantAction table. I would like to concatenate ActionDate and ActionLog information into DocHistory column of DocPlant table. But the above update query is considering only one row from
    PlantAction table even though there are multiple rows that match with DocID and PlantID.
    DocHistory column is of type NVARCHAR(MAX).
    How do I fix my query to achieve what I want ? Thanks for the help.

    UPDATE DocPlant
    SET DocHistory = DocHistory + CONVERT(VARCHAR(20), PA.ActionDate, 100) + ' - ' + PA.ActionLog + '. '
    FROM PlantDoc PD INNER JOIN PlantAction PA on PD.DocID = PA.DocID AND PD.PlantID = PA.PlantID 
    We do not use the old Sybase UPDATE..FROM.. syntax. Google it and learn how it does not work. We do not use the old Sybase CONVERT() string function. You are still writing 1950's COBOL with string dates instead of temeproal data types. 
    You also did not post DDL, so we have to guess about everything. Does your boss make you work without DDL? How do you do it? 
    >> For each DocID and PlantID in PlantDoc table there are multiple rows in PlantAction [singular name?] table. I would like to concatenate ActionDate and ActionLog information into DocHistory column of DocPlant table. <<
    Why? What does this new data element mean? This is like dividing Thursday by Red and expecting a reasonable answer. Now, non-SQL programmers who are still writing COBOL will violate the tiered architecture rule about doing display formatting in the database.
    If you will follow forum rules, we can help you. 
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • Update multiple rows in a dynamic table Dreamweaver CS5.5

    hello there
    i want to update multiple rows which comes from a dynamic table in Dreamweaver CS5 (a loop in php) here is my Mysql table :
    sql code
    CREATE TABLE `register`.`s_lessons` (
    `lid` int( 5 ) NOT NULL ,
    `sid` int( 9 ) NOT NULL ,
    `term` int( 5 ) NOT NULL ,
    `tid` int( 5 ) NOT NULL ,
    `point` double NOT NULL DEFAULT '0',
    PRIMARY KEY ( `lid` , `sid` , `term` ) ,
    KEY `tid` ( `tid` ) ,
    KEY `point` ( `point` )
    ) ENGINE = MYISAM DEFAULT CHARSET = utf8 COLLATE = utf8_persian_ci;
    and this is my page source code:
    php file
    <?php require_once('../Connections/register.php'); ?>
    <?php
    session_start();
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;   
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      return $theValue;
    $colname1_rs1 = "-1";
    if (isset($_GET['term'])) {
      $colname1_rs1 = $_GET['term'];
    $colname_rs1 = "-1";
    if (isset($_GET['lid'])) {
      $colname_rs1 = $_GET['lid'];
    $colname2_rs1 = "-1";
    if (isset($_SESSION['tid'])) {
      $colname2_rs1 = $_SESSION['tid'];
    mysql_select_db($database_register, $register);
    $query_rs1 = sprintf("SELECT s_lessons.sid, s_lessons.lid, s_lessons.term, s_lessons.tid, s_lessons.point FROM s_lessons WHERE s_lessons.lid = %s AND s_lessons.term = %s AND s_lessons.tid  = %s", GetSQLValueString($colname_rs1, "int"),GetSQLValueString($colname1_rs1, "int"),GetSQLValueString($colname2_rs1, "int"));
    $rs1 = mysql_query($query_rs1, $register) or die(mysql_error());
    $row_rs1 = mysql_fetch_assoc($rs1);
    $totalRows_rs1 = mysql_num_rows($rs1);
    $count=mysql_num_rows($rs1);
    $editFormAction = $_SERVER['PHP_SELF'];
    if (isset($_SERVER['QUERY_STRING'])) {
      $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
    for ($j = 0, $len = count($_POST['lid']); $j < $len; $j++) {
    if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) {
      $updateSQL = sprintf("UPDATE s_lessons SET point=%s WHERE tid=%s, lid=%s, sid=%s, term=%s",
                           GetSQLValueString($_POST['point'] [$j], "double"),
                                GetSQLValueString($_SESSION['tid'], "int"),
                           GetSQLValueString($_POST['lid'] [$j], "int"),
                                GetSQLValueString($_POST['sid'] [$j], "int"),
                                GetSQLValueString($_POST['term'] [$j], "int"));
      mysql_select_db($database_register, $register);
      $Result1 = mysql_query($updateSQL, $register) or die(mysql_error());
      $updateGoTo = "student_lists.php";
      if (isset($_SERVER['QUERY_STRING'])) {
        $updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";
        $updateGoTo .= $_SERVER['QUERY_STRING'];
      header(sprintf("Location: %s", $updateGoTo));
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta name="keywords" content="" />
    <meta name="description" content="" />
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <title>r</title>
    <link href="styles/style.css" rel="stylesheet" type="text/css" media="screen" />
    <link href="styles/in_styles.css" rel="stylesheet" type="text/css" media="screen" />
    </head>
    <body>
    <div id="wrapper">
         <div id="header-wrapper">
         </div>
         <!-- end #header -->
         <div id="page">
              <div id="page-bgtop">
                   <div id="page-bgbtm">
                        <div id="content">
                             <div class="post">
                               <div style="clear: both;">
                            <form name="form1" id="form1" method="post" action="<?php echo $editFormAction; ?>">
                            <table border="1" align="center">
                              <tr>
                                <th>Student ID</th>
                                <th>Lesson ID</th>
                                <th>Semester</th>
                                <th>Point</th>
                              </tr>
                              <?php do { ?>
                                <tr>
                                  <td class="data"><label for="sid[]"></label>
                                  <input name="sid[]" type="text" id="sid[]" value="<?php echo $row_rs1['sid']; ?>" size="9" readonly="readonly" /></td>
                                  <td class="data"><label for="lid[]"></label>
                                  <input name="lid[]" type="text" id="lid[]" value="<?php echo $row_rs1['lid']; ?>" size="5" readonly="readonly" /></td>
                                  <td class="data"><label for="term[]"></label>
                                  <input name="term[]" type="text" id="term[]" value="<?php echo $row_rs1['term']; ?>" size="4" readonly="readonly" /></td>
                                  <td><label for="point[]"></label>
                                    <input name="point[]" type="text" id="point[]" value="<?php echo $row_rs1['point']; ?>" size="4" />                             
                              </tr>
                                <?php } while ($row_rs1 = mysql_fetch_assoc($rs1)); ?>
                            </table>
                            <p>
                              <input type="submit" name="Submit" id="Submit" value="Submit" />
                              <input type="hidden" name="MM_update" value="form1" />
                            </p>
                            </form>
                               </div>
                             </div>
                        <div style="clear: both;">
                    </div>
                        </div>
                        <!-- end #content -->
                        <!-- end #sidebar -->
                        <div style="clear: both;"> </div>
                   </div>
              </div>
         </div>
         <!-- end #page -->
    </div>
    <!-- end #footer -->
    </body>
    </html>
    <?php
    mysql_free_result($rs1);
    ?>
    All i want is that when users click on SUBMIT button values of point column in s_lessons(database table) be updated by new entries from user.
    i did my best and result with that code is :
    You  have an error in your SQL syntax; check the manual that corresponds to  your MySQL server version for the right syntax to use near ' lid=888,  sid=860935422, term=902' at line 1
    I would appreciate any idea.
    with prior thanks

    Go to the Row Properties, and in the Visibility tab, you have "Show or hide based on an expression". You can use this to write an expression that resolves to true if the row should be hidden, false otherwise.
    Additionally, in the Matrix properties you should take a look at the filters section, perhaps you can achieve what you wish to achieve through there by removing the unnecessary rows instead of just hiding them.
    It's only so much I can help you with the limited information. If you require further help, please provide us with more information such as what data are you displaying, what's the criteria to hiding rows, etc...
    Regards
    Andrew Borg Cardona

  • 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

  • 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 update multiple rows in one query using php

    i am new to this can any one help me how to update multiple rows at a time i am doing an school attendance page

    Often the situation is such that you have multiple courses across a range of dates.So students may take more than one course, and you need to track attendance for each course date. The following graphic demonstrates this:
    In such a situation, you need four database tables as follows:
    students (student_id, student_name, etc.)
    courses (course_id, course_name, etc.)
    students_courses (student_id, course_id)
    attendance (student_id, course_id, dater)
    A fifth table may also be needed to define the dates of courses, but you may also be able to build this array programmatically by using PHP's robust date functions, which can give you, for instance, all the Tuesdays and Thursdays between a start date and end date.
    The students_courses table simply keeps track of which students are taking which courses, so it has just two columns for the primary keys of both of the main tables. The attendance table is similar, but it also includes a date field. The following view of the attendance table demonstrates this:
    So if David's solution does cover your needs, consider yourself lucky, because this could quickly grow from a beginner-appropriate project to a moderately advanced one.

  • How to Update Particular row in a table from OAF page

    Hi Can anyone please help me on the following requirement:
    In my oaf page i am displaying table values(supplier site details from base tables) with update and delete icons . When i click on update button a new page opens in which we used to update the values and click on apply button which again comes back to the original page.
    So when i click on apply button on update page i have to first search for the site in the site table whether it exists or not, if not exists i have to create a new row and save the data, if site exists in the table i have to update the row of a table for that particular site. I have written code for this but unable to achive the requirement, it is not updating the existing row of the table. And i am doing all this on the Temp tables.
    So now when i save, previous transaction is also updating along with the current transaction. That means when i m trying to save 2nd transaction values , 1st transactions values are getting updated with the 2nd transaction values(2 rows are getting updated)
    Can anyone help me with the code used for updating the current row of the table. Please correct me if i m doing anyting wrong in code.
    following is the current code i m using and which is failing :
    Controller Code
    if(pcontactaction.equals("createECdetailsEvent")) {
    String currentSiteName=pageContext.getParameter("SiteName");
    System.out.println("Selected Site Name is : " + currentSiteName);
    Serializable x[]={reqNum,suppId,currentSiteName,pnotifMethod,pfaxNum};
    System.out.println("Invoking AM Method.........");
    am.invokeMethod("initCreateECDetails",x);
    System.out.println("initCreateECDetails Method Executed. ");
    //am.invokeMethod("save");
    localOAApplicationModule.getTransaction().commit();
    pageContext.setForwardURL(
    "OA.jsp?page=/oracle/apps/floaf/flpos/supregister/webui/ECDetailsPG"
    , null //not needed as we are retaining menu context
    ,OAWebBeanConstants.KEEP_MENU_CONTEXT
    , null //not needed as we are retaining menu context
    ,null // no parameters are needed
    ,true //retain AM
    ,OAWebBeanConstants.ADD_BREAD_CRUMB_NO
    ,OAWebBeanConstants.IGNORE_MESSAGES);
    AM Code
    public void initUpdateECDetails(String request_number,String supplier_id,String site_name,String site_id,String notification_method,String fax_number)
    OADBTransaction localOADBTransaction = getOADBTransaction();
    String siteToUpdate;
    siteToUpdate=site_name;
    String siteidToUpdate;
    siteidToUpdate=site_id;
    System.out.println("Site Name to Update or Create is : " + siteToUpdate);
    System.out.println("Site Id to Update or Create is : " + siteidToUpdate);
    System.out.println("Inside Update EC Details MEthod.");
    OAViewObject suppSiteDetVO = getFLPOSSuppSiteDetailsVO1();
    FLPOSSuppSiteDetailsVORowImpl sro=null;
    String existingWhereClause = suppSiteDetVO.getWhereClause();
    suppSiteDetVO.setWhereClause(null);
    suppSiteDetVO.setWhereClauseParams(null);
    suppSiteDetVO.setWhereClause("SUPPLIER_ID = :1 AND REQUEST_NUMBER = :2 AND SITE_ID = :3 ");
    suppSiteDetVO.setWhereClauseParam(0, supplier_id);
    suppSiteDetVO.setWhereClauseParam(1, request_number);
    suppSiteDetVO.setWhereClauseParam(2, site_id);
    suppSiteDetVO.executeQuery();
    suppSiteDetVO.setWhereClauseParams(null);
    suppSiteDetVO.setWhereClause(existingWhereClause);
    int rowcount = suppSiteDetVO.getRowCount();
    System.out.println("Fetched Rows : " + rowcount);
    if (rowcount == 0) {
    Row row = suppSiteDetVO.createRow();
    System.out.println("Row is : " +row);
    suppSiteDetVO.insertRow(row);
    String siteId = getOADBTransaction().getSequenceValue("FLPOS_SITE_ID_SEQ").toString();
    System.out.println("New Site ID : " + siteId);
    row.setNewRowState(Row.STATUS_INITIALIZED);
    row.setAttribute("RequestNumber", request_number);
    row.setAttribute("SupplierId", supplier_id);
    row.setAttribute("SiteName", site_name);
    row.setAttribute("SiteId", siteId);
    row.setAttribute("FaxNo",fax_number);
    row.setAttribute("NotificationMethod",notification_method);
    System.out.println("New Row Created for Supplier Site.");
    System.out.println("Data Saved to table.");
    else{
    System.out.println("Inside Else Block ");
    try {
    System.out.println("Inside Try Block ");
    Row[] row = suppSiteDetVO.getAllRowsInRange();
    for (int i = 0; i < rowcount; i++) {
    sro = (FLPOSSuppSiteDetailsVORowImpl)row;
    String psiteName=sro.getSiteName();
    Number psiteid=sro.getSiteId();
    System.out.println(" p Site Name is : " +psiteName);
    System.out.println(" p site id is " +psiteid);
    if(psiteid.equals(siteidToUpdate) ) {
    sro.setAttribute("FaxNo",fax_number);
    sro.setAttribute("NotificationMethod",notification_method);
    //getOADBTransaction().commit();
    break;
    catch (Exception e) {
    System.out.println("Exception in update : " + e);
    }

    Please answer following:
    1. Are you using EO based VOs or ReadOnly VO?
    2. What is your VO Query for the search and update?
    3. Why have you based your logic on site_name; you should have used site_id?
    4.Are you getting correct site name in handling createECdetailsEvent event in CO?
    5. In case of update are you getting correct values on the Update Site Details?
    6. On coming back from Update page to Supplier Site Search page, do you see old values of the site or the new values in the results table?
    Please share the screenshot if possible.
    -Prince
    [email protected]
    http://princekapoor82.blogspot.com

  • Update multiple rows based on two columns in same row

    I have a 1000 rows in a table I would like to update with a unique value. This unique value is a cocatenation of two columns in teh same row.
    Each row has a (i) date and a (ii) time and a (iii) date_time column. I would like to update the date_time (iii) column with a cocatenation of the (i) date and (ii) time columns.
    I know how I would update a single row but how can I update multiple rows with a cocatenation of each of the two columns - i.e put a different value into the date_time column for each row?

    this?
    update table tab_name
    set date_time =date||time
    where your_condition

  • Best way to update individual rows of a Table?

    I've taken a look at some examples, though haven't gotten any clarification on this.  I am looking to have something close to a listbox or table to where I can update just a single column of row values at a 1 time per second pace.  I am looking to display our data-acquisition values in a table or listbox.  The single listbox seemed to work good for this, but I was unable to use row headers to list the channel names next to the channel values.  I was thinking about connecting the cursor values of two list-boxes to do this, but didn't find any info on this for the single list-box.
    I have a few questions:
    1) I have a 1D array to where I want to use that array of data to constantly update the first column (with a multitude of rows) of a table.  I am looking for the best route so as not to take up too much processing time in doing this.
    What is the best way to update individual rows of a table?   Invoke Node "Set Cell Value" ... or is there another method?
    2) Why is it that after every other iteration the row values are erased? 
    Also, for adding additional strings to the original arrray ... is it best to use the "Array Subset" and then the "Build Array" function, or the "Array Subset" and "Insert Into Array" function?
    See the attached example.
    Thanks.
    Solved!
    Go to Solution.
    Attachments:
    Table Example.vi ‏19 KB

    Jeff·Þ·Bohrer wrote:
    2) Why is it that after every other iteration the row values are erased?
    Classic race condition.  dump the for loop and p-node and just wire the 2D array to the table terminal.!
    I'm not seeing the race condition.  What I am seeing is the table emptying after the last element was written to it on every other run.  I saw watched this with highlight execution on.
    But I'm in full agreement with just writing to the terminal.  It is a 1D array, so you will need to use a build array and transpose 2D array in order for it to write properly.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

Maybe you are looking for

  • FM/BADI for update of VBRK. Invoice

    Hi, Myscenarie: Get a file from external partner and update  SAP table: VBRK with referense nr. What is done:  I have made a custom idoc with a custom FM that grabs this referense and update a Z field in VBRK. Code: update vbrk set zzklarna_inv_nr =

  • Faulty airport card or interference-how to troubleshoot

    Knock on wood, my problems from this past spring having the network drops that seem to still be plaguing many are gone. However, I have an almost as annoying problem. We have moved into a new home and have AT&T Uverse service using a 2Wire 3800HGV-B

  • Diadem 11 crashed when using AOP5 plugin with no specific error

    We have a ASAM-ODS database and are running a Avalon v4.2e server. DIAdem data TDM file is uploaded using openMDM client. We have installed AOP5 plugin on 2 systems running DIAdem 11 to access the data directly from the ASAM-ODS database. On one mach

  • Archive backup restore problem

    When am restore the Archive logs in br tools it asking . ? First sequence number (first_seq) ........ []  ? Second sequence number (second_seq) ........ [] What is sequence number? Pls give any suggestions

  • Direct Expensing out Asset with out capitalizing

    Hello Asset Gurus, Is there any way to directly expense out asset as it is received through Purchase order?  The requirement is to immediately expense out some low value components. I know its possible to receive it as a LVA and depreciate it in the