Delete Record Automatically deleting

I have been trying to see if anyone has had this same issue with no real luck. I was hoping someone could give me a quick hand. I am created a delete record page as you would usually do. It is supposed to populate like any other page first so that yiou see the user's information. You should then be able to hit the delete button to delete the actual record. Unfortunately as soon as you go to the page it automatically deletes the record not giving you a chance to review the file first.
Here is the standard delete record code from Dreamweaver:
if ((isset($_GET['ID'])) && ($_GET['ID'] != "")) {
  $deleteSQL = sprintf("DELETE FROM entry WHERE ID=%s",
                       GetSQLValueString($_GET['ID'], "int"));
  mysql_select_db($database_toyosupport, $toyosupport);
  $Result1 = mysql_query($deleteSQL, $toyosupport) or die(mysql_error());
  $deleteGoTo = "/support/EnterDealer/Admin_Edit_dealer.php";
  if (isset($_SERVER['QUERY_STRING'])) {
    $deleteGoTo .= (strpos($deleteGoTo, '?')) ? "&" : "?";
    $deleteGoTo .= $_SERVER['QUERY_STRING'];
  header(sprintf("Location: %s", $deleteGoTo));
My form is pretty basic:
<form action="/support/EnterDealer/Admin_Edit_dealer.php" method="post" name="delete_User" id="delete_User">
Form is set to post so i can;t see any reason it should automatically delete the file.
Any ideas? 

OK so thi sis not the "RIGHT" answer as I still don't know why it is automatically deleting. But with that in mind all I did was create a "View" page stating "ARE YOU SURE YOU WOULD LIKE TO DLETE THIS USER?" After that they are then sent to the delete record page which then deletes the record. If anyone wants to take a stab at it here is the complete code for the "delete" page. There may be something i am just not seeing ...
<?php  session_start(); ?>
<?php require_once('../../Connections/toyosupport.php'); ?>
<?php
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;
if ((isset($_GET['ID'])) && ($_GET['ID'] != "")) {
  $deleteSQL = sprintf("DELETE FROM entry WHERE ID=%s",
                       GetSQLValueString($_GET['ID'], "int"));
  mysql_select_db($database_toyosupport, $toyosupport);
  $Result1 = mysql_query($deleteSQL, $toyosupport) or die(mysql_error());
  $deleteGoTo = "/support/EnterDealer/Admin_Edit_dealer.php";
  if (isset($_SERVER['QUERY_STRING'])) {
    $deleteGoTo .= (strpos($deleteGoTo, '?')) ? "&" : "?";
    $deleteGoTo .= $_SERVER['QUERY_STRING'];
  header(sprintf("Location: %s", $deleteGoTo));
$colname_rsDEALERLIST = "-1";
if (isset($_POST['ID'])) {
  $colname_rsDEALERLIST = $_POST['ID'];
mysql_select_db($database_toyosupport, $toyosupport);
$query_rsDEALERLIST = sprintf("SELECT * FROM entry WHERE ID = %s", GetSQLValueString($colname_rsDEALERLIST, "int"));
$rsDEALERLIST = mysql_query($query_rsDEALERLIST, $toyosupport) or die(mysql_error());
$row_rsDEALERLIST = mysql_fetch_assoc($rsDEALERLIST);
$totalRows_rsDEALERLIST = mysql_num_rows($rsDEALERLIST);
?>
<!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" xml:lang="en" lang="en" dir="ltr">
<head>
</head>
<!--<body oncontextmenu="return false;">-->
<body>
<form method="post" name="delete_User" id="delete_User">
  <table border="0" cellspacing="0" cellpadding="3" align="center" bgcolor="#FFFFFF" width="100%">
    <tr valign="top" bgcolor="#FFFFFF">
      <td colspan="3" bgcolor="#3399CC" class="BoldTextBLK"><font class="drupal_blend_9pt">Please
        enter ALL  information.
        <input name="ID" type="hidden" id="ID" value="<?php echo $row_rsDEALERLIST['ID']; ?>" />
      </font></td>
    </tr>
    <tr valign="top" bgcolor="#FFFFFF">
      <td width="38%" bgcolor="#FFFFFF"><span class="Drupal_Blend_9pt">First
        Name/Pr&eacute;nom <br />
        </font></span></td>
      <td width="14%" colspan="2" bgcolor="#FFFFFF"><?php echo $row_rsDEALERLIST['Name']; ?></td>
    </tr>
    <tr valign="top" bgcolor="#FFFFFF">
      <td width="38%" bgcolor="#FFFFFF"><span class="Drupal_Blend_9pt"><font class="drupal_blend_9pt">Last
        Name/Nom</font></span></td>
      <td colspan="2" bgcolor="#FFFFFF"><?php echo $row_rsDEALERLIST['NameLast']; ?></td>
    </tr>
    <tr valign="top" bgcolor="#006699">
      <td height="5" bgcolor="#FFFFFF"> </td>
      <td height="5" colspan="2" bgcolor="#FFFFFF"><?php echo $row_rsDEALERLIST['Password']; ?></td>
    </tr>
    <tr valign="top" bgcolor="#FFFFFF">
      <td bgcolor="#FFFFFF"><span class="Drupal_Blend_9pt"><font class="drupal_blend_9pt">Store
        Number <font size="1">(Toyo Account #)</font></font></span></td>
      <td colspan="2" bgcolor="#FFFFFF"><?php echo $row_rsDEALERLIST['DealerNumber']; ?></td>
    </tr>
    <tr valign="top" bgcolor="#FFFFFF">
      <td width="38%" bgcolor="#FFFFFF"><span class="Drupal_Blend_9pt"><font class="drupal_blend_9pt">Company
        Name/Nom du D&eacute;taillant </font></span></td>
      <td colspan="2" bgcolor="#FFFFFF"><?php echo $row_rsDEALERLIST['Company']; ?></td>
    </tr>
    <tr valign="top" bgcolor="#FFFFFF">
      <td bgcolor="#FFFFFF"><span class="Drupal_Blend_9pt"><font class="drupal_blend_9pt">Address/Adresee</font></span></td>
      <td colspan="2" bgcolor="#FFFFFF"><?php echo $row_rsDEALERLIST['Address']; ?></td>
    </tr>
    <tr valign="top" bgcolor="#FFFFFF">
      <td bgcolor="#FFFFFF"><span class="Drupal_Blend_9pt"><font class="drupal_blend_9pt">City/Ville</font></span></td>
      <td colspan="2" bgcolor="#FFFFFF"><?php echo $row_rsDEALERLIST['City']; ?></td>
    </tr>
    <tr valign="top" bgcolor="#FFFFFF">
      <td bgcolor="#FFFFFF"><span class="Drupal_Blend_9pt"><font class="drupal_blend_9pt">Province</font></span></td>
      <td colspan="2" bgcolor="#FFFFFF"><?php echo $row_rsDEALERLIST['DealerProv']; ?></td>
    </tr>
    <tr valign="top" bgcolor="#FFFFFF">
      <td bgcolor="#FFFFFF"><span class="Drupal_Blend_9pt"><font class="drupal_blend_9pt">Postal
        Code/Code Postal</font></span></td>
      <td colspan="2" bgcolor="#FFFFFF"><?php echo $row_rsDEALERLIST['PostalCode']; ?></td>
    </tr>
    <tr valign="top" bgcolor="#FFFFFF">
      <td bgcolor="#FFFFFF"><span class="Drupal_Blend_9pt"><font class="drupal_blend_9pt">Email/Courriel</font></span></td>
      <td colspan="2" bgcolor="#FFFFFF"><?php echo $row_rsDEALERLIST['EmailAddress']; ?></td>
    </tr>
    <tr valign="top" bgcolor="#FFFFFF">
      <td bgcolor="#FFFFFF"><span class="Drupal_Blend_9pt"><font class="drupal_blend_9pt">Phone/Num&eacute;ro</font></span></td>
      <td colspan="2" bgcolor="#FFFFFF"><?php echo $row_rsDEALERLIST['Phone']; ?></td>
    </tr>
    <tr valign="top" bgcolor="#FFFFFF">
      <td bgcolor="#FFFFFF"><span class="Drupal_Blend_9pt"><font class="drupal_blend_9pt">Fax</font></span></td>
      <td colspan="2" bgcolor="#FFFFFF"><?php echo $row_rsDEALERLIST['Fax']; ?></td>
    </tr>
    <tr valign="top" bgcolor="#006699">
      <td height="5" bgcolor="#FFFFFF"><span class="Drupal_Blend_9pt">Price List</span></td>
      <td height="5" colspan="2" bgcolor="#FFFFFF"><?php echo $row_rsDEALERLIST['Plist_0']; ?><br />
        <?php echo $row_rsDEALERLIST['Plist_U']; ?> <br />
        <?php echo $row_rsDEALERLIST['Plist_G']; ?></td>
    </tr>
    <tr valign="top" bgcolor="#FFFFFF">
      <td colspan="3" bgcolor="#FFFFFF"><font class="drupal_blend_9pt"> </font></td>
    </tr>
    <tr valign="top" bgcolor="#FFFFFF">
      <td width="38%" align="right" bgcolor="#FFFFFF"><font class="drupal_blend_9pt"><b>Delete record.</b></font><font color="#FF0000">Note this is permanent!</font></td>
      <td colspan="2" bgcolor="#FFFFFF"><font class="drupal_blend_9pt">
        <input name="Delete_User" type="submit" id="Delete_User" value="Delete_User" />
      </font></td>
    </tr>
  </table>
</form>
</body>
</html>
<?php
mysql_free_result($rsDEALERLIST);
?>

Similar Messages

  • Server DNS record automatically deleted

    We built a new file server 10 days ago. When we set it up it would have gotten a dhcp address which then we converted it into having a static ip address.
    8 days later the DNS Record for the server automatically got deleted. This was not setup as a static record in DNS as it would have had a time stamp on it. The server was online the whole time and was not rebooted. What would cause the DHCP record of the
    file server to automatically get deleted when this has never happened when setting up new servers or productions servers as none of our staff deleted the record.

    Hi,
    The reord is first registered by DHCP server, so the owner would be the DHCP server. And only DHCP server could change the record. Once the lease in DHCP is expired, the record will be deleted.
    Just reigster the record manually, if it is deleted again, then it should be a problem. But I don't think it will happen.

  • Deleted Items automatically deletes contents

    For my .Mac account...if I deleted a message from the iPhone to the deleted items folder on the server, the message ultimately gets deleted after a day or so. I have the iPhone set to never delete messages as I only want to delete messages manually from the deleted items folder when I'm in Entourage or on the .Mac website -- and at my choosing. Seems to be automatic now.
    I did not have this problem with .Mac and a Windows Mobile device. Any ideas? Thanks, in advance.

    Check info:
    1.      Could you tell the version of exchange and outlook? Currently, I assume it’s exchange 2003
    Exchange 2007
    2.      Is there any other user got same issue?
    No other users seem to be effected.
    3.      What’s the setting of AutomateProcessing?
    Currently set to "None"
    4.      Quote: “user has never created a rule in his life”
    Does it mean there are no rules in “Rules and Alerts” option in the “Tools” menu?
    Yes
    5.      Please move the mailbox of the problematic user to another mailbox store, which can fix the corruption of mailbox, including corrupted rules (If has)
    Single Exchange server installation. Do not have another mailbox store.
    Just me and me alone keeps this ship afloat!

  • Automatically deleting records

    Hello.
    Is it possible to delete a record automatically in a workflow (based on some criteria)?
    Regards, Anders

    Hi Anders,
    We want to use MDM for our catalog (100' products/materials). In this catalog we have priceconditions (4 millions) and these priceconditions has an expired date and I want to delete records that has expired. I also have an issue when I do the import of the priceconditions. The files containes products/materials that I don't have in my catalog, thus I don't want to import these. This has become a problem, I have tried to set the MDIS unmapped handlig to fail, but this makes the importing of the priceconditions very slow. Thus I thought I could map them to NULL and then run a workflow where I could delete the unwanted records (but as you replayed earlier, an other workaround for this has to be done).
    According to me, For the first half of your problem, where you want to delete the records  whose price conditionds have expired.
    What you can do is a Search based on Pricing Condition. That will fetch you the records which you want to delete. You will have to delete these records manually. There is no other way to delete records automatically.
    For the second half of the problem, where the Import File has some new Materials/Products which you do not want to import.
    You can deal with this problem by selecting a proper matching Field. And then Select the proper Default Import Action.
    You will have to choose "Skip" for the new materials which do not want to Import. If you only want to update the materials which are already existing in MDM, then you will have to choose " Update All Map fields". Save both these properties in a map if your requirement is consistent.
    I hope I have understood your requirement correctly.
    Hope it helps.
    Thanks and Regards
    Nitin jain

  • How to delete my email on my iPad and have it automatically delete the same email on my iPhone and iMac?

    How to delete an email on an apple device and have that deleted email automatically delete from my iPhone and iMac?

    You need an IMAP type email account a opposed to POP 3. Google the two words together to find out more.

  • Is there a way to delete records from MDM automatically?

    Is there a way to delete records from MDM automatically?
    I am able to import the data automatically through MDIS, but I have to delete the data first. Itu2019s possible to do it ?

    Hi Adam,
    Current scenario
    USER1: call ME to delete old catalog data
    ME: open the MDM & delete it manually
    USER1: Transaction to extract new data file
    MDIS: load the data to catalog
    As per your requirement, you should save map in following way which can solve your purpose. Create a XML file which should consist of new and existing records. So in import Manager, for newly added records you need to set Default Import Action as Create and for existing records you should use or set Default Import Action as Replace and then should save in map.
    So using this every-time if new record comes (not available in data manager), it will get created and for existing record (already available in Data Manager) it will replace (which means delete the existing record (old catalog data) and create a new record).
    Regards,
    Mandeep Saini

  • Best approach to delete records that are not in the source table anymore.

    I have a situation where I need to remove records from dimensions that are not in the source data anymore. Right now we are not maintaing history, i.e. not using SCD but planning for the next release. If we did that it would be easy to figure the latest records. The load is nightly and records are updated and new added.
    The approach that I am considering is to join the dimension tables the the sources on keys and delete what doesn't join. However, is there perhaps some function in OWB that would allow to do this automatically on import so it can be also in place for the future?
    Thanks!

    Bear in mind that deleting dimension records becomes problematic if you have facts attached to them. Just because this record is no longer in the active set doesn't mean that it wasn't used historically, and so have foreign key constraints on it in your database. IF this is the case, a short-term solution would be to add an expiry_date field to the dimension and update the load to set this value when the record disappears rather than to delete it.
    And to do that, use the target dimension as a source table, outer join it to the actual source table on the natural key, and so your update will set expiry_date=nvl(expiry_date,sysdate) to set to sysdate if this record has not already been expired on all records where the outer join fails.
    Further consideration: what do you do if the record is re-inserted into the source table? create a new dimension key? Or remove the expiry date?
    But I will say that I am not a fan of deleting records in most circumstances. What do you do if you discover a calculation error and need to fix that and republish historical cubes? Without the historical data, you lose the ability to do things like that.

  • Delete Records in R/3 reflected in BI ?

    Hi All,
    I have the following scenario, when the planned order is converted to the production order, the planned order will be deleted from the R/3 table (PLAF). I understand in BI delta processing can handle the deletion in R/3 in case that the R/3 system generates another cancelled record or marks a flag for deletion.
    However, in this scenario, the record is deleted completely from the table, and we want this deletion affects the BI system automatically. I am not quite sure that BI Delta processing can handle this situation
    Can andvise me on this
    Thanks
    BR
    Zan

    Hi...usually the startegy in R/3 for cancellation is document reversal..(like in MM they use movement types to specify the cancellation ).
    Now since they are deleting the records so what you can do is ...check if the reference of planned order is maintained in production order..(like the info of purcahse requisition etc are available in purchase order ).
    Basic purpose is to find the info of deleted planned order from production order table...and load that data in some dso and do comparison.. in BW and do selective deletion at BW level.
    Whole process can be automated in this way.
    Regards,
    RK

  • Automatic Deletion in Infopackage

    Hello all,
    I have this problem, Im writing an ABAP routine in an infopackage for automatic deletion.  The code ran with no errors but in the code I specified that I didnt want the previous package to be deleted if the new package has less records than the previous.  The code is as follows:
    <i>program conversion_routine.
    form compute_ZSD_DESC
      tables l_t_request_to_delete structure rsreqdelstruc
      using l_request like rsreqdone-rnr
      changing p_subrc like sy-subrc.
    TABLES: RSMONICTAB.
    DATA: rsmonictab1 LIKE RSMONICTAB OCCURS 0 WITH HEADER LINE.
    DATA: curr_records type i,
          prev_records type i.
       select * from rsmonictab into rsmonictab1
       where infocube = 'ZSD_DESC'.
         sort rsmonictab1 descending by timestamp.
           read table rsmonictab1 index 1.
           curr_records = rsmonictab1-req_insert.
           read table rsmonictab1 index 2.
           prev_records = rsmonictab1-req_insert.
           multiply curr_records by '.8'.
      loop at l_t_request_to_delete.
           if prev_records <= curr_records and RSMONICTAB1-rnr = l_t_request_to_delete-rnr .
             delete l_t_request_to_delete.
           endif.
         endloop.
       endselect.</i>
    Im not sure if this routine in the infopackage runs before the new record is added to the table, because if it is, then I wont be able to use a routine in the infopackage.  If thats the case, does any body know another way to do this?.
    Thanks so much
    Message was edited by:
            Pizza Girl

    Ok so Ive been doing some changes to my program that Im including in my process chain, the code reads as follows:
    <i>REPORT  ZPAQUETES_TEST.
    data: irsiccont LIKE RSICCONT OCCURS 0 WITH HEADER LINE.
    data: rsmonictab1 LIKE RSMONICTAB OCCURS 0 WITH HEADER LINE.
    data: l_lines type d.
    data: v_SELECTIONS type table of  BAPI6109SEL,
          v_INFOCUBES type table of  BAPI6109IC,
          v_THIRD_PARTY_PARAMS type table of  BAPI6109TCP,
          v_RETURN type table of  BAPIRET2.
    DATA: curr_records type i,
          prev_records type i.
    DATA: RNR1(30) TYPE C,
          RNR2(30) TYPE C.
    DATA: V_INFOCUBE TYPE TABLE OF RSICCONT-ICUBE.
    SELECT * FROM RSICCONT INTO TABLE IRSICCONT
    WHERE ICUBE = 'zsd_desc'.
    DESCRIBE TABLE IRSICCONT LINES L_LINES.
    IF L_LINES GT 0.
    SELECT * FROM RSMONICTAB INTO TABLE rsmonictab1
    FOR ALL ENTRIES IN IRSICCONT
    WHERE RNR = IRSICCONT-RNR.
    ENDIF.
    CALL FUNCTION 'BAPI_IPAK_GETDETAIL'
    EXPORTING
       INFOPACKAGE              = 'ZPAK_A7U7VI5RNB5N5A87RBWXFBMEA'
      TABLES
        SELECTIONS               = v_SELECTIONS
        INFOCUBES                = v_INFOCUBES
        THIRD_PARTY_PARAMS       = v_THIRD_PARTY_PARAMS
        RETURN                   = v_RETURN.
    SORT rsmonictab1 descending  by TIMESTAMP.
    read table rsmonictab1 index 1.
      MOVE RSMONICTAB1-REQ_INSERT TO CURR_RECORDS.
      MOVE RSMONICTAB1-RNR TO RNR1.
    READ TABLE RSMONICTAB1 INDEX 2.
      MOVE RSMONICTAB1-REQ_INSERT TO PREV_RECORDS.
      MOVE RSMONICTAB1-RNR TO RNR2.
    IF SY-SUBRC EQ 0.
    CALL FUNCTION 'RSSM_DELETE_REQUEST'
      EXPORTING
        REQUEST                  = RNR2
        INFOCUBE                 = 'ZSD_DESC'.
    ENDIF.</i>
    but its still not doing anything, can anyone help me please?????
    Message was edited by:
            Pizza Girl
    Message was edited by:
            Pizza Girl

  • Help automatic delete of request after update

    Hi all,
    i need to configure an InfoPackage so it automatically delete a previus request on this condition:
    - The previous request is on the same month or..
    - The new request is into the five days of the next month.
    So if an old request is from 23/12/2006 and new request is form 04/01/2007 the old request must be deleted.
    But if the new request is from 06/01/2007 or beyond, the old request must not be deleted.
    How can i solve this ?
    thx in advance

    I dont have a sample code, but I can give you the logic which can help you program. Copy the infopackage id which will be something like...ZPAK_3V1PWX599NZE5NR5W2XD5BEU9. Now go to the table RSREQDONE, give this infopackage id for the field logdpid and it will show you all the requests that are loaded using this infopackage. Now sort the entries in the table in a descending order using TDATUM and TUZEIT fields (first by TDATUM and then by TUZEIT). Once this is done, select the first entry (which will be the latest load) and write the routine based on the TDATUM field. If TDATUM lies in the same month, then delete the request whose Request ID number is the same as the RNR number in the record you selected from RSREQDONE (the request id will be like...REQU_449W4IE405ZSI25W9WLXAB3FH). Else do not delete.
    Hope this helps. Also, please paste the code here for future reference incase you were successful deleting the requests according to your selections.

  • Can we  change datatype  without deleting records ?

    Hi all ;
    Without deleting records in a table  , can we  change datatype in oracle 10g and 11g ?
    SQL> desc emp
    Name                                      Null?    Type
    NO                                                 NUMBER
    NAME                                            VARCHAR2(10)
    CITY                                               VARCHAR2(15)
    DEP_ID                                          NUMBER
    SQL> select * from emp;
            NO NAME       CITY                DEP_ID
            1   madhir   calcutta                10
    SQL> alter table emp modify(dep_id  varchar2(5));
    alter table emp modify(dep_id varchar2(5))
    ERROR at line 1:
    ORA-01439: column to be modified must be empty to change datatype
    SQL>  select * from v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE    11.2.0.1.0      Production
    TNS for Linux: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production

    See 'Modifying an Existing Column Definition' in the DBA Guide
    http://docs.oracle.com/cd/B28359_01/server.111/b28310/tables006.htm#i1006645
    Use the ALTER TABLE...MODIFY statement to modify an existing column definition. You can modify column datatype, default value, column constraint, column expression (for virtual columns) and column encryption.
    You can increase the length of an existing column, or decrease it, if all existing data satisfies the new length. You can change a column from byte semantics to CHAR semantics or vice versa. You must set the initialization parameter BLANK_TRIMMING=TRUE to decrease the length of a non-empty CHAR column.
    If you are modifying a table to increase the length of a column of datatype CHAR, realize that this can be a time consuming operation and can require substantial additional storage, especially if the table contains many rows. This is because the CHAR value in each row must be blank-padded to satisfy the new column length.
    And the ALTER TABLE statement in the SQL Language doc
    http://docs.oracle.com/cd/B28359_01/server.111/b28286/statements_3001.htm#SQLRF01001
    modify_col_properties
    Use this clause to modify the properties of the column. Any of the optional parts of the column definition (datatype, default value, or constraint) that you omit from this clause remain unchanged.
    datatype You can change the datatype of any column if all rows of the column contain nulls. However, if you change the datatype of a column in a materialized view container table, then Oracle Database invalidates the corresponding materialized view.
    You can omit the datatype only if the statement also designates the column as part of the foreign key of a referential integrity constraint. The database automatically assigns the column the same datatype as the corresponding column of the referenced key of the referential integrity constraint.
    You can always increase the size of a character or raw column or the precision of a numeric column, whether or not all the rows contain nulls. You can reduce the size of a datatype of a column as long as the change does not require data to be modified.The database scans existing data and returns an error if data exists that exceeds the new length limit.

  • Deleting records from a recursive table query

    Hi All,
    I have the follow query, I would like to ask for your help, please: we use recursive tables for various purposes and one of them may have 100,000's records.
    What would be the best approach to delete records from such a table?
    I was thinking about two below, but any additional one will be more than welcome as well:
    (1) I can DELETE FROM my_table WHERE my_table_id IN (SELECT my_table_id FROM my_table START WITH my_table_parent_id = X CONNECT BY PRIOR my_table_id = my_table_parent_id, but it means that I will run on my_table twice, no?
    (2) I thought also to create a Foreign Key of my_table_id REFERENCES my_table_parent_id, but then I am afraid it will effect DML commands on that table.
    Thank you in advance

    Hi,
    kdwolf wrote:
    ... (1) I can DELETE FROM my_table WHERE my_table_id IN (SELECT my_table_id FROM my_table START WITH my_table_parent_id = X CONNECT BY PRIOR my_table_id = my_table_parent_id, but it means that I will run on my_table twice, no?Sorry, I'm not sure whqt you mean by "I will run on my_table twice". Assuming you don't already have a foreign key constraint (as you described below) I don;t know any other way, let alone a more efficient way, to get the same results.
    (2) I thought also to create a Foreign Key of my_table_id REFERENCES my_table_parent_id, but then I am afraid it will effect DML commands on that table.You're right; a foreign key constraint always costs a little whenever you do DML. Someone who knows your application and your system as well as you do will have to decide if the benefit of having accurate, consistent data justifies that additional cost. If you're not sure, I suggest you add the constraint.
    One advantage of having a foreign key constraint is that you can create it with the "ON DELETE CASCADE" option. Then, if you simply say "DELETE FROM my_table WHERE my_table_patrent_id = X", all the descendants of those rows will automatically be deleted, exactly as you requested in (1) above.

  • Deleting Records from Referential Tables

    Hi,
    Can anyone help me in deleting records from tables in a hierarcial manner. For e.g C refers B and B refers A. I need to delete data from all three tables related to a where clause in A.I tried using User_constraints and User_cons_columns views. But i am not able to find a hierarchial delete statement.
    Venkatesh

    Did you look into the option of specifying ON DELETE CASCADE for your foreign key constraints. That way, if you delete a
    row from the master table Oracle will automatically go and delete the child rows. Take a look at the following script.
    Here, when I delete a row from table A for NUM = 1 the child rows from table B (WHERE num = 1) are automatically deleted.
    drop table b
    drop table a
    create table a (num number, name varchar2(40))
    create table b (num number, name varchar2(40))
    alter table a add constraint pk_a primary key(num)
    alter table b add constraint fk_b_num foreign key (num) references a(num) on delete cascade
    insert into a values (1, 'Test#1')
    insert into a values (2, 'Test#2')
    insert into b values (1, 'Referes#1')
    insert into b values (2, 'Referes#2')
    select * from a
    select * from b
    delete from a where num = 1
    select * from a
    select * from b
    Sridhar,
    Thanks a lot for your help.My exact need was to delete records in 50 tables starting with the key table for a specific condition in the key table.
    Assume table A has 100 records,B 200 records,C 150 records,D 400 records, etc
    When i want to delete some records in table A, i will not be able to do that as child records exists in table B and this structure will carry on till that last table in my application. How do i delete those specific records
    Venkatesh

  • Counting inbound emails (including those automatically deleted using ERMS)

    Hi all,
    I have a requirement to be able to count all inbound emails in SAP CRM (5.0).  This includes all emails that have been automatically deleted using ERMS after the creation of an Interaction Record and Service Ticket.  Can anyone think of an easy way of doing this in SAP CRM?  The Email Workbench and Agent Inbox do not display deleted email Workitems.  The best option that I have been able to come up with is to export the Workitem Selection Report from transaction SWI1 into a spreadsheet and filter column Workitem ID for unique entries.  Does anyone know of a better way of achieving this?
    Thanks,
    Onkar.

    By using POP3, mail is automatically deleted from the server once downloaded by the client without further user intervention (granted, not immediately due to BTYahoos recent non-standard implementation of the POP3 protocol). By contrast, the whole point of IMAP is that mail is left on the server to be available to multiple devices and requires user intervention to delete. Why would a system which is designed to be used for leaving mail on a server be recommmended to someone who wished it to be deleted? If you wish to be pedantic, I agree the OP didn't ask for mail to be automatically deleted, but then nor did he specify immediate deletion either. I interpreted the request as the former, you the latter. Perhaps if we understood the underlying reason why he wished the mail to be deleted in the first place it would help in providing a solution.
    There seems to be a recurring theme on this forum to promote IMAP as a universal panacea to overcome all mail problems which is diverting attention away from fixing BTYahoo's broken POP3 servers which have to my knowledge at least 4 problems. Two are deliberate by BTYahoo, lack of secure login and moving read items to the Trash folder temporarily before deletion. Two are faults which they seem either unable or reluctant to fix, intermittant authentication problems and inabilty to download even modest sized attachments on a slow connection.
    Correction, he did ask them to be deleted automatically.

  • Delete record from the form and from the database

    hi,
    i want delete record from the form and the database ,but the record is only delete from the from !!!
    this is my code :
    if //condition then
    delete_record;
    commit;
    end if ;
    Any solutions ??
    thnx

    You have unique key field(s) on the table you are trying to insert which actually restricts you from inserting the same value again.
    When you are deleting the record and issue commit there is a record to be inserted in the table which is a duplicate that's why you are getting this unique error.
    As oracle is not able to insert your commit fails and stops your deletion of record from table

Maybe you are looking for