DB update multiple records in a table with a form

I'm developing an online proofing system that displays a number of images and then allow the client to approve each image, but also to comment.

I currently have a configuration table with the different elements (an image dynamically takes its name, details about the image and the required form fields). See this Image for layout

I would then apply a repeat region (the number of signs vary) and you want to update all records with feedback from the customer and approval with a single form. How this is done? I downloaded a trial of the Toolbox for developers, but the documentation is horrible. I'd be willing to buy an extension that will allow, as appropriate.

I found an extension that does this in two minutes:

http://www.WebAssist.com/Professional/products/ProductDetails.asp?pid=117

Great software, highly recommended. Easy to figure out and got this "problem" solved quickly.

Tags: Dreamweaver

Similar Questions

  • delete a multiple record in slot table with checkbox form.

    Hello guys,.

    I need your suggestions...


    I have the block master detail. (SECTION and INSTRUCTOR)

    The retail block, I add checkbox element (name: RB_SECTION_ID) with part of database 'No' and when to check the value: SECTION_ID (on property).

    I do a DELETE button. The trigger was the DELETION of the ARTICLE where section_id =: SECTION. RB_SECTION_ID and
    instructor_id =: are you doing. INSTRUCTOR_ID;

    but it does not work.

    How delete us record multiple check multiple check box, and then click DELETE... ??


    View.

    NIA...

    Because your delete statement reflected until it is saved or re-queryied...

    Add Lee after the END of the LOOP;
    execute_query (no_validate);

  • Update multiple rows in a table with one value of another multiple

    Using SQL Server

    How this can be done:

    In all the lines in the upper table PS_CA_BILL_PLAN, we want to update the field LAST_XREF_SEQ_NUM with the MAX (XREF_SEQ_NUM) + 1 of the bottom table

    Where the CONTRACT_NUM and the BILL_PLAN_ID are equal

    This SQL below (in green) works for one line only

    SQL.jpg

    I think it's the SQL code you're looking for:

    UPDATE PS_CA_BILL_PLAN SET LAST_XREF_SEQ_NUM =

    (SELECT MAX (XREF_SEQ_NUM) + PS_CA_BP_XREF 1 B)

    WHERE B.CONTRACT_NUM = A.CONTRACT_NUM AND B.BILL_PLAN_ID = A.BILL_PLAN_ID)

  • Update multiple records at once

    First, thank you very much the people who have helped me out several times now. I put things together and came across another issue of 'beauty' begin as follows. In the previous topics, I had a way to get to an array of automated classification based on the inputs of a fixtures table and some simple calculations. Now, which has been accomplished which resulted in me having to update all the teams by simply clicking a button.

    As you can see in the code below, using a table with every row a form, at the end of the line, there is a button called 'OK' I have to push to update the record according to. A repeat region for all teams in this query shows the ranking of 'new', but is not yet inserted in the League table. Is it possible to have this repeat region without having to push 18 or 20 times a button update? At the end of the table, one (1) button update all records? The primary key is composed like this ' 0000 - u00a "(4 numéros un tiret puis un «u» 1 ou 2 numéros et 1 ou 2 lettres à nouveau)."

    <?php require_once('Connections/connection.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
    {
      $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;
    }
    }

    $editFormAction = $_SERVER['PHP_SELF'];
    if (isset($_SERVER['QUERY_STRING'])) {
      $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
    }

    if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "klassement")) {
      $updateSQL = sprintf("UPDATE klassement SET wedstrijden=%s, overwinning=%s, verlies=%s, gelijkspel=%s, goalsvoor=%s, goalstegen=%s, goalverschil=%s, punten=%s WHERE ploegid=%s",
                           GetSQLValueString($_POST['wedstrijden'], "int"),
                           GetSQLValueString($_POST['overwinning'], "int"),
                           GetSQLValueString($_POST['verlies'], "int"),
                           GetSQLValueString($_POST['gelijkspel'], "int"),
                           GetSQLValueString($_POST['goalsvoor'], "int"),
                           GetSQLValueString($_POST['goalstegen'], "int"),
                           GetSQLValueString($_POST['goalverschil'], "int"),
                           GetSQLValueString($_POST['punten'], "int"),
                           GetSQLValueString($_POST['ploegid'], "text"));

      mysql_select_db($database_koscw, $koscw);
      $Result1 = mysql_query($updateSQL, $koscw) or die(mysql_error());

      $updateGoTo = "klassement-ploegen.php?reeksid=" . $row_klassement['reeksid'] . "";
      if (isset($_SERVER['QUERY_STRING'])) {
        $updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";
        $updateGoTo .= $_SERVER['QUERY_STRING'];
      }
      header(sprintf("Location: %s", $updateGoTo));
    }

    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;
    }
    }

    $reeks_klassement = "-1";
    if (isset($_GET['reeksid'])) {
      $reeks_klassement = $_GET['reeksid'];
    }
    mysql_select_db($database_koscw, $koscw);
    $query_klassement = sprintf("select * from klassement where reeksid = %s order by status asc, punten desc, overwinning desc, goalverschil desc", GetSQLValueString($reeks_klassement, "text"));
    $klassement = mysql_query($query_klassement, $koscw) or die(mysql_error());
    $row_klassement = mysql_fetch_assoc($klassement);
    $totalRows_klassement = mysql_num_rows($klassement);

    $id_reeks = "-1";
    if (isset($_GET['reeksid'])) {
      $id_reeks = $_GET['reeksid'];
    }
    mysql_select_db($database_koscw, $koscw);
    $query_reeks = sprintf("select reeksnaam from reeksen where reeksid = %s", GetSQLValueString($id_reeks, "text"));
    $reeks = mysql_query($query_reeks, $koscw) or die(mysql_error());
    $row_reeks = mysql_fetch_assoc($reeks);
    $totalRows_reeks = mysql_num_rows($reeks);

    mysql_select_db($database_koscw, $koscw);
    $query_seizoen = "select * from seizoen";
    $seizoen = mysql_query($query_seizoen, $koscw) or die(mysql_error());
    $row_seizoen = mysql_fetch_assoc($seizoen);
    $totalRows_seizoen = mysql_num_rows($seizoen);

    $huidig=$row_seizoen['huidigseizoen'];
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <link rel="stylesheet" type="text/css" media="all" href="../_styles/koscw-admin.css" />
    <title>Klassement <?php echo $row_reeks['reeksnaam']; ?> | Beheerpaneel | 1349</title>
    </head>
    <body>
    <div id="container">
    <h1 class="overzichth1">Klassement <?php echo $row_reeks['reeksnaam']; ?></h1>
    <?php if ($totalRows_klassement > 0) { // Show if recordset not empty ?>
    <table cellpadding="5" cellspacing="0" border="0" id="klassement">
    <tr>
      <td class="klassementsmall bgccc bold"></td>
           <td class="klassementteam bgccc bold">Ploegnaam</td>
           <td class="klassementsmall bgccc bold">+</td>
           <td class="klassementsmall bgccc bold">-</td>
           <td class="klassementsmall bgccc bold">=</td>
          <td class="klassementsmall bgccc bold">#</td>
           <td class="klassementsmall bgccc bold"><img src="../_img/goalsmade.png" alt="Goals +" /></td>
           <td class="klassementsmall bgccc bold"><img src="../_img/goalsagainst.png" alt="Goals -" /></td>
           <td class="klassementsmall bgccc bold"><img src="../_img/goalsdifference.png" alt="Goals &asymp;" /></td>
           <td class="klassementsmall bgccc bold">PTN</td>
          <td class="klassementsmall bgccc"> </td>
    </tr>
    <?php
    $i=0;
    do {
    $i++;
    if($i % 2) { //this means if there is a remainder
         echo "<tr class=\"calendareven\">";
    } else { //if there isn't a remainder we will do the else
         echo "<tr class=\"calendarodd\">";
    }
    ?>
    <td>
    <?php
    $rank += 1;
    echo $rank;
    ?>      </td>
           <td class="klassementteam">
              <?php
            $thuisploeg=$row_klassement ['ploegid'];
              $sql_select_thuisploeg="select ploegnaam from ploegen where ploegid = ('$thuisploeg')";
              $resultset_thuisploeg=mysql_query($sql_select_thuisploeg);
              while ($data_thuisploeg=mysql_fetch_array($resultset_thuisploeg))
              {echo $data_thuisploeg['ploegnaam'] . " ";}?></td>
           <form action="<?php echo $editFormAction; ?>" method="POST" name="klassement">
          <input type="hidden" name="ploegid" value="<?php echo $row_klassement ['ploegid']; ?>" />
           <td>
          <?php
           $tw=$row_klassement['ploegid'];
           $sql_select_tw="SELECT COUNT( * ) AS twin FROM kalender WHERE seizoen = '$huidig' AND speeldag !=0 AND thuisploegid = '$tw' AND thuisploeggoals > bezoekersgoals";
           $resultset_tw=mysql_query($sql_select_tw);
           $data_tw=mysql_fetch_array($resultset_tw);
           $data_tw['twin'];
          
           $uitwin=$row_klassement['ploegid'];
           $sql_select_uitwin="SELECT COUNT( * ) AS awin FROM kalender WHERE seizoen = '$huidig' AND speeldag !=0 AND bezoekersid = '$uitwin' AND thuisploeggoals < bezoekersgoals";
           $resultset_uitwin=mysql_query($sql_select_uitwin);
           $data_uitwin=mysql_fetch_array($resultset_uitwin);
           $data_uitwin['awin'];
          
           $win=($data_tw['twin'])+($data_uitwin['awin']);
           ?>
          <input type="text" name="overwinning" value="<?php echo $win; ?>" class="inputscore" readonly="readonly" />
          </td>
           <td>
          <?php
           $tv=$row_klassement['ploegid'];
           $sql_select_tv="SELECT COUNT( * ) AS tver FROM kalender WHERE seizoen = '$huidig' AND speeldag !=0 AND thuisploegid = '$tv' AND thuisploeggoals < bezoekersgoals";
           $resultset_tv=mysql_query($sql_select_tv);
           $data_tv=mysql_fetch_array($resultset_tv);
           $data_tv['tver'];
          
           $uitverlies=$row_klassement['ploegid'];
           $sql_select_uitverlies="SELECT COUNT( * ) AS aver FROM kalender WHERE seizoen = '$huidig' AND speeldag !=0 AND bezoekersid = '$uitverlies' AND thuisploeggoals > bezoekersgoals";
           $resultset_uitverlies=mysql_query($sql_select_uitverlies);
           $data_uitverlies=mysql_fetch_array($resultset_uitverlies);
           $data_uitverlies['aver'];
          
           $ver=($data_tv['tver'])+($data_uitverlies['aver']);
           ?>
          <input type="text" name="verlies" value="<?php echo $ver; ?>" class="inputscore" readonly="readonly" />
          </td>
           <td>
          <?php
           $thuisdraw=$row_klassement['ploegid'];
           $sql_select_thuisdraw="SELECT COUNT( * ) AS tdraw FROM kalender WHERE seizoen = '$huidig' AND speeldag !=0 AND thuisploegid = '$thuisdraw' AND thuisploeggoals = bezoekersgoals";
           $resultset_thuisdraw=mysql_query($sql_select_thuisdraw);
           $data_thuisdraw=mysql_fetch_array($resultset_thuisdraw);
           $data_thuisdraw['tdraw'];
          
           $awaydraw=$row_klassement['ploegid'];
           $sql_select_awaydraw="SELECT COUNT( * ) AS adraw FROM kalender WHERE seizoen = '$huidig' AND speeldag !=0 AND bezoekersid = '$awaydraw' AND thuisploeggoals = bezoekersgoals";
           $resultset_awaydraw=mysql_query($sql_select_awaydraw);
           $data_awaydraw=mysql_fetch_array($resultset_awaydraw);
           $data_awaydraw['adraw'];
          
           $draw=($data_thuisdraw['tdraw'])+($data_awaydraw['adraw']);
           ?>
          <input type="text" name="gelijkspel" value="<?php echo $draw ?>" class="inputscore" readonly="readonly" />
          </td>
          <td>
          <?php $wedstrijden=$win+$ver+$draw; ?>
          <input type="text" name="wedstrijden" value="<?php echo $wedstrijden; ?>" class="inputscore" readonly="readonly" />
          </td>
           <td>
           <?php
          $tgv=$row_klassement ['ploegid'];
           $sql_select_tgv="SELECT SUM( thuisploeggoals ) AS tgv1 FROM kalender WHERE seizoen = '$huidig' AND speeldag !=0 AND thuisploegid = '$tgv'";
           $resultset_tgv=mysql_query($sql_select_tgv);
           $data_tgv=mysql_fetch_array($resultset_tgv);
           $data_tgv['tgv1'];

          $ugv=$row_klassement ['ploegid'];
           $sql_select_ugv="SELECT SUM( bezoekersgoals ) AS ugv1 FROM kalender WHERE seizoen = '$huidig' AND speeldag !=0 AND bezoekersid = '$ugv'";
           $resultset_ugv=mysql_query($sql_select_ugv);
           $data_ugv=mysql_fetch_array($resultset_ugv);
           $data_ugv['ugv1'];

           $gv=($data_tgv['tgv1'])+($data_ugv['ugv1']);
           ?>
          <input type="text" name="goalsvoor" value="<?php echo $gv; ?>" class="inputscore" readonly="readonly" />
          </td>
           <td>
           <?php
          $tgt=$row_klassement ['ploegid'];
           $sql_select_tgt="SELECT SUM( thuisploeggoals ) AS tgt1 FROM kalender WHERE seizoen = '$huidig' AND speeldag !=0 AND bezoekersid = '$tgv'";
           $resultset_tgt=mysql_query($sql_select_tgt);
           $data_tgt=mysql_fetch_array($resultset_tgt);
           $data_tgt['tgt1'];

          $ugt=$row_klassement ['ploegid'];
           $sql_select_ugt="SELECT SUM( bezoekersgoals ) AS ugt1 FROM kalender WHERE seizoen = '$huidig' AND speeldag !=0 AND thuisploegid = '$ugv'";
           $resultset_ugt=mysql_query($sql_select_ugt);
           $data_ugt=mysql_fetch_array($resultset_ugt);
           $data_ugt['ugt1'];

           $gt=($data_tgt['tgt1'])+($data_ugt['ugt1']);
           ?>     
          <input type="text" name="goalstegen" value="<?php echo $gt; ?>" class="inputscore" readonly="readonly" />
          </td>
           <td>
           <?php $goals=$gv-$gt; ?>
          <input type="text" name="goalverschil" value="<?php echo $goals; ?>" class="inputscore" readonly="readonly" />
          </td>
           <td>
           <?php $punten=($win*3)+($draw*1); ?>
          <input type="text" name="punten" value="<?php echo $punten; ?>" class="inputscore" readonly="readonly" />
          </td>
          <td>
          <input type="submit" value="OK" />
          </td>
          <input type="hidden" name="MM_update" value="klassement" />
           </form>
      </tr>
      <?php } while ($row_klassement = mysql_fetch_assoc($klassement)); ?>
    </table>
    <?php } // Show if recordset not empty ?>

    </div>
    </body>
    </html>
    <?php
    mysql_free_result($klassement);

    mysql_free_result($reeks);

    mysql_free_result($seizoen);
    ?>

    Each record is separated, as well as a record can be updated at once, unless you want that all records have the same value.

    To update multiple records in a single operation, you must send the form tabular data. You do this by adding an empty pair of brackets at the end of the name attribute of each entry on the form like this:

     
    

    This translates by $_POST ['ploegid'] which contains a table of all IDS: $_POST ['ploegid'] [0], $_POST ['ploegid'] [1], $_POST ['ploegid'] [2] and so on. All the attributes of the repeat region name need to have added hooks. The following hidden field should be outside of the repeat region and may not have the brackets:

    
    

    You can then use a loop for updating the values like this:

    for ($j = 0, $len = count($_POST['ploegid']); $j < $len; $j++) {  $updateSQL = sprintf("UPDATE klassement SET wedstrijden=%s, overwinning=%s,   verlies=%s, gelijkspel=%s, goalsvoor=%s, goalstegen=%s, goalverschil=%s,   punten=%s WHERE ploegid=%s",                       GetSQLValueString($_POST['wedstrijden'][$j], "int"),                       GetSQLValueString($_POST['overwinning'][$j], "int"),                       GetSQLValueString($_POST['verlies'][$j], "int"),                       GetSQLValueString($_POST['gelijkspel'][$j], "int"),                       GetSQLValueString($_POST['goalsvoor'][$j], "int"),                       GetSQLValueString($_POST['goalstegen'][$j], "int"),                       GetSQLValueString($_POST['goalverschil'][$j], "int"),                       GetSQLValueString($_POST['punten'][$j], "int"),                       GetSQLValueString($_POST['ploegid'][$j], "text"));
    
      mysql_select_db($database_koscw, $koscw);  $Result1 = mysql_query($updateSQL, $koscw) or die(mysql_error());}
    
  • Count records in different tables with a condition

    Hello

    I would like to ask for your help. I want to count the records from multiple tables at the same time. These tables have a common column with them with a date data type. The output I want is to see the records in the tables with a condition of the column_date < (specified date).


    as of:

    Select count (*) from (the_tables) where (column_date), (specific_date)


    Your help would be much appreciated.

    Hello

    || ' WHERE ITEMDATE <= 8/1/2008;';
    

    With the Frank remark about the mistake, another good practice would be to use a connection variable:

    script_sql := 'SELECT COUNT (*) FROM '
    || r_1.owner
    || '.'
    || r_1.table_name
    || ' WHERE ITEMDATE <= :1';
    
    ...
    
    EXECUTE IMMEDIATE script_sql
    INTO this_cnt
    USING to_date('08/01/2008','DD/MM/YYYY');
    
  • How to read/select only the records from a table with non-English characters

    Hello
    I need to find all records in a table with non-English (mainly Chinese) characters in at least one of the varchar2 columns. Let me kow if someone knows a way by which it can be done using SQL/PLSQL.

    Best regards
    Imran
    select * from your table
    where your_column != convert(your_column, 'UTF8', 'US7ASCII)
    

    Replace UTF8 with your database character set

    Published by: thtsang on October 15, 2009 03:53 - unequal sign change of! =

  • We can create a view or table with a form button?

    We can create a view or table with a form button using forms 6i?
    If Yes, what will be the command?

    Gul says:
    We can create a view or table with a form button using forms 6i?
    If Yes, what will be the command?

    Yes. You can. Use the FORMS_DDL built-in. For example

    BEGIN
      Forms_DDL('create table temp(n NUMBER)');
      IF NOT FORM_SUCCESS THEN
        Message ('Table Creation Failed');
      ELSE
        Message ('Table Created');
      END IF;
    END; 
    

    Hope this helps

    Hamid

  • Update multiple records with PHP

    Hey,.

    I want to update multiple lines with a single click on the submit button.

    Unfortunately, it does not work. What's not in the code?

    <? php require_once('.. / Connections/ikon.php');? >
    <? PHP
    If (! function_exists ("GetSQLValueString")) {}
    function GetSQLValueString ($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
    {
    If (via 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 "set":
    $theValue = ($theValue! = "")? $theDefinedValue: $theNotDefinedValue;
    break;
    }
    Return $theValue;
    }
    }

    $editFormAction = $_SERVER ['PHP_SELF'];
    If (isset {}

    $editFormAction. = « ? ». htmlentities($_SERVER['QUERY_STRING']);
    }

    for ($j = 0, $len = count($_POST['id']); $j < $len; $j ++) {}
    If ((isset($_POST["MM_update"])) & & ($_POST ["MM_update"] == "openingsuren_wijzigen")) {}
    $updateSQL = sprintf ("UPDATE ikon_openingsuren SET dag = %s voormiddag = %s, namiddag = WHERE id = %s %s",
    GetSQLValueString ($_POST ['dag'] [$j], "text").
    GetSQLValueString ($_POST ['voormiddag'] [$j], "text").
    GetSQLValueString ($_POST ['namiddag'] [$j], "text").
    GetSQLValueString ($_POST ['id'] [$j], "int"));

    @mysql_select_db ($database_ikon, $ikon);
    $Result1 = mysql_query ($updateSQL, $ikon) or die (mysql_error ());
    }
    }

    @mysql_select_db ($database_ikon, $ikon);
    $query_rsWijzigOpeningsuren = "SELECT * from ikon_openingsuren";
    $rsWijzigOpeningsuren = mysql_query ($query_rsWijzigOpeningsuren, $ikon) or die (mysql_error ());
    $row_rsWijzigOpeningsuren = mysql_fetch_assoc ($rsWijzigOpeningsuren);
    $totalRows_rsWijzigOpeningsuren = mysql_num_rows ($rsWijzigOpeningsuren);
    ? >


    <! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict / / IN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" > ""
    "< html xmlns ="http://www.w3.org/1999/xhtml">".
    < head >
    < meta http-equiv = "content-type" content = text/html"; charset = utf-8 "/ >"
    < title > < / title >
    < / head >
    < body >
    < form action = "<?" PHP echo $editFormAction;? ">" method = "POST" name = "openingsuren_wijzigen" id = "openingsuren_wijzigen" >
    < input name = "id []" type = "hidden" id = "id" value = "<?" PHP echo $row_rsWijzigOpeningsuren ['id'];? ">" / >
    < table id = "tbl_openingsuren" >
    < thead >
    < b >
    < scope = "col" th > Dag < /th >
    < scope = "col" th > Voormiddag < /th >
    < scope = "col" th > Namiddag en Avond < /th >
    < /tr >
    < / thead >
    < tbody >
    <? PHP {? >}
    < b >

    < td > < input name = "dag []" type = "text" id = "dag" value = "<?" PHP echo $row_rsWijzigOpeningsuren ['dag'];? ">" size = "15" maxlength = "15" / > < table >
    < td > < input name = "[to] voormiddag" type = "text" id = "voormiddag" value = "<?" PHP echo $row_rsWijzigOpeningsuren ["voormiddag"];? ">" size = "15" maxlength = "15" / > < table >
    < td > < input name = "[of] namiddag" type = "text" id = "namiddag" value = "<?" PHP echo $row_rsWijzigOpeningsuren ["namiddag'];? ">" size = "15" maxlength = "15" / > < table >
    < /tr >
    <? PHP} while ($row_rsWijzigOpeningsuren = mysql_fetch_assoc ($rsWijzigOpeningsuren));? >
    < / tbody >
    < /table >
    < p > < input type = "submit" name = "submit" id = "submit" value = "Stayed" class = "knop" / > < / p >
    < input type = "hidden" name = "MM_update" value = "openingsuren_wijzigen" / >
    < / make >
    < / body >
    < / html >
    <? PHP
    mysql_free_result ($rsWijzigOpeningsuren);
    ? >

    Powerlait wrote:

    I want to update multiple lines with a single click on the submit button.

    Unfortunately, it does not work. What's not in the code?

    It would be more useful if you were to say what is happening. "It doesn't work" is not very useful.

    However, a quick look at your code is your hidden field that contains the ID outside the loop (repeat region) in your form. Place it inside the loop like this:

    
    
       
       
       
    
    
    
    
    
  • Update the records in the table

    I have an INCOME_LOT table. Now, I need to update records with the current max (lot_id) + rownum where lot_id = 0.
    Note: There are multiple records with lot_id = 0.

    CREATE TABLE INCOME_LOT
    (
    LOT_ID NUMBER OF NON-NULL,
    NUMBER OF DETAIL_ID
    DATE OF EFFECTIVE_DATE,
    DATE OF UPDATE_DATE
    )
    It is only a sample data of 4 records, while in fact, I have millions of records to be updated.

    Insert into INCOME_LOT
    (LOT_ID, DETAIL_ID, EFFECTIVE_DATE, UPDATE_DATE)
    Values
    (0, 5773490, TO_DATE (MAY 5, 2014 00:00:00 ',' DD/MM/YYYY HH24:MI:SS'), TO_DATE (MAY 6, 2014 00:22:40 ',' DD/MM/YYYY HH24:MI:SS'));))
    Insert into INCOME_LOT
    (LOT_ID, DETAIL_ID, EFFECTIVE_DATE, UPDATE_DATE)
    Values
    (0, 5773491, TO_DATE (MAY 5, 2014 00:00:00 ',' DD/MM/YYYY HH24:MI:SS'), TO_DATE (MAY 6, 2014 00:22:40 ',' DD/MM/YYYY HH24:MI:SS'));))
    Insert into INCOME_LOT
    (LOT_ID, DETAIL_ID, EFFECTIVE_DATE, UPDATE_DATE)
    Values
    (0, 5773492, TO_DATE (MAY 5, 2014 00:00:00 ',' DD/MM/YYYY HH24:MI:SS'), TO_DATE (MAY 6, 2014 00:22:40 ',' DD/MM/YYYY HH24:MI:SS'));))
    Insert into INCOME_LOT
    (LOT_ID, DETAIL_ID, EFFECTIVE_DATE, UPDATE_DATE)
    Values
    (0, 5773493, TO_DATE (MAY 5, 2014 00:00:00 ',' DD/MM/YYYY HH24:MI:SS'), TO_DATE (MAY 6, 2014 00:22:41 ',' DD/MM/YYYY HH24:MI:SS'));))
    COMMIT;

    Can someone help me to update all records with a single SQL query or maybe a PL/SQL block? I could design a cursor to update, but it would be tedious to use.

    Do you want this:

    UPDATE INCOME_LOT

    Set lot_id = 262696 + ROWNUM

    WHERE lot_id = 0;

  • Quick loss of millions of records in a table with version

    Hello world

    We seek for one of our tables versioned delete and contains about 28 million records.  On Exadata and 11.2.0.3.

    Normally we would just drag the table, but there is a requirement that we keep a number of documents (about 500 k), complete with the story, so that other components of the system related are not lacking (even if these 500 k will also be removed subsequently).

    I did a survey on how we can do that, but a massive factor is to ensure that there is minimal downtime.  A method I've tried is to remove batch of 5 million - if the button Delete merging could take 24 hours in total for each series and we could not afford 6 cases of this.

    I also tried DBMS_WM. PURGETABLE, but this seems to take a long time as well (even with no table to archive being created).

    Copies the records in another table LT, truncate table source and re - insert the records back in 500 k is an option that we looked at, if not ideal.  I think we would also update wm$ modified_tables for it.

    Are there other alternatives that make this possible, or if we were to go down the road of truncated - is there anything else we need to consider in order to maintain the coherence of the WMSYS dictionary?

    Many thanks in advance,

    James

    Hi James,

    Would it not possible to simply do the operation to remove directly in LIVE workspace?  This would eliminate the need to merge the workspace.  Truncation operations do not rely on the tables of the activated version.  Nor is face _LT table to a temporary table and the re-insertinig.  The hierarchy of the workspace and other metadata may have changed in the meantime which would make it invalid reinserted data.  Guaranteeing that nothing else changes it would fix, but is not yet all that is generally supported.

    Delete that number of lines will take some time little matter method.  How long the procedure PurgeTable did?  It is going to be the approach that should be faster by using features of the Workspace Manager.  In addition, if these lines will be deleted anyway, why not just wait until it is safe to do so and do it all at this point in time?  Then you must conditionally delete lines.  You can simply call dbms_wm. DisableVersioning on the table and then delete it.

    Kind regards

    Ben

  • How to update multiple records

    Hello

    I have this problem

    I have this table whith 100,000 records with the State of the column = DONE

    NUM_CUSTSTATUSDATE
    00931754FACT05/05/2015-00:00:00
    00931741FACT05/05/2015-00:00:00
    00931742FACT05/05/2015-00:00:00
    00931744FACT05/05/2015-00:00:00
    00931743FACT05/05/2015-00:00:00
    00931747FACT05/05/2015-00:00:00
    00931746FACT05/05/2015-00:00:00

    I need to update the State of the column with values from another table

    AU_NUM_CUSTAU_DATEAU_STATUS
    0093175405/05/2015-00:00:00FACT
    0093174105/05/2015-00:00:00DELETE
    0093174205/05/2015-00:00:00DELETE
    0093174405/05/2015-00:00:00DELETE
    0093174305/05/2015-00:00:00DELETE
    0093174705/05/2015-00:00:00DELETE
    0093174605/05/2015-00:00:00DELETE

    Thanks if you can help

    Hello

    You can use the merge sql stmt:

    merge into target_table t

    using s source_table

    on (t.num_cust = s.au_num_cust and = t.date s.au_date)

    When matched then

    update set s.au_status = t.status

    Greetings,

    SIM

  • How update multiple records at once?

    Hi all

    I'm using oracle 11g 1.2.1.0.

    I have table below

    emp_id, emp_name

    1                     X

    2                      Y

    3                      Z

    4                     M

    5                      Q

    ..                   ..

    .                     ...

    ..                    ....

    as I have 10 records and emp_id is unique

    I have an added email column more

    Now I want to update e-mail as a column as [email protected] [email protected] ... [email protected] .

    I created the sequence to concatenate the x and gamil.com.

    But how I will update to the atime all records with the e-mail data.

    Concerning

    Dale

    Or

    as you said that you have created a query sequence will look like:

    Update emp

    the value email = 'x '. seq_name.nextval | ' @gmail.com';

    In general, if you want to update all rows in a table do not put a clause where clause, even if I avoid using these updates its place to the user to use them or not.

    Cheerz,

    Stako

  • Help to update all rows in the Table with a sequence

    Hi all

    I have a table with the name Report_Status, now we have added a new [Batch_ID] column in the table. The new column takes a value in a sequence. Can someone tell me a normal SQL queries or the procedure for updating each line in turn to an existing table in the value of the sequence? We cannot delete the existing data, must be added for each record batch code.

    example of name of sequence: Report_Status_Batch_ID_SEQ

    Report_Status name and the column name of the table Batch_ID

    Thanks for your time to help out me.

    Kind regards

    Ashish

    Thanks John,

    or I could write as update dept set id = ID_SEQ. NEXTVAL;

    This also works. Thanks for the idea.

  • Problem updating multiple rows in the table using subquery

    Hi everyone, I can't update multiple lines with a subquery. Here is the configuration:
    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, by using an update statement (or merge if this is better), I mean set values for col_d where col_b = 3 equal to that of the col_d where col_b = 1 and col_c equal between them. Results should resemble 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     17
    I see her there within my reach using this query, where I want to put b_col_d = a_col_d, but miss me something, this query returns too many rows when it is 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_c
    Update column_d set mytable = (select? where?)

    Can someone help me get there? I use 10 gr 2.

    Thank you!
    Mark

    I hope that's what you're 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 very much for providing the sample data in a format that is easy to consume form, as well as the expected results.

  • Matching records between 2 tables with duplicate records

    Hi all

    I need help in what follows.

    I have 2 tables Received_bills and Send_bills.

    -------------------------------------------------------

    -The DOF for Table SEND_BILLS

    --------------------------------------------------------

    CREATE TABLE SEND_BILLS

    (DATE OF "DATUM",

    NUMBER OF "PAYMENT."

    'CODE' VARCHAR2 (5 BYTE)

    )  ;

    --------------------------------------------------------

    -The DOF for Table RECEIVED_BILLS

    --------------------------------------------------------

    CREATE TABLE 'RECEIVED_BILLS '.

    (DATE OF "DATUM",

    NUMBER OF "PAYMENT."

    'CODE' VARCHAR2 (5 BYTE),

    VARCHAR2 (5 BYTE) 'STATUS' )  ;

    INSERTION of REM in RECEIVED_BILLS

    TOGETHER TO DEFINE

    Insert. RECEIVED_BILLS (DATUM, PAYMENT, CODE, STATE) values (to_date('10-OCT-15','DD-MON-RR'), 19, 'A1', 'SUCCESS');

    Insert into RECEIVED_BILLS (PAYMENT, CODE, DATE, STATUS) values (to_date('10-OCT-15','DD-MON-RR'), 'A5', 'SUCCESS', 25);

    Insert into RECEIVED_BILLS (PAYMENT, CODE, DATE, STATUS) values (to_date('10-OCT-15','DD-MON-RR'), 47, 'A4', 'FAILED');

    Insert into RECEIVED_BILLS (PAYMENT, CODE, DATE, STATUS) values (to_date('10-OCT-15','DD-MON-RR'), 19, 'A1', 'FAILED');

    Insert into RECEIVED_BILLS (PAYMENT, CODE, DATE, STATUS) values (to_date('10-OCT-15','DD-MON-RR'), 19, 'A1', 'SUCCESS');

    INSERTION of REM in SEND_BILLS

    TOGETHER TO DEFINE

    Insert into SEND_BILLS (DATUM, CODE) values (to_date('10-OCT-15','DD-MON-RR'), 19, 'A1');

    Insert into SEND_BILLS (DATUM, CODE) values (to_date('10-OCT-15','DD-MON-RR'), 19, 'A1');

    Insert into SEND_BILLS (DATUM, CODE) values (to_date('10-OCT-15','DD-MON-RR'), 19, 'A1');

    Insert into SEND_BILLS (DATUM, CODE) values (to_date('10-OCT-15','DD-MON-RR'), 25, 'A5');

    Insert into SEND_BILLS (DATUM, CODE) values (to_date('10-OCT-15','DD-MON-RR'), 47, 'A4');

    Insert into SEND_BILLS (DATUM, CODE) values (to_date('09-OCT-15','DD-MON-RR'), 19, 'A8');

    Insert into SEND_BILLS (DATUM, CODE) values (to_date('10-OCT-15','DD-MON-RR'), 20, 'A1');

    Insert into SEND_BILLS (DATUM, CODE) values (to_date('10-OCT-15','DD-MON-RR'), 19, 'A1');

    Insert into SEND_BILLS (DATUM, CODE) values (to_date('10-OCT-15','DD-MON-RR'), 25, 'A5');

    Insert into SEND_BILLS (DATUM, CODE) values (to_date('10-OCT-15','DD-MON-RR'), 25, 'A5');

    I match all records of send_bills and received_bills with a status of 'SUCCESS' There is no single column in the table.

    Correspondence held payment of columns, the code and the scratch cards, but it may also duplicate records. But even if there are duplicates, I also need those records in the query results

    the query I wrote is this:

    SELECT SEND.*

    REC received_bills, send_bills send

    WHERE send.datum = rec.datum

    AND send.payment = rec.payment

    AND send.code = rec.code

    AND 'rec.status =' SUCCESS

    ;

    The query results give me this

    OCTOBER 10, 1519A1
    OCTOBER 10, 1519A1
    OCTOBER 10, 1519A1
    OCTOBER 10, 1519A1
    OCTOBER 10, 1519A1
    OCTOBER 10, 1519A1
    OCTOBER 10, 1525A5
    OCTOBER 10, 1519A1
    OCTOBER 10, 1519A1
    OCTOBER 10, 1525A5

    The result of the correct application would be

    OCTOBER 10, 1519A1
    OCTOBER 10, 1525A5
    OCTOBER 10, 1519A1

    The select statement that I need I want to use a loop to insert records in another table.

    Can someone help me please?

    Thanks in advance.

    Best regards

    Caroline

    Hi, Caroline.

    Caroline wrote:

    Hi all

    I need help in what follows.

    I have 2 tables Received_bills and Send_bills.

    -------------------------------------------------------

    -The DOF for Table SEND_BILLS

    --------------------------------------------------------

    CREATE TABLE SEND_BILLS

    (DATE OF "DATUM",

    NUMBER OF "PAYMENT."

    'CODE' VARCHAR2 (5 BYTE)

    )  ;

    --------------------------------------------------------

    -The DOF for Table RECEIVED_BILLS

    --------------------------------------------------------

    CREATE TABLE 'RECEIVED_BILLS '.

    (DATE OF "DATUM",

    NUMBER OF "PAYMENT."

    'CODE' VARCHAR2 (5 BYTE),

    VARCHAR2 (5 BYTE) 'STATUS');

    INSERTION of REM in RECEIVED_BILLS

    TOGETHER TO DEFINE

    Insert. RECEIVED_BILLS (DATUM, PAYMENT, CODE, STATE) values (to_date('10-OCT-15','DD-MON-RR'), 19, 'A1', 'SUCCESS');

    Insert into RECEIVED_BILLS (PAYMENT, CODE, DATE, STATUS) values (to_date('10-OCT-15','DD-MON-RR'), 'A5', 'SUCCESS', 25);

    Insert into RECEIVED_BILLS (PAYMENT, CODE, DATE, STATUS) values (to_date('10-OCT-15','DD-MON-RR'), 47, 'A4', 'FAILED');

    Insert into RECEIVED_BILLS (PAYMENT, CODE, DATE, STATUS) values (to_date('10-OCT-15','DD-MON-RR'), 19, 'A1', 'FAILED');

    Insert into RECEIVED_BILLS (PAYMENT, CODE, DATE, STATUS) values (to_date('10-OCT-15','DD-MON-RR'), 19, 'A1', 'SUCCESS');

    INSERTION of REM in SEND_BILLS

    TOGETHER TO DEFINE

    Insert into SEND_BILLS (DATUM, CODE) values (to_date('10-OCT-15','DD-MON-RR'), 19, 'A1');

    Insert into SEND_BILLS (DATUM, CODE) values (to_date('10-OCT-15','DD-MON-RR'), 19, 'A1');

    Insert into SEND_BILLS (DATUM, CODE) values (to_date('10-OCT-15','DD-MON-RR'), 19, 'A1');

    Insert into SEND_BILLS (DATUM, CODE) values (to_date('10-OCT-15','DD-MON-RR'), 25, 'A5');

    Insert into SEND_BILLS (DATUM, CODE) values (to_date('10-OCT-15','DD-MON-RR'), 47, 'A4');

    Insert into SEND_BILLS (DATUM, CODE) values (to_date('09-OCT-15','DD-MON-RR'), 19, 'A8');

    Insert into SEND_BILLS (DATUM, CODE) values (to_date('10-OCT-15','DD-MON-RR'), 20, 'A1');

    Insert into SEND_BILLS (DATUM, CODE) values (to_date('10-OCT-15','DD-MON-RR'), 19, 'A1');

    Insert into SEND_BILLS (DATUM, CODE) values (to_date('10-OCT-15','DD-MON-RR'), 25, 'A5');

    Insert into SEND_BILLS (DATUM, CODE) values (to_date('10-OCT-15','DD-MON-RR'), 25, 'A5');

    I match all records of send_bills and received_bills with a status of 'SUCCESS' There is no single column in the table.

    Correspondence held payment of columns, the code and the scratch cards, but it may also duplicate records. But even if there are duplicates, I also need those records in the query results

    the query I wrote is this:

    SELECT SEND.*

    REC received_bills, send_bills send

    WHERE send.datum = rec.datum

    AND send.payment = rec.payment

    AND send.code = rec.code

    AND 'rec.status =' SUCCESS

    ;

    The query results give me this

    OCTOBER 10, 15 19 A1
    OCTOBER 10, 15 19 A1
    OCTOBER 10, 15 19 A1
    OCTOBER 10, 15 19 A1
    OCTOBER 10, 15 19 A1
    OCTOBER 10, 15 19 A1
    OCTOBER 10, 15 25 A5
    OCTOBER 10, 15 19 A1
    OCTOBER 10, 15 19 A1
    OCTOBER 10, 15 25 A5

    The result of the correct application would be

    OCTOBER 10, 15 19 A1
    OCTOBER 10, 15 25 A5
    OCTOBER 10, 15 19 A1

    The select statement that I need I want to use a loop to insert records in another table.

    Can someone help me please?

    Thanks in advance.

    Best regards

    Caroline

    Want to get answers that work?  Then make sure that the CREATE TABLE and INSERT statements you post too much work.  Test (and, if necessary, correct) your statements before committing.  You have a stray "." in the first INSERT statement for received_bills and receikved_bills.status is defined as VARCHAR2 (5), but all values are 6 characters long.

    There are 5 lines in send_bills that are similar to the

    10 OCTOBER 2015 19 A1

    Why do you want that 2 rows like this in the output, not 1 or 3, or 4 or 5?  Is it because there are 2 matching rows in received_bills?  If so, you can do something like this:

    WITH rec AS

    (

    SELECT the reference, payment, code

    , ROW_NUMBER () OVER (PARTITION BY datum, payment, code)

    ORDER BY NULL

    ) AS r_num

    OF received_bills

    Situation WHERE = 'SUCCESS'

    )

    send AS

    (

    SELECT the reference, payment, code

    , ROW_NUMBER () OVER (PARTITION BY datum, payment, code)

    ORDER BY NULL

    ) AS r_num

    OF send_bills

    )

    SELECT send.datum, send.payment, send.code

    REC, send

    WHERE send.datum = rec.datum

    AND send.payment = rec.payment

    AND send.code = rec.code

    AND send.r_num = rec.r_num

    ;

    Note that the main request is very similar to the query you posted, but the last condition has changed.

    If you need to insert these lines in another table, you can use this query in an INSERT statement. There is no need of a loop, or for any PL/SQL.

Maybe you are looking for

  • Software for analyzing the browser history (no removal)

    Assuming that solicit the recommendations of software fits Apple Discussion, I would like recommendations for software that will allow me to Preserve my browser (Safari, ideally) history. Record visited, including the first and last dates. Save this

  • Forcepad HP EliteBook Folio 1040 G1

    Hello I love the new ForcePad and I would use it at work. I use the external keyboard and the monitor at work and does not work with Forcepad built into the laptop. Is it possible to connect the external Forcepad via USB or similar? Thank you very mu

  • ThinkCentre M92p - Linux boot problem

    Hi all! I recently bought a new Lenovo ThinkCentre M92p. unfortunately I can't seem to run with Linux. I tried the two openSUSE 12.2 x 64 and Ubuntu LTS 12.04.1 x 64 (just to make sure that it is not only a problem of the OS or the installation media

  • I need to remove windows sign in assistant so I can reinstall windows live

    I already posted a problem with movie maker with a problem I can not remember the error code as I deleted it, but what happened was when I open movie maker a box pops up with a code 0x00 and said that I had to restart but when I closed this filmmaker

  • HP Pavilion Media Center TV a1635

    Hello, I need to find drivers for HP Pavilion Media Center TV a1635.ch desktop PC. Can ' help me? Windows XP SP3 HP Pavilion Media Center TV a1635.ch desktop PC ASUS a8m2n - the nodusm3 Dual-Core AMD Athlon 64 X 2 3800 +. 1 + 1 GB DDR2-533 DDR2 SDRAM