How to insert past record after updating the master table in history table through store PROC

Master Table
Party Status
A Active
B Inactive
C Active
D Inactive
Duplicate Table
Party Status
A Active
B Active
C Active
D Inactive
Updated Master Table
Party Status
A Active
B Active
C Active
D Inactive
Party History Table
B Inactive
I have two table one master and another duplicate I need to update master table based on duplicate table insert the record which updated into Party history table as shown above. need help to write store proc.

Check MERGE syntax in BOL (example D). There should be a sample with output, e.g.
insert into PartyHistory (Party, [Status])
select Party, [Status] FROM
(MERGE Master M using Duplicate D on M.[Party]=D.[Party]AND M.[Status]<>D.[Status]
WHEN MATCHED THEN UPDATE
SET [Status] = D.[Status]
OUTPUT Deleted.[Party], Deleted.[Status], $Action) AS Changes (Party, [Status], Action) WHERE Action = 'UPDATE'
For every expert, there is an equal and opposite expert. - Becker's Law
My blog
My TechNet articles

Similar Messages

  • How  and where does SAP standard programs update the master tables...

    Hello there,
    How  and where does SAP standard programs update the master tables...
    to be precise.. if a (any) transaction occurs  the programs behind it holds the data in temporary structures.
    where and when does it get updated in the master table.
    can anyone tell me how it happens?
    I Know that from the where used list one can find the corresponding table but most of the time it wont suffice
    I am expecting a proper answer.
    Santosh B

    Hello Santosh,
    you need to do some self-reading on the following topic
    Updates in the SAP System (BC-CST-UP)
    http://help.sap.com/saphelp_47x200/helpdata/en/e5/de86e135cd11d3acb00000e83539c3/frameset.htm
    Regards,
    Siddhesh

  • How to return to record after updating (ie add a url with variable)

    I want to put a link in to return to the page displaying the record after updating.  I followed the Dreamweaver insrtuctio an added this after the page url in the update behaviours:
    ?recordID=<?php echo $row_recordsetName['fieldName']; ?>
    However the page does not load but gives this error:
    Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in C:\UwAmp\www\testmypms\update_spec_rx.php on line 77
    Here's the page code:
    <?php require_once('Connections/testmypms.php'); ?>
    <?php
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $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"] == "updateSpecRx")) {
      $updateSQL = sprintf("UPDATE spec_rx SET spec_rx_date=%s, FK_user_id=%s, spec_rx_rsph=%s, spec_rx_rcyl=%s, spec_rx_raxis=%s, spec_rx_rhprism=%s, spec_rx_rhprismbase=%s, spec_rx_rvprism=%s, spec_rx_rvprismbase=%s, spec_rx_rnadd=%s, spec_rx_rnhprism=%s, spec_rx_rnhprismbase=%s, spec_rx_rnvprism=%s, spec_rx_rnvprismbase=%s, spec_rx_rintadd=%s, spec_rx_rinthprism=%s, spec_rx_rinthprismbase=%s, spec_rx_rintvprism=%s, spec_rx_rintvprismbase=%s, spec_rx_lsph=%s, spec_rx_lcyl=%s, spec_rx_laxis=%s, spec_rx_lhprism=%s, spec_rx_lhprismbase=%s, spec_rx_lvprism=%s, spec_rx_lvprismbase=%s, spec_rx_lintadd=%s, spec_rx_linthprism=%s, spec_rx_linthprismbase=%s, spec_rx_lintvprism=%s, spec_rx_lintvprismbase=%s, spec_rx_lnadd=%s, spec_rx_lnhprism=%s, spec_rx_lnhprismbase=%s, spec_rx_lnvprism=%s, spec_rx_lnvprismbase=%s, ext_rx=%s WHERE spec_rx_id=%s",
                           GetSQLValueString($_POST['rHprism'], "date"),
                           GetSQLValueString($_POST['userID'], "int"),
                           GetSQLValueString($_POST['rsph'], "double"),
                           GetSQLValueString($_POST['rcyl'], "double"),
                           GetSQLValueString($_POST['raxis'], "double"),
                           GetSQLValueString($_POST['rHprism'], "double"),
                           GetSQLValueString($_POST['rHprismbase'], "text"),
                           GetSQLValueString($_POST['rVprism'], "double"),
                           GetSQLValueString($_POST['rVprismbase'], "text"),
                           GetSQLValueString($_POST['rNradd'], "double"),
                           GetSQLValueString($_POST['rNrHprism'], "double"),
                           GetSQLValueString($_POST['rNrHprismbase'], "text"),
                           GetSQLValueString($_POST['rNrVprism'], "double"),
                           GetSQLValueString($_POST['rNrVprismbase'], "text"),
                           GetSQLValueString($_POST['rIntadd'], "double"),
                           GetSQLValueString($_POST['rIntHprism'], "double"),
                           GetSQLValueString($_POST['rIntHprismbase'], "text"),
                           GetSQLValueString($_POST['rIntVprism'], "double"),
                           GetSQLValueString($_POST['rIntVprismbase'], "text"),
                           GetSQLValueString($_POST['lsph'], "double"),
                           GetSQLValueString($_POST['lcyl'], "double"),
                           GetSQLValueString($_POST['laxis'], "double"),
                           GetSQLValueString($_POST['lHprism'], "double"),
                           GetSQLValueString($_POST['lHprismbase'], "text"),
                           GetSQLValueString($_POST['lVprism'], "double"),
                           GetSQLValueString($_POST['lVprismbase'], "text"),
                           GetSQLValueString($_POST['lIntadd'], "double"),
                           GetSQLValueString($_POST['lIntHprism'], "double"),
                           GetSQLValueString($_POST['lIntHprismbase'], "text"),
                           GetSQLValueString($_POST['lIntVprism'], "double"),
                           GetSQLValueString($_POST['lIntVprismbase'], "text"),
                           GetSQLValueString($_POST['lNradd'], "double"),
                           GetSQLValueString($_POST['lNrHprism'], "double"),
                           GetSQLValueString($_POST['lNrHprismbase'], "text"),
                           GetSQLValueString($_POST['lNrVprism'], "double"),
                           GetSQLValueString($_POST['rNrVprismbase'], "text"),
                           GetSQLValueString(isset($_POST['extRx']) ? "true" : "", "defined","1","0"),
                           GetSQLValueString($_POST['SpecRxID'], "int"));
      mysql_select_db($database_testmypms, $testmypms);
      $Result1 = mysql_query($updateSQL, $testmypms) or die(mysql_error());
      $updateGoTo = "spec_rx4.php";
      if (isset($_SERVER['QUERY_STRING'])) {
        $updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";
        $updateGoTo .= $_SERVER['QUERY_STRING'];
      header(sprintf("Location: %s", $updateGoTo));
    /*   date_default_timezone_set('Europe/London');
    $date = strtotime($_POST['specRxDate']);
         $_POST['specRxDate'] = date("Y-m-d",$date); */
    $currentPage = $_SERVER["PHP_SELF"];
    $maxRows_spec_rx = 1;
    $pageNum_spec_rx = 0;
    if (isset($_GET['pageNum_spec_rx'])) {
      $pageNum_spec_rx = $_GET['pageNum_spec_rx'];
    $startRow_spec_rx = $pageNum_spec_rx * $maxRows_spec_rx;
    $colname_spec_rx = "1";
    if (isset($_GET['spec_RxID'])) {
      $colname_spec_rx = (get_magic_quotes_gpc()) ? $_GET['spec_RxID'] : addslashes($_GET['spec_RxID']);
    mysql_select_db($database_testmypms, $testmypms);
    $query_spec_rx = sprintf("SELECT demographics.px_id, demographics.FK_title_id, demographics.firstname, demographics.surname, title.title, title.title_id, spec_rx.spec_rx_id, spec_rx.FK_px_id, DATE_FORMAT(spec_rx.spec_rx_date, '%%d-%%m-%%Y') as formatted_rx_date, spec_rx.FK_user_id, spec_rx.spec_rx_rsph, spec_rx.spec_rx_rcyl, spec_rx.spec_rx_raxis, spec_rx.spec_rx_rhprism, spec_rx.spec_rx_rhprismbase, spec_rx.spec_rx_rvprism, spec_rx.spec_rx_rvprismbase, spec_rx.spec_rx_rnadd, spec_rx.spec_rx_rnhprism, spec_rx.spec_rx_rnhprismbase, spec_rx.spec_rx_rnvprism, spec_rx.spec_rx_rnvprismbase, spec_rx.spec_rx_rintadd, spec_rx.spec_rx_rinthprism, spec_rx.spec_rx_rinthprismbase, spec_rx.spec_rx_rintvprism, spec_rx.spec_rx_rintvprismbase, spec_rx.spec_rx_lsph, spec_rx.spec_rx_lcyl, spec_rx.spec_rx_laxis, spec_rx.spec_rx_lhprism, spec_rx.spec_rx_lhprismbase, spec_rx.spec_rx_lvprism, spec_rx.spec_rx_lvprismbase, spec_rx.spec_rx_lintadd, spec_rx.spec_rx_linthprism, spec_rx.spec_rx_linthprismbase, spec_rx.spec_rx_lintvprism, spec_rx.spec_rx_lintvprismbase, spec_rx.spec_rx_lnadd, spec_rx.spec_rx_lnhprism, spec_rx.spec_rx_lnhprismbase, spec_rx.spec_rx_lnvprism, spec_rx.spec_rx_lnvprismbase, spec_rx.ext_rx FROM spec_rx, demographics, title WHERE spec_rx.spec_rx_id = %s AND spec_rx.FK_px_id = demographics.px_id AND demographics.FK_title_id = title.title_id", $colname_spec_rx);
    $query_limit_spec_rx = sprintf("%s LIMIT %d, %d", $query_spec_rx, $startRow_spec_rx, $maxRows_spec_rx);
    $spec_rx = mysql_query($query_limit_spec_rx, $testmypms) or die(mysql_error());
    $row_spec_rx = mysql_fetch_assoc($spec_rx);
    if (isset($_GET['totalRows_spec_rx'])) {
      $totalRows_spec_rx = $_GET['totalRows_spec_rx'];
    } else {
      $all_spec_rx = mysql_query($query_spec_rx);
      $totalRows_spec_rx = mysql_num_rows($all_spec_rx);
    $totalPages_spec_rx = ceil($totalRows_spec_rx/$maxRows_spec_rx)-1;
    mysql_select_db($database_testmypms, $testmypms);
    $query_users = "SELECT users.user_id, users.username FROM users";
    $users = mysql_query($query_users, $testmypms) or die(mysql_error());
    $row_users = mysql_fetch_assoc($users);
    $totalRows_users = mysql_num_rows($users);
    $queryString_spec_rx = "";
    if (!empty($_SERVER['QUERY_STRING'])) {
      $params = explode("&", $_SERVER['QUERY_STRING']);
      $newParams = array();
      foreach ($params as $param) {
        if (stristr($param, "pageNum_spec_rx") == false &&
            stristr($param, "totalRows_spec_rx") == false) {
          array_push($newParams, $param);
      if (count($newParams) != 0) {
        $queryString_spec_rx = "&" . htmlentities(implode("&", $newParams));
    $queryString_spec_rx = sprintf("&totalRows_spec_rx=%d%s", $totalRows_spec_rx, $queryString_spec_rx);
    ?>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Amend Spec Rx</title>
    </head>
    <body>
    <p>Amend Spec Rx</p>
    <p><?php echo $row_spec_rx['px_id']; ?></p>
    <p><?php echo $row_spec_rx['title']; ?><?php echo $row_spec_rx['firstname']; ?><?php echo $row_spec_rx['surname']; ?> </p>
    <form action="<?php echo $editFormAction; ?>" method="POST" name="updateSpecRx" id="updateSpecRx">
      <table border="1" cellpadding="5" cellspacing="1">
        <tr>
          <td> </td>
          <td>
         <td><?php date_default_timezone_set('Europe/London'); ?>
        <input name="specRxDate" type="text" id="specRxDate" value="<?php echo $row_spec_rx['formatted_rx_date']; ?>" size="10" maxlength="10" <?php echo 'value="'.date("d-m-Y").'"'; ?>></td>
          <td><input name="SpecRxID" type="text" id="SpecRxID" value="<?php echo $row_spec_rx['spec_rx_id']; ?>" size="2" maxlength="2"></td>
          <td> </td>
          <td> </td>
          <td> </td>
          <td> </td>
          <td> </td>
          <td> </td>
          <td> </td>
          <td> </td>
          <td> </td>
          <td> </td>
          <td> </td>
          <td> </td>
          <td> </td>
          <td> </td>
          <td> </td>
        </tr>
        <tr>
          <td> </td>
          <td>Sph</td>
          <td>Cyl</td>
          <td>Axis</td>
          <td>HPrism</td>
          <td>HPrismBase</td>
          <td>VPrism</td>
          <td>VPrismBase</td>
          <td>NrAdd</td>
          <td>NrHPrism </td>
          <td>NrHPrismBase</td>
          <td>NrVPrism</td>
          <td>NrVPrismBase</td>
          <td>IntAdd</td>
          <td>IntHPrism</td>
          <td>IntHPrismBase</td>
          <td>IntVPrism</td>
          <td>IntVPrismBase</td>
        </tr>
        <tr>
          <td>R</td>
          <td><input name="rsph" type="text" id="rsph" value="<?php echo $row_spec_rx['spec_rx_rsph']; ?>" size="6" maxlength="6">
          </td>
          <td><input name="rcyl" type="text" id="rcyl" value="<?php echo $row_spec_rx['spec_rx_rcyl']; ?>" size="6" maxlength="6">
          </td>
          <td><input name="raxis" type="text" id="raxis" value="<?php echo $row_spec_rx['spec_rx_raxis']; ?>" size="5" maxlength="5"></td>
          <td><input name="rHprism" type="text" id="rHprism" value="<?php echo $row_spec_rx['spec_rx_rhprism']; ?>" size="5" maxlength="5"></td>
          <td>        <select name="rHprismbase" id="rHprismbase">
            <option value="" <?php if (!(strcmp("", $row_spec_rx['spec_rx_rhprismbase']))) {echo "SELECTED";} ?>> </option>
            <option value="OUT" <?php if (!(strcmp("OUT", $row_spec_rx['spec_rx_rhprismbase']))) {echo "SELECTED";} ?>>OUT</option>
            <option value="IN" <?php if (!(strcmp("IN", $row_spec_rx['spec_rx_rhprismbase']))) {echo "SELECTED";} ?>>IN</option>
            </select></td>
          <td><input name="rVprism" type="text" id="rVprism" value="<?php echo $row_spec_rx['spec_rx_rvprism']; ?>" size="5" maxlength="5">
          </td>
          <td><select name="rVprismbase" id="rVprismbase">
            <option value="" <?php if (!(strcmp("", $row_spec_rx['spec_rx_rnvprismbase']))) {echo "SELECTED";} ?>> </option>
            <option value="UP" <?php if (!(strcmp("UP", $row_spec_rx['spec_rx_rnvprismbase']))) {echo "SELECTED";} ?>>UP</option>
            <option value="DN" <?php if (!(strcmp("DN", $row_spec_rx['spec_rx_rnvprismbase']))) {echo "SELECTED";} ?>>DN</option>
          </select></td>
          <td><input name="rNradd" type="text" id="rNradd" value="<?php echo $row_spec_rx['spec_rx_rnadd']; ?>" size="6" maxlength="6"></td>
          <td><input name="rNrHprism" type="text" id="rNrHprism" value="<?php echo $row_spec_rx['spec_rx_rnhprism']; ?>" size="5" maxlength="5"></td>
          <td><select name="rNrHprismbase" id="rNrHprismbase">
            <option value="" <?php if (!(strcmp("", $row_spec_rx['spec_rx_rnhprismbase']))) {echo "SELECTED";} ?>> </option>
            <option value="OUT" <?php if (!(strcmp("OUT", $row_spec_rx['spec_rx_rnhprismbase']))) {echo "SELECTED";} ?>>OUT</option>
            <option value="IN" <?php if (!(strcmp("IN", $row_spec_rx['spec_rx_rnhprismbase']))) {echo "SELECTED";} ?>>IN</option>
          </select></td>
          <td><input name="rNrVprism" type="text" id="rNrVprism" value="<?php echo $row_spec_rx['spec_rx_rnvprism']; ?>" size="5" maxlength="5"></td>
          <td><select name="rNrVprismbase" id="rNrVprismbase">
            <option value="" <?php if (!(strcmp("", $row_spec_rx['spec_rx_rnvprismbase']))) {echo "SELECTED";} ?>> </option>
            <option value="UP" <?php if (!(strcmp("UP", $row_spec_rx['spec_rx_rnvprismbase']))) {echo "SELECTED";} ?>>UP</option>
            <option value="DN" <?php if (!(strcmp("DN", $row_spec_rx['spec_rx_rnvprismbase']))) {echo "SELECTED";} ?>>DN</option>
          </select></td>
          <td><input name="rIntadd" type="text" id="rIntadd" value="<?php echo $row_spec_rx['spec_rx_rintadd']; ?>" size="6" maxlength="6"></td>
          <td><input name="rIntHprism" type="text" id="rIntHprism" value="<?php echo $row_spec_rx['spec_rx_rinthprism']; ?>" size="5" maxlength="5"></td>
          <td><select name="rIntHprismbase" id="rIntHprismbase">
            <option value="" <?php if (!(strcmp("", $row_spec_rx['spec_rx_rinthprismbase']))) {echo "SELECTED";} ?>> </option>
            <option value="OUT" <?php if (!(strcmp("OUT", $row_spec_rx['spec_rx_rinthprismbase']))) {echo "SELECTED";} ?>>OUT</option>
            <option value="IN" <?php if (!(strcmp("IN", $row_spec_rx['spec_rx_rinthprismbase']))) {echo "SELECTED";} ?>>IN</option>
          </select></td>
          <td><input name="rIntVprism" type="text" id="rIntVprism" value="<?php echo $row_spec_rx['spec_rx_rintvprism']; ?>" size="5" maxlength="5"></td>
          <td><select name="rIntVprismbase" id="rIntVprismbase">
            <option value="" <?php if (!(strcmp("", $row_spec_rx['spec_rx_rintvprismbase']))) {echo "SELECTED";} ?>> </option>
            <option value="UP" <?php if (!(strcmp("UP", $row_spec_rx['spec_rx_rintvprismbase']))) {echo "SELECTED";} ?>>UP</option>
            <option value="DN" <?php if (!(strcmp("DN", $row_spec_rx['spec_rx_rintvprismbase']))) {echo "SELECTED";} ?>>DN</option>
          </select></td>
        </tr>
        <tr>
          <td>L</td>
          <td><input name="lsph" type="text" id="lsph" value="<?php echo $row_spec_rx['spec_rx_lsph']; ?>" size="6" maxlength="6">
          </td>
          <td><input name="lcyl" type="text" id="lcyl" value="<?php echo $row_spec_rx['spec_rx_lcyl']; ?>" size="6" maxlength="6">
          </td>
          <td><input name="laxis" type="text" id="laxis" value="<?php echo $row_spec_rx['spec_rx_laxis']; ?>" size="5" maxlength="5"></td>
          <td><input name="lHprism" type="text" id="lHprism" value="<?php echo $row_spec_rx['spec_rx_lhprism']; ?>" size="5" maxlength="5"></td>
          <td><select name="lHprismbase" id="lHprismbase">
            <option value="" <?php if (!(strcmp("", $row_spec_rx['spec_rx_lhprismbase']))) {echo "SELECTED";} ?>> </option>
            <option value="OUT" <?php if (!(strcmp("OUT", $row_spec_rx['spec_rx_lhprismbase']))) {echo "SELECTED";} ?>>OUT</option>
            <option value="IN" <?php if (!(strcmp("IN", $row_spec_rx['spec_rx_lhprismbase']))) {echo "SELECTED";} ?>>IN</option>
          </select></td>
          <td><input name="lVprism" type="text" id="lVprism" value="<?php echo $row_spec_rx['spec_rx_lvprism']; ?>" size="5" maxlength="5">
          </td>
          <td><select name="lVprismbase" id="lVprismbase">
            <option value="" <?php if (!(strcmp("", $row_spec_rx['spec_rx_rvprismbase']))) {echo "SELECTED";} ?>> </option>
            <option value="UP" <?php if (!(strcmp("UP", $row_spec_rx['spec_rx_rvprismbase']))) {echo "SELECTED";} ?>>UP</option>
            <option value="DN" <?php if (!(strcmp("DN", $row_spec_rx['spec_rx_rvprismbase']))) {echo "SELECTED";} ?>>DN</option>
          </select></td>
          <td><input name="lNradd" type="text" id="lNradd" value="<?php echo $row_spec_rx['spec_rx_lnadd']; ?>" size="6" maxlength="6"></td>
          <td><input name="lNrHprism" type="text" id="lNrHprism" value="<?php echo $row_spec_rx['spec_rx_lnhprism']; ?>" size="5" maxlength="5"></td>
          <td><select name="lNrHprismbase" id="lNrHprismbase">
            <option value="" <?php if (!(strcmp("", $row_spec_rx['spec_rx_lnhprismbase']))) {echo "SELECTED";} ?>> </option>
            <option value="OUT" <?php if (!(strcmp("OUT", $row_spec_rx['spec_rx_lnhprismbase']))) {echo "SELECTED";} ?>>OUT</option>
            <option value="IN" <?php if (!(strcmp("IN", $row_spec_rx['spec_rx_lnhprismbase']))) {echo "SELECTED";} ?>>IN</option>
          </select></td>
          <td><input name="lNrVprism" type="text" id="lNrVprism" value="<?php echo $row_spec_rx['spec_rx_lnvprism']; ?>" size="5" maxlength="5"></td>
          <td><select name="rNrVprismbase" id="rNrVprismbase">
            <option value="" <?php if (!(strcmp("", $row_spec_rx['spec_rx_lnvprismbase']))) {echo "SELECTED";} ?>> </option>
            <option value="UP" <?php if (!(strcmp("UP", $row_spec_rx['spec_rx_lnvprismbase']))) {echo "SELECTED";} ?>>UP</option>
            <option value="DN" <?php if (!(strcmp("DN", $row_spec_rx['spec_rx_lnvprismbase']))) {echo "SELECTED";} ?>>DN</option>
          </select></td>
          <td><input name="lIntadd" type="text" id="lIntadd" value="<?php echo $row_spec_rx['spec_rx_lintadd']; ?>" size="6" maxlength="6"></td>
          <td><input name="lIntHprism" type="text" id="lIntHprism" value="<?php echo $row_spec_rx['spec_rx_linthprism']; ?>" size="5" maxlength="5"></td>
          <td><select name="lIntHprismbase" id="lIntHprismbase">
            <option value=""> </option>
            <option value="OUT">OUT</option>
            <option value="IN">IN</option>
          </select></td>
          <td><input name="lIntVprism" type="text" id="lIntVprism" value="<?php echo $row_spec_rx['spec_rx_lintvprism']; ?>" size="5" maxlength="5"></td>
          <td><select name="lIntVprismbase" id="lIntVprismbase">
            <option value="" <?php if (!(strcmp("", $row_spec_rx['spec_rx_lintvprismbase']))) {echo "SELECTED";} ?>> </option>
            <option value="UP" <?php if (!(strcmp("UP", $row_spec_rx['spec_rx_lintvprismbase']))) {echo "SELECTED";} ?>>UP</option>
            <option value="DN" <?php if (!(strcmp("DN", $row_spec_rx['spec_rx_lintvprismbase']))) {echo "SELECTED";} ?>>DN</option>
          </select></td>
        </tr>
        <tr>
          <td> </td>
          <td><input name="pxID" type="text" id="pxID" value="<?php echo $row_spec_rx['px_id']; ?>" size="3" maxlength="3"></td>
          <td colspan="4"><input name="Update" type="submit" id="Update" value="Update"></td>
          <td><select name="userID" id="userID">
            <?php
    do { 
    ?>
            <option value="<?php echo $row_users['user_id']?>"><?php echo $row_users['username']?></option>
            <?php
    } while ($row_users = mysql_fetch_assoc($users));
      $rows = mysql_num_rows($users);
      if($rows > 0) {
          mysql_data_seek($users, 0);
          $row_users = mysql_fetch_assoc($users);
    ?>
          </select></td>
          <td>External
          <input <?php if (!(strcmp($row_spec_rx['ext_rx'],1))) {echo "checked";} ?> name="extRx" type="checkbox" id="extRx" value="checkbox"></td>
          <td> </td>
          <td> </td>
          <td> </td>
          <td> </td>
          <td> </td>
          <td> </td>
          <td> </td>
          <td> </td>
          <td> </td>
          <td> </td>
        </tr>
      </table>
        <input type="hidden" name="MM_update" value="updateSpecRx">
    </form>
    <p> </p>
    </body>
    </html>
    <?php
    mysql_free_result($spec_rx);
    mysql_free_result($users);
    ?>
    Thanks for any help

    This post solves it:
    How do I pass URL parameter after Update record?

  • How to insert new record or update existing record using a complex view?

    Currently I created this screen, there is no problems on display data, only on the update funtionality (it means insert / update / delete on the table for which the view is based on).
    I have a table and a complex view in order to display the information from the table in a tabellar form (i.e up to 70 record in same "record" in the form, one for each item)
    The view is like this
    select a.f1, a.f2, get_value(a.pk1,1) a1, get_value(a.pk1,2) a2, get_value(a.pk1,3) a3............
    from my_table a
    where a.proj_id = user
    and I want to permit the update of the field a1, a2, a3 in a multiposition canvas (tabellar).
    I created an INSTEAD-OF trigger.
    But it not work only in the form. I receive the error FRM-40654 when I try to change the existing value in the running form based on that view.
    The view is woking and updatable using sql-plus.
    If I query
    select * from ALL_UPDATABLE_COLUMNS where table_name = 'SPV_BOQ_BOM_POS_ACTIVITIES';
    in which 'SPV_BOQ_BOM_POS_ACTIVITIES' is the name of my view.
    The question is: why if the view is updatable using SQL*Plus, is not updatable using Oracle Form 10gR2 ?
    Someone could help me asap?
    Thanks

    I removed on the datablock three items that are not showed, one of this is the Sysdate of update on the table for which the view is based.
    I removed also the on-lock trigger and the update from the form is NOT working fine.
    But for now I can still mantaing the ON-LOCK trigger.
    Is not a priority to remove this trigger.
    I still have the problem when the field is null, it mean that in the table SP_BOQ_BOM_POS_ACTIVITIES the record not exist.
    I try now to explayn better.
    SPV_BOQ_BOM_POS_ACTIVITIES is the name of the view.
    SP_BOQ_BOM_POS_ACTIVITIES is the name of the table.
    This are the desc
    desc SPV_BOQ_BOM_POS_ACTIVITIES
    Describing SPV_BOQ_BOM_POS_ACTIVITIES....
    NAME Null? Type
    BOQ_HEADER_ID NOT NULL NUMBER(12,0)
    BB_ID NOT NULL NUMBER(12,0)
    BOQ_ID NOT NULL NUMBER(12,0)
    PROJ_ID NOT NULL VARCHAR2(10)
    ACT_GROUP_CODE VARCHAR2(30)
    TOTAL_QTY NUMBER
    ACT_CODE_1 VARCHAR2(4000)
    QTY_1 NUMBER
    ACT_CODE_2 VARCHAR2(4000)
    QTY_2 NUMBER
    ACT_CODE_3 VARCHAR2(4000)
    QTY_3 NUMBER
    ACT_CODE_4 VARCHAR2(4000)
    QTY_4 NUMBER
    ACT_CODE_5 VARCHAR2(4000)
    QTY_5 NUMBER
    ACT_CODE_6 VARCHAR2(4000)
    QTY_6 NUMBER
    USR_ID NOT NULL VARCHAR2(10)
    LMOD NOT NULL DATE
    INT_REV NOT NULL NUMBER(6,0)
    The field QTY_1, QTY_2.... QTY_6 are calculated with a customer stored function from the table SP_BOQ_BOM_POS_ACTIVITIES.
    Also the field ACT_CODE_1, ACT_CODE_2, .... ACT_CODE_6 are calculated with a customer stored function from the table SP_BOQ_BOM_POS_ACTIVITIES.
    desc SP_BOQ_BOM_POS_ACTIVITIES
    Describing SP_BOQ_BOM_POS_ACTIVITIES....
    NAME Null? Type
    BBPA_ID NOT NULL NUMBER(12,0)
    BOQ_HEADER_ID NOT NULL NUMBER(12,0)
    BB_ID NOT NULL NUMBER(12,0)
    BOQ_ID NOT NULL NUMBER(12,0)
    PROJ_ID NOT NULL VARCHAR2(10)
    ACT_GROUP_CODE NOT NULL VARCHAR2(30)
    ACT_CODE NOT NULL VARCHAR2(30)
    QTY NUMBER(12,0)
    FLG_MANUAL_CHANGE VARCHAR2(1)
    USR_ID NOT NULL VARCHAR2(10)
    LMOD NOT NULL DATE
    INT_REV NOT NULL NUMBER(6,0)
    If I use SQL Navigator this insert working fine
    insert into SPV_BOQ_BOM_POS_ACTIVITIES
    (BOQ_HEADER_ID, BB_ID, BOQ_ID, PROJ_ID, ACT_GROUP_CODE, ACT_CODE_1, QTY_1)
    values (5050, 5015, 30486, 'B39368', 'TEST', '0101010101010101', 1709)
    1 row(s) inserted
    Instead using the Screen, at runtime, I receive the message:
    FRM-40400 Transation Complete: 1 records applied and saved
    but nothing is saved in the table SP_BOQ_BOM_POS_ACTIVITIES, and the view SPV_BOQ_BOM_POS_ACTIVITIES contain the calculated QTY_1 for the 'key', with null value.
    Moreover If in the field QTY_1 (NUMBER) I put a character, instead a Number, just to see if the Screen attempts or not an UPDATE or AN INSERT, the message is FRM-40509: Oracle Error. UNABLE TO UPDATE RECORD. Why happen an Update and not an INSERT using the Screen?
    In effect, the trial using SQL navigator of the following statement
    insert into SPV_BOQ_BOM_POS_ACTIVITIES
    (BOQ_HEADER_ID, BB_ID, BOQ_ID, PROJ_ID, ACT_GROUP_CODE, ACT_CODE_1, QTY_1)
    values (5050, 5015, 30486, 'B39368', 'TEST', '0101010101010101', 'r');
    I got Invalid Number and it's ok as answer from the database.
    Edited by: fmariani on 30-apr-2009 1.51

  • How to insert a space-bar in the Muse CC master slide page property metadata

    I'm using the latest version of Muse CC and need to know how to insert a space-bar in the master slide page property metadata page title suffix area

    I found it.  If anyone else has this problem press the shift and \ at the same time on a standard windows keyboard.

  • How to insert null record (some col) in table using loop

    Hi,
    How to insert null record (for some columns) in table using loop.
    sample data of x_tab
    order_id order_name
    231 xxx
    123
    345
    111 vvvv
    Thanks,
    Lakshman
    Edited by: kolipaka on Jul 5, 2012 1:37 PM

    You have a table
       CREATE TABLE tab (
          col1  NUMBER,
          col2  NUMBER,
          col3  NUMBER,
          col4  NUMBER
          col5  NUMBER)Now you insert:
       INSERT INTO tab (col2, col4) VALUES (5, 7);col1, col3 and col5 are NULL by default (there is no DEFAULT clause for these columns so they are NULL).

  • How to track updates in Master Table?

    hi all
    I have few Master tables like MRP Controllers , Asset Classes, reason for Investment etc.I have got the master tables that store these information. but standard IDocs are not present for those Master data.
    My requirement is , whenever new Master data is added / or existing master data is updated in these tables , i immediatly want to send that changed/newly added data to legacy system.
    what are the different ways to track these changes and send it to legacy system ?
    Regards
    Sheetal

    Hi Sheetal,
    You can also check the user exits for the same.
    Most of the master data creation program has the user exits associated with them at the new data creation.
    So you can explore that option also.
    Reward points if useful.
    Regards,
    Atish

  • How To Hide the Record after Update from ADF Front End

    Hi Every One,
    I have done the Scenario of Database Table rows displayed in ADF front end. It is editing and updating also. My Query is after update the record, how to hide that record from adf front end.
    Could any one please help me.
    Thanks,
    Narasimhulu.S

    hi you can create transient field in view object indicate to visibility of row (boolean ) and create view criteria that show only rows that are able to be visible according to transient attribute and at the update process set the attribute to true inside entityImpl class

  • I have a macbook pro core i7 mid 2012 And update to the latest version 10.8.4 system after updating the system I have the problem appeared to take off the device and stops at the apple logo for about 5 minutes and then enters the desktop How can I solve t

    I have a macbook pro core i7 mid 2012
    And update to the latest version 10.8.4 system after updating the system I have the problem appeared to take off the device and stops at the apple logo for about 5 minutes and then enters the desktop How can I solve this problem and thank you

    If you have more than one user account, these instructions must be carried out as an administrator.
    Launch the Console application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Console in the icon grid.
    Step 1
    Make sure the title of the Console window is All Messages. If it isn't, select All Messages from the SYSTEM LOG QUERIES menu on the left. If you don't see that menu, select
    View ▹ Show Log List
    from the menu bar.
    Enter "BOOT_TIME" (without the quotes) in the search box. Note the timestamps of those log messages, which refer to the times when the system was booted. Now clear the search box and scroll back in the log to the last boot time when you had the problem. Select the messages logged after the boot, during the time something abnormal was happening. Copy them to the Clipboard (command-C). Paste into a reply to this message (command-V).
    For example, if the problem is a slow startup taking three minutes, post the messages timestamped within three minutes after the boot time, not before. Please include the BOOT_TIME message at the beginning of the log extract.
    If there are runs of repeated messages, post only one example of each. Don’t post many repetitions of the same message.
    When posting a log extract, be selective. In most cases, a few dozen lines are more than enough.
    Please do not indiscriminately dump thousands of lines from the log into this discussion.
    Important: Some private information, such as your name, may appear in the log. Anonymize before posting.
    Step 2
    Still in Console, look under System Diagnostic Reports for crash or panic logs, and post the entire contents of the most recent one, if any. In the interest of privacy, I suggest you edit out the “Anonymous UUID,” a long string of letters, numbers, and dashes in the header of the report, if present (it may not be.) Please don’t post shutdownStall, spin, or hang logs — they're very long and not helpful.

  • If record is in application server how do u update the single table

    hi
    could anybody tel me
    if record is in application server how do u update the single table
    by using direct input method

    If your Flash player/plugin is older, the only way is to go to Adobe's site (use Limnos' link) and download the full installer. A .DMG file, which you doubleclick to have it mount on the desktop. Inside is the Flash installer app you doubleclick to run and have it upgrade all. Will need an Admin user account.
    After you've upgraded to the latest & greatest, currently 11.5.502.110, a Flash perfpane will show up in System Preferences, where you can set it to auto-update itself, warn you of new updates or manually check for same.

  • Hey,... My battery extremely drained after update the last iOS, My iphone must be charged less than 7 hour,.... How could it be?

    Hey,... My battery extremely drained after update the last iOS, My iphone must be charged less than 7 hour,.... How could it be?

    Hey,... My battery extremely drained after update the last iOS, My iphone must be charged less than 7 hour,.... How could it be?

  • How do I get back into my iPad after updating the iOS?

    how do I get back into my iPad after updating the iOS?

    What do you mean? Why can you not access the iPad?

  • HT1766 my iphone 4 is stuck in restore after updating the lasted version.  It was working fine before.How do I get it working again?

    my iphone 4 is stuck in restore after updating the lasted version.  It was working fine before.How do I get it working again?

    Hello, fschris. 
    Thank you for visiting Apple Support Communities.
    When experiencing issues updating or restoring an iPhone, here are the best articles to go through.  If you received a specific error number when restoring, see the section labeled Get more help in the second article below.
    If you can't update or restore your iOS device
    http://support.apple.com/kb/ht1808
    Resolve iOS update and restore errors in iTunes
    http://support.apple.com/kb/ts1275
    Cheers,
    Jason H.

  • How to make the document dirty after updating the links?

    Hi,
    I am using the below code to update the link resources by providing new URI. The link resources are getting updated, but the document is not becoming dirty.
                    InterfacePtr<ICommand> updateCmd(CmdUtils::CreateCommand(kLinkResourceStateUpdateCmdBoss));
                    InterfacePtr<ILinkResourceStateUpdateCmdData> updateCmdData(updateCmd, UseDefaultIID());
                    updateCmdData->SetResource(ref.GetUID());
                    updateCmdData->SetDatabase(ref.GetDataBase());
                    updateCmdData->SetNotify(true);
                    updateCmdData->SetUpdateAction(ILinkResourceStateUpdateCmdData::kUpdateURI);
                    updateCmdData->SetURI(newURI);
                    updateCmd->SetUndoability(ICommand::kRegularUndo);
                    CmdUtils::ProcessCommand(updateCmd);
    How do I make the document dirty after updating the resources?
    Thanks,

    Thanks. It is working fine.
    I called PreDirty(docPtr), before updating the links.

  • Execute a SQL-Insert after update the target

    Hi to All,
    my scenario is   SQL_1 -> XI -> SQL_2, but after update the SQL_2, I need to execute an SQL-insert. Can I do this without BPM?
    Regarts
    Roberto

    Hi Roberto,
    If you want to insert the SQL_2 after updation of SQL_2 then BPM is not required.
    After updating the target you can execute the insert operation. I think , you can go for Stored procedures here.
    But if you want Response back to XI after successful Update, then BPM is required.
    >>You can do this in the stored procedure. For e.g just check this blog-
    /people/siva.maranani/blog/2005/05/21/jdbc-stored-procedures
    Regards,
    Moorthy
    Message was edited by: Krishna Moorthy P

Maybe you are looking for

  • How do I delete cascade with a PL/SQL procedure?

    This script will create a PL/SQL procedure that deletes cascade. This is a post to contribute to the Oracle community. Take the code as is and test it before you use it in production. Make sure this is what you want. Procedure Delete Cascade (prc_del

  • Tempo setting when creating Apple Loops (Utility)

    Having chopped a long audio file (drum track) into exact bar/beat settings, saved as separate audio files, I'm having trouble with tempo settings when creating Loops in Apple Loops Utility. The problem is that after saving a looped file (from the Uti

  • Buying a TV Show and then putting it onto DVD

    Is there a way to buy TC shows and then burn them onto a DVD disco or does iTunes not allow you to do this

  • "Recent Items" is really confused and inconsistent

    Is there any way to get "Recent Items" to be the same in all applications? Basically, I have two sets of "Recent Items". The "Recent Items" in Safari and Mail are almost always wrong and do not get updated. I just now cleared by Recent Items from the

  • Change PowerPivot data source when deploying from Dev - Staging - Production

    We have PowerPivot workbooks we store in SharePoint 2013 Libraries.  We have a powershell script which automates the deployment of sites and pages. Is there a way using PowerShell (or any scripting language really) to look into the workbook and chang