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

Similar Messages

  • I need the code to delete record in the database not in the form???

    I need the code to delete record in the database not in the form...
    because when i execute a form always insert the datas in the data base but i want insert value on a text file and delete in the data base the record whith this value of text file.
    i'm spanish an my english is bad sorry.
    thank, javier

    Well, I fail to understand why you want to complicate easy things, but anyway you can do that by using TEXT_IO within Forms to create text file (see Forms builder help), and UTL_FILE package to read it within Pl/Sql : you could create a stored procedure, and call it from Forms passing the file name as parameter. See UTL_FILE documentation

  • Deleting records from a Database using JTable

    Hello!
    I have a JTable that displays records from a database and a Jbutton .
    If i press the button i want that the record coresponding to selectedRow(from the JTable) to be erased from the database.How can i manipulate selectedRow from JTable to do that?
    Pls any suggestions (and if it's possible +code)?
    Thanks!

    Hi Margot,
    Let's assume that you have created a table using vectors. Simply remove the element from the vector at row selected and redraw. Maybe not the greatest solution but should work.
    Vector rowData = new Vector();
    //read in values for each row
    Vector headers = new Vector();
    //add your headers
    JTable table = new JTable(rowData, headers);
    int row = table.getSelectedRow();
    rowData.removeElementAt(row);
    table = new JTable(rowData, headers);HTH,
    Chris

  • How to handle the deleted records from R3

    Hello,
    We have created a generic data source on a database table in R3 side and now we have a case where there is a huge volume of data gets deleted and new records get updated every day.
    By doing a delta load we are able to load the New records and also the changed ones but we are unable to identify the deleted records from that table and move them to BI for deleteing those records in BI also.
    Can any one please suggest a solution for the handling the deleted records.
    Thanks,
    Ravindra.

    we had the same requirement some time ago and had two option:
    1. ask the R/3 development team add a deletion indicator in the table (and thus not actually deleting the record). this deletion indicator could then be used like for any other standard datasource
    this option was however refused, due to huge data volume after a while
    2. at the end of the load we copied the ZTABLE1 to ZTABLE2. then in the begin of the load (day after) we compare the data of table1 to table2. entries available in table2 but not in table1 are deleted, and we put a 'D'. in deletion indicator; as we only keep the deleted entries for one day, the volume of the new table is acceptable.
    M.

  • Delete records in a table and at the same time print out for reference

    I am working on a req to delete some records from a table and at the same time, record/print the deleted records in the outstream (DBMS_OUTPUT.PUT_LINE)
    DECLARE
    v_rec_po hst_po%ROWTYPE;
    BEGIN
    DELETE FROM hst_po po
    WHERE abbrpoid = '&opportunity_code'
    AND updatedby = (SELECT employeeid
    FROM tes_employee
    WHERE name = &emp_name)
    AND audittimestamp BETWEEN TO_DATE ('&start_timestamp',
    'DD-MON-YYYY HH24:MI'
    AND TO_DATE ('&end_timestamp',
    'DD-MON-YYYY HH24:MI'
    END;
    I was thinking of using returning into and then using DBMS_output to pull out the delted records, but there will be multiple rows deleted fro this statements. I am stuck here..Can anyone help

    How about:
    SQL> create table t
      2  (x int)
      3  /
    Table created.
    SQL> insert into t
      2  select rownum
      3    from all_objects
      4   where rownum <= 10
      5  /
    10 rows created.
    SQL> declare
      2     cnt pls_integer;
      3  begin
      4     delete from t;
      5     cnt := sql%rowcount;
      6     dbms_output.put_line ('Removed: '||to_Char (cnt));
      7  end;
      8  /
    Removed: 10
    PL/SQL procedure successfully completed.Edited by: Alex Nuijten on Jun 4, 2009 8:58 AM

  • Moving the 80 Million records from Conversion database to System Test database (Just for one transaction table) taking too long.

    Hello Friends,
    The background is I am working as conversion manager and we move the data from oracle to SQL Server using SSMA and then we will apply the conversion logic and then move the data to system test ,UAT and Production.
    Scenario:
    Moving the 80 Million records from Conversion database to System Test database (Just for one transaction table) taking too long. Both the databases are in the same server.
    Questions are…
    What is best option?
    IF we use the SSIS it’s very slow and taking 17 hours (some time it use to stuck and won’t allow us to do any process).
    I am using my own script (Stored procedure) and it’s taking only 1 hour 40 Min. I would like know is there any better process to speed up and why the SSIS is taking too long.
    When we move the data using SSIS do they commit inside after particular count? (or) is the Microsoft is committing all the records together after writing into Transaction Log
    Thanks
    Karthikeyan Jothi

    http://www.dfarber.com/computer-consulting-blog.aspx?filterby=Copy%20hundreds%20of%20millions%20records%20in%20ms%20sql
    Processing
    hundreds of millions records can be done in less than an hour.
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • Any way to restore deleted record from VBAP table.

    Hi Guru,
    Is their any way to restore deleted record from vabp.
    Back is taken but , All quality server back is taken, any way to restore only
    deleted VBAP data from all Back.
    Regards
    Durgesh

    Hi Sahu ji,
    you will not be able to get those records.
    Check this : If this issue is in Development than no need to worry.
    If in quality and production , then usually a copy of the system is there , and this can help you.
    Also , check is there any report that exports this data in some other form for backup.
    Hope it help you.

  • Delete recording from VSMS server

    In VSMS server, how can delete recording from storage? and can delete some of recording, like 1 hour from all recording or 1 day?

    Hello mshah,
    This is not recommended at all to delete recording files manually or for certain durations since every files has reference id created which are being associated to cameras.Deleting files in such can cause issue to the server.
    What is the reason behind deleting those files from server?
    Regards
    Nadeem Ahmed

  • 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

  • How to delete records from standard maintenance view

    Dear Sir/Madam,
            i want to delete records from standard view " v_mmim_rep_cust "
    This is a standard maintenance view , used in MBLB report.
    here i found the records with different report name but same fields as shown below...
    REPORT             TABLE NAME     FIELD NAME 
    RM07DOCS         MKPF                 BKTXT
    RM07DOCS         MKPF                 BLDAT
    RM07DOCS         MKPF                 BUDAT
    RM07DOCS         MSEG                 ANLN1
    RM07DOCS         MSEG                 ANLN2
    RM07DOCS         MSEG                 APLZL
    YRM07DOCS         MKPF                 BKTXT
    YRM07DOCS         MKPF                 BLDAT
    YRM07DOCS         MKPF                 BUDAT
    YRM07DOCS         MSEG                 ANLN1
    YRM07DOCS         MSEG                 ANLN2
    YRM07DOCS         MSEG                 APLZL
    I WANT TO DELETE THE RECORDS FROM THE VIEW WITH REPORT = YRM07DOCS.
    PLEASE HELP ME.
    Thanks in Advance,
    Dastagiri.

    Dear Sir,
          when i did so , it displays a message that  " entry mseg zeile  must not be deleted ".
    hense i went through writing a program to delete the records from table mmim_rep_cust
    but it says that record not found.
    program logic : 
    delete from mmim_rep_cust
        where report in report
          and TABNAME in TABNAME.
    if sy-subrc = 0.
    write ' RECORDS DELETED SUCCESSFULLY'.
    else.
    write ' RECORD NOT FOUND'.
    endif.
    please guide me to delete the records from the view.
    Thanks in advance,
    Dastagiri.

  • Delete records from multiple table

    Hi,
    I need to delete records from multiple tables using a single delete statement. Is it possible ? If so please let me know the procedure.
    Kindly Help.
    Thanks,
    Alexander.

    Hi Tim,
    Syntax of DELETE statement does not allow for multiple tables to be specified in this way. Infact, none of the DMLs allow you to specify table names like this.
    Technically, there are other ways of deleting from multiple tables with one statement.
    1. "Use a trigger":
    What was probably meant by this is that you have a driving-table on which you create a on-delete trigger. In this trigger, you write the logic for deleting from other tables that you want to delete from.
    This does mean a one-time effort of writing the trigger. But the actual DML operation of deleting from all the tables would be simply triggered by a delete on driving-table.
    2. Dynamic SQL:
    Write a PL/SQL code to open a cursor with table-names from which you want the data to be deleted from. In the cursor-for loop, write a dynamic SQL using the table-name to delete from that table.
    3. Using Foreign-Key constraint with Cascade-Delete:
    This I feel is a more 'cleaner' way of doing this.
    Having to delete data from multiple tables means that there is some kind of parent-child relationship between your tables. These relationships can be implemented in database using foreign-key constraints. While creating foreign-key constraint give the 'on delete cascade' clause to ensure that whenever data is deleted from parent-table, its dependent data is deleted from child-table.
    Using foreign-key constraint you can create a heirarchy of parent-child relationships and still your DELETE would be simple as you would only have to delete from parent-table.
    IMPORTANT: Implementing foreign-key constraints would also impact other DML operations that you should keep in mind.

  • Deleting Record from Database in PHP

    I'm trying to figure out how to delete a record from my
    database. I already have a recordset with my form selected. But
    when I try to add "Delete Record," I can never seem to figure out
    why it won't delete anything when I load the page in a browser, it
    won't even go to the page I told it to go to after it deletes a
    record. My guess is it's what I'm entering in the "Delete Record"
    part of it, any help would be great. Also, my id is primary key if
    that helps. Thanks ahead of time.

    edwin@aw wrote:
    > However, whenever I click on the hyperlink, the link
    will becomes
    >
    http://www.domain.com/www.LinkFromDatabase.com.
    Why it always append the web
    > site's address?? Do I miss something?
    This is happening because your link doesn't begin with
    http://.
    > echo "<a href='$link' target='_blank'> $link
    </a>";
    This should be echo "<a href='
    http://$link' target='_blank'> $link
    </a>";
    David Powers, Adobe Community Expert
    Author, "The Essential Guide to Dreamweaver CS3" (friends of
    ED)
    Author, "PHP Solutions" (friends of ED)
    http://foundationphp.com/

  • Select records from one database and insert it into another database

    Hi
    I need to write a statement to select records from one database which is on machine 1 and insert these records on a table in another database which is on machine 2. Following is what I did:
    1. I created the following script on machine 2
    sqlplus remedy_intf/test@sptd @load_hrdata.sql
    2. I created the following sql statements in file called load_hrdata.sql:
    rem This script will perform the following steps
    rem 1. Delete previous HR data/table to start w/ clean import tables
    rem 2. Create database link to HR database, and
    rem 3. Create User Data import table taking info from HR
    rem 4. Drop HRP link before exiting
    SET COPYCOMMIT 100
    delete from remedy.remedy_feed;
    commit;
    COPY FROM nav/donnelley@hrp -
    INSERT INTO remedy.remedy_feed -
    (EMPLID, FIRST_NAME, MI, LAST_NAME, BUSINESS_TITLE, WORK_PHONE, -
    RRD_INTRNT_EMAIL, LOCATION, RRD_OFFICE_MAIL, RRD_BUS_UNIT_DESCR) -
    USING SELECT EMPLID, FIRST_NAME, MI, LAST_NAME, BUSINESS_TITLE, WORK_PHONE, -
    RRD_INTRNT_EMAIL, LOCATION, RRD_OFFICE_MAIL, RRD_BUS_UNIT_DESCR -
    FROM ps_rrd_intf_medium -
    where empl_status IN ('A', 'L', 'P', 'S', 'X')
    COMMIT;
    EXIT;
    However, whenever I run the statement I keep getting the following error:
    SP2-0498: missing parenthetical column list or USING keyword
    Do you have any suggestions on how I can fix this or what am I doing wrong?
    Thanks
    Ali

    This doesn't seem to relate to Adobe Reader. Please let us know the product you are using so we may redirect you or refer to the list of forums at http://forums.adobe.com/

  • Problem When deleting record from database

    Hi ,
    I have a question. Firstly I'm using VB
    I have a problem about deleting any record from access database , That's the code I'm use it for add new item and it's work but it's not work when I tried to edit any rows " it's not want to Save" but work for add new Item.
    Try
    Me.Validate()
    Me.CustomerBindingSource.EndEdit()
    Me.CustomerTableAdapter.Update(Me.KonoDataSet.Customer)
    MsgBox("Update Successful")
    Catch ex As Exception
    MsgBox("Update Failed")
    End Try
    And That's my code for Deleting any record from database But it's not work and that's a problem.
    CustomerBindingSource.RemoveCurrent()
    CustomerBindingSource.EndEdit()
    Me.CustomerTableAdapter.Update(Me.KonoDataSet.Customer)
    Can anybody help me about that issue ?

    Hi kono20006000,
    Your issue seems really strange. I would recommend you make a troubleshooting.
    1.Made sure your code works with the single copy of the database. You could check if it scans hard drive for the database file name and check if it modifies dates on found files. You could check if you operate with the same database.
    2. Use the application update the record at the form_load event to see if it would work correctly.
    3.Check the table in update statement and the table in add statement.
    Best Regards,
    Edward
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

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

Maybe you are looking for

  • How can i change my account on itunes from gmail to mobileme?

    I get a message saying MM members already have an accout. If so, how can i change this? If i use my MM login, will i be able to use all the apps that i bought on my iphone and ipad?

  • Ipod shuffle generation 2 not being recognized at all

    I just bought a ipod shuffle generation 2, and i went ahead and installed itunes 7.02. I then connected the ipod, but windows did not ask me to install any new software. I then went to Device Manager and looked to see if the ipod was being recognized

  • Error in entering goods receipt - MB1C

    HI, When saving the goods receipt in MB!C Transaction i'm getting an error <u><b>Division by zero is not defined.</b></u>. can anyone suggest me to get out of this problem. thanks and regards shankar

  • How to delete a source system in BW?

    Hello All!    Can anone please  inform me about the procedure to delete a source system or inform me in which document i can find this information. Actually i wish to assing my newly installed BW3.5 system to a new logical system (i.e) its currently

  • A&D ADSUBCON: wrong qty in delivery for subcontr.PO with more than one item

    Hi gurus, i created a subcontracting PO with 2 item: item 10 for 200 PC and item 20 for 500 PC. When i create a delivery, using ADSUBCON (because i have to managed special stock E), the delivery quantities are wrong. I mean: I obtain a delivery with