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

Tags: Dreamweaver

Similar Questions

  • 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

  • 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:

    
    
       
       
       
    
    
    
    
    
  • 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.

  • 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

  • Update multiple records with one submit?

    For the life of me I can't figure out how to do this. I have boxes with the ID primary key listed as the value of a repeat region. I want to perform an update on 2 columns for all checked IDs.

    CODE SUDEO

    < form >

    < cfoutput query...

    other textfields...

    < input name = "checkbox" type = "checkbox" id = "checkbox" value = "" #table.id # "/ >"

    < / cfoutput >

    SUBMIT BUTTON

    < / make >

    My update statement:


    UPDATE table
    SET 1 = Column1, column2 = 'whatever '.
    WHERE id IN (< cfqueryparam cfsqltype = "cf_sql_integer" value = "#TRIM (FORM.checkbox) #" >)
    < / cfquery >

    It updates only if I check a box has no effect when more than one is selected.

    I also tried a loop during the update statement, but nothing seems to work.

    You must use the cfqueryparam list attribute.

  • Get Null when updating multiple records

    Hi all

    super.processFormRequest (pageContext, webBean);
    Am = (XxSupppacklistAMImpl) pageContext.getApplicationModule (webBean) XxSupppacklistAMImpl;

    String s1 = pageContext.getParameter ("ItemNumber");
    System.out.println ("The Parent point Nukmber is:" + s1);

    If (PageContext.GetParameter ("ParentItem")! = null)
    {
    String s2 = pageContext.getParameter ("ParentItem");
    System.out.println ("the Parent element will be", + s2);
    }
    System.out.println ("Hello I'm in the selectAll method," + s1);

    I was null, when executing the above code.
    could you please, help me on this.


    ThankswithRegards,

    Hello

    B4 value to write more if condition

    If (Row.GetAttribute ("ParentItem")! = null)
    {
    parent = row. GetAttribute("ParentItem").toStrring ();
    }

    Regards
    Meher Irk

  • validation against multiple records (section multiple registration)

    How can I validate the records in a record Multiple point (3 files) against multiple records in a database? In other words, if they have previously registered (and is committed to the database) 'A', 'B' and 'C' and then try to enter "C", "D" and "E", a trigger failure will occur because 'C' is recognized as being already in the database. I'm already having control of duplicate records of subject "during a session" via the form, but does not prevent a user to re - enter and update a different record with the same value as one of the other documents submitted previously. Does make sense? I guess I could control it at the database level, making the the user_id AND primary keys of point value, but I want to control it until the user selects the button "Update".

    This should check the records that are unique to that user only. Does make sense?

    Mark,
    You have a post request (PQ) trigger adding or modifying data when a record is being questioned? The when-validate-Item trigger (WVI) will run only when the State of the item is NEW or CHANGED. When you fill out your form with EXECUTE_QUERY(), the ITEM_STATUS should be query.

    If you use a trigger of PQ, would be to reset the record and status of the article once you set your value in the trigger of PQ. For example:

       SET_ITEM_PROPERTY('MY_BLOCK.MY_ITEM', ITEM_IS_VALID, PROPERTY_TRUE);
    

    Another option would be to set the status of all return to the QUERY.

      SET_RECORD_PROPERTY(:SYSTEM.trigger_record, STATUS, QUERY_STATUS);
    

    I hope this helps.
    Craig...

  • 5152. multiple record acquisition forever

    Is it possible to do a multiple record acquisition on the 5152, which itself will be automatically retrigger forever?

    I have currently a multiple record acquisition implemented to acquire 256 records, but the external triggers (using the TRIG BNC of input) are so close together that the software cannot rearm the coverage in time for the next acquisition, and some triggers are missed.

    For example, we are capture 8000 samples to 2 MS/s, if every record is 4 ms in duration. The external trigger occurs at the beginning of all of the records, with a period of 4 ms, so I essentially continuous. Each 256 files (about once per second), the LabVIEW VI transfers data in memory, he wrote on the disk, it displays on the front panel, etc, then re - the scope for the next acquisition of weapons. It would be ideal that the scope can be configured for the immediate release of an another multiple record acquisition (preferably in hardware), so that it could acquire in parallel with LabVIEW treatment files and write data to the disk.

    Any thoughts on how I might accomplish this?

    Hi Schrockwell,

    There is no way to make a Multi-Multi Record Acquisition.

    What you want to do, the short answer is Yes - there is a way to introduce within the finished construction of the API OR-SCOPE, but you should make sure that

    1. you must enable more Records than available memory

    2. you must set the number of records in very huge.  Since this value is an Int32, theoretically, the more important you can set avalue of about 2.15 billion (2 ^ 31-1).   After that, you must stop and restart your acquisition.

    The total time that the acquisition will continue for is:

    = Total number of records [#] acquisition [s] Total time / Trigger rate [Hz]

    3. Finally, you should make sure that you can endure the flow in your PXI/PCI bus, and you have designed your code effectively to support this.

    Two important things I noticed is that you decide to display data on a chart, and you write on a disc.  View data in a graph will lead your program last much longer the complete loop iteration - instead, try rΘcupΦre without display data.  Secondly - if you write to a disc, you must use queuesto do.

    If you already do this, then the question of highest level, it's whether or not you are supplying data on your digitizer.  If so, you must work around this problem so that there is no backlog of data.  The extraction flow (data transferred in your program using the Fetch function) must be equal to your Flow of Acquisition:

    Acquisition flow [B/s]

    = Number of samples per registration type [Sa/REC/WAV] * rate [Hz] * resolution digitizer [bytes / his]

    (Since the 5152 is a 8-bit digitizer, the resolution of your digitizer is 1 b/sample).

    If you can compare your speed of recoveryand who then subtract the acquisition flowcalculation, then you should see a number (in B/s) which reflects the speed at which you are supplying data.  For an acquisition to keep forever, this number must be virtually zero.

    I hope this helps,

    -Andrew

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

  • PHP - delete multiple records in the database by using the checkboxes?

    It took zillions of times over the years, BUT my Google search has been exhausted. I can't find a coherent tutorial or explanation on how to do this.

    Someone else has a link to a tutorial?

    I found and implemented, with a few tweaks, which updates several records of price field. Most likely the removal works in a similar way, by making a loop on all records, but can't get my head around it for the moment.

    See you soon

    Operating system.

    OK, even once, the warning I ever wrote a single php page. But try this.

    Once again, use it for your form fields in the repeat region.

    and for your delete statement

    {foreach ($_POST ['action'] as $dayID)}

    $query = 'DELETE days WHERE the dayID = $dayID;

    mysql_query ($Query) or die ("' error in query: $query '");

    }

    > The data type for the field of dayID is int, is the primary car key.

    FYI - given that the data type is numeric, you do not need to pack quotes around it.

  • Assign an ID to multiple records in bulk by using the checkboxes.

    I have a data block that contains the number of records. There is a check box against each file. and a button below the records.

    I want to assign an id to multiple records whose check box is selected.

    My requirement is when I click on the button under the block, then unique id must be assigned to all the records check box is selected.

    Maybe it is done by means of cursor or loops or both.

    Please, help me in coding of what trigger button.


    Thank you very much.

    Press and hold in the other block (control block) and when pressed to release button

    go_block('block_name');
    first_record;
    IF :check_box = 'Y' THEN--means checked
       :unique_id := 'value';
    END IF;
    if :system.last_record = 'TRUE' then
      eixt;
    else
     next_record;
    end if;
    first_record;
    

    But beware when the checkbox is disabled also.

    I want to update each record in the block but it is not working. below is my pl code behind button.
    

    If it is a block of the base table, you cannot update in the before update trigger?

    Published by: GD on September 9, 2011 23:25

  • fetch multiple records form

    How to write a fetch statement that retrieves multiple records and allow users scroll record 1/3,2/3, 3/3... in the form? I'm not using built in the declaration of add\update\fetch

    example: table seller

    number of seq_no (PK);
    vendor_id number;
    date of call_date;
    issue_asked varchar2 (50);

    When I type in the vendor_id, I want to implement the documents associated to the id in the form. I think I might just need a few meter and loop to increase select it in the statement, but I'm not sure how yet or are there any built in can I use under apex? can u help?

    Munshar

    Do you need to be able to update the tables or only the subtable? If it is only the 'CALLS' table you might create a normal report for sellers and a tabular presentation of the calls. Add a link to the seller's report to display the form as a table for this provider.

  • Several box insert as multiple records

    I'm relatively new to ColdFusion. It's the simplicity, as well as Dreamweaver insert/update/delete assistants, have helped build clean enough applications for database insertion, recovery and deletion and display.

    However, I have to be able to insert several selections of boxes as multiple records in a table, and I am running into problems. I guess this sort of thing is the premise of virtually any shopping cart out there, but I can't seem to find any good information on in my 'develop with CFMX manual' or my "Kit of Construction CFMX Web App" book or on the web also. (The only examples for the page of the form or the action page are a static box!)

    The basic premise of what I'm trying to achieve:

    The user is able to select different items in several boxes. (ITEM_ID)
    This selection is associated with the user. (CUSTOMER_ID)
    The selection is associated with a point in time as a year. (INSTANCE_ID)
    These identification numbers that must all be inserted in a 3 column table expecting integers for ITEM_ID CUSTOMER_ID and INSTANCE_ID

    Example of FORM values that would be passed: (147,148,149, 23445, 4) = (3 ITEM_IDs, CUSTOMER_ID and INSTANCE_ID)

    Typical error on presentation to insert action page: Number of columns in reading / writing does not equal the number of values (which is normal, I am gathering several values via checkboxes).

    How can I insert each box is selected as a separate record in the table?

    Such as:
    (147, 23445, 4)
    (148, 23445, 4)
    (149, 23445, 4)

    My Code:

    Form:

    < are method = "post" name = "form2" action = "process_form_action_page.cfm" >

    < table >

    < cfoutput query = "Stored_Procedure1" >

    < b >
    < td > < input type = "checkbox" name = "ITEM_ID" value = "#Stored_Procedure1.ITEM_ID #" > < table >
    #Stored_Procedure1.ITEM_TITLE # < td > < table >
    < /tr >

    < / cfoutput >

    < /table >

    < input type = "hidden" name = 'CUSTOMER_ID' value = '#CUSTOMERS. CUSTOMER_ID #">"
    < input type = "hidden" name = "INSTANCE_ID' value = '#INSTANCE. INSTANCE_ID #">"
    < input type = "submit" value = "Insert record" >

    < / make >


    «"" "Action page:»»"»


    < cfquery datasource = "ORDERS" >

    INSERT INTO PRODUCT_CUSTOMER (ITEM_ID, CUSTOMER_ID, INSTANCE_ID) VALUES)
    < cfif IsDefined "(FORM. ITEM_ID") AND #FORM. NEQ ITEM_ID # "" > "".
    #FORM. ITEM_ID #.
    < cfelse >
    NULL VALUE
    < / cfif >
    ,
    < cfif IsDefined "(FORM. CUSTOMER_ID') AND #FORM. NEQ CUSTOMER_ID # "" > "".
    #FORM. CUSTOMER_ID #.
    < cfelse >
    NULL VALUE
    < / cfif >
    ,
    < cfif IsDefined "(FORM. INSTANCE_ID") AND #FORM. QNE INSTANCE_ID # "" > "".
    #FORM. INSTANCE_ID #.
    < cfelse >
    NULL VALUE
    < / cfif >
    )

    < / cfquery >
    < / cfif >

    Thank you!

    I'm not not to take good advice. If I was a bit too "hard", I'm sorry... but at least I finally got a good response.

    I realized what I wanted anyway. (Sabaidee, yours was the closest answer you to what I later came up with.) Thanks for the effort, I appreciate it. I will certainly implement your logic of to check if the box is checked).

    What I came up with a solution:





    147
    148
    149



    INSERT INTO MyTABLE (CUSTOMER_ID, ITEM_ID, INSTANCE_ID)
    VALUES (' #Form.CUSTOMER_ID # "," #Form.INSTANCE_ID # "," #Checked_ITEM # ")

    If all of the check boxes are selected, the data is inserted as:

    147, 23445, 4
    148, 23445, 4
    149, 23445, 4

    (I realize that there is much more that can be embellished in the form page and the page of the processor).

  • Update a record with a selection box

    I have a database table called "currentTOW" that contains a single record with only an 'ID' field and a field 'owner '. I have a second table called "truckofweek" that contains several fields with multiple records, including one called 'owner '.

    I want to change my page, setCurrentTOW.cfm, to use a 'truckofweek' query to populate a drop-down list select menu update check in "currentTOW" instead of a regular supply.

    I need the list to contain the strings in the 'Owner' of the 'truckofweek' table fields and then update the table "currentTOW" with the selected channel. How can I do this? The following code fills an area of selection very well, but will not update.

    > I have a database table called "currentTOW" that contains a record
    > with only an 'ID' field and a field 'owner '.
    >..
    > I don't really know what I want to say right here.

    CFUPDATE throws an error because he expects a field named 'ID' (the primary key of the table). This field is never passed to the action because of the cfif statement page in your form code. The said cfif "only create the hidden field when URL.ID is not equal to 0". Given that URL.ID is equal to zero the hidden field is never created.




    I would also change the "currentTOW" table to store the primary key of the table "truckofweek" instead of the name of 'owner '.

Maybe you are looking for

  • Complaints to apple of my visit

    I am wanting to write a complaint about the service, I received in the Apple Store (131 West County Center St. Louis, MO 63131), anyone know who I should address this and relevant email address? Thank you very much for your help. I had the terrible e

  • Satellite A30 - CD-ROM does not work correctly

    My CD ROM is not working properly because the drivers corrupt. I tried uninstalling etc. How to load new drivers or even reformat from the recovery disk when the CD-ROM drive does not work? Looks like catch 22. Someone at - it help him?

  • How to remove XP pro to accidental dual boot with XP Home

    I had to reformat my wife's computer.  It is a store brand AMD athlon 2500 with 2 GB of ram.  It came with a copy of XP Home recovery disk.  I wanted to create a second logical drive on the computer to store the data, but the recovery disc can not do

  • Instability Wireless: Atheros AR9285 briefly disconnects every few minutes

    I bought an ASUS K50ID on Newegg and tried to connect to my Netgear wireless-N, through its Atheros AR9285 (who claims to have installed the latest drivers) Connections starts without a hitch, but after awhile, I noticed that the connection would be

  • DESIGN OF CLUSTER CUCM

    Hi team, I met the following requirement but has no gat delete all documents. My requirement is: a CUCM Cluster should have variour MCS Server model with the same software. My request is that I can build a Cluster of CUCM 8.0 which includes MCS 7845,