Multi Row Delelte - Delete all rows

I have a multi row delete button with multi row checkboxes. When I tried to delete the selected rows, actually all rows are deleted. I have a multi row delete process.
Other information:
This tabular form displays all related users for one particular department. The department ID is the primary key in this reference table.
I am using APEX 2.2 and IE as browser. Any one else here know what settings I should set.

After review previous thread, I created the following PL/SQL expression for the multi row delete process in the condition field:
FOR I IN 1..APEX_APPLICATION.G_F01.COUNT LOOP
DELETE FROM tbl
WHERE colNM = APEX_APPLICATION.G_F02(APEX_APPLICATION.G_F01(I))
END LOOP;
END;
I also tried htmldb_application.g_f01.count to reference the selected rows. Both of them are not working. Someone, please help, where should I put this PL/SQL expression. I am pretty to APEX.
Thanks.

Similar Messages

  • Tabular form - Multi row delete error

    Apex 4.0.2
    We have a simple CRUD type of application on a bunch of tables built using Apex v1.6 that has, over the years, been upgraded to v4.0.2 and it is working mostly fine. It uses all out-of-the-box standard components, forms, classic reports, nothing too fancy. Recently one of the tabular forms started to misbehave, the multi-row-delete process raises a No Data Found error. The tabular form is based on a view with a INSTEAD OF trigger to handle the DML. Manually deleting the row in SQL*Plus works fine delete from mytab here pk_id = :pk_id but selecting the same row in Apex and clicking Delete raises the error.
    How does one go about troubleshooting & fixing this sort of thing? I tried re-saving the region in the Builder, exporting/importing the entire app, nothing. Running in Debug mode doesn't really provide any additional information, just that the MRD process failed. Tabular forms are the most frustrating, opaque component in Apex, wish they were easier to troubleshoot.
    Any ideas?

    Hello Vikas,
    >> How does one go about troubleshooting & fixing this sort of thing?
    By given us a bit more information :)
    • Is it a manual Tabular Form (using the ITEM API) or a wizard created one?
    • Are the Insert/Update operations work correctly? If not, what is the type of your PK column(s)?
    • If the problem is limited to the Delete operation, maybe the problem lies with the checkbox column. Are you sure that on page it is rendered as the f01 column?
    • As triggers are involved, can you save the PK that the trigger sees? Is it the expected value?
    • Are there any other processes that are fired before the DML process? If so, maybe the problem is with them. You can temporarily disable them and see if it change anything.
    >> Tabular forms are the most frustrating, opaque component in Apex, wish they were easier to troubleshoot
    Yes, I agree. However, I believe that 4.1 made some serious advancement where Tabular Form is concerned. Having simplified Tabular Form related Validations and Process should make things easier, and as a result, prone to less errors. Still, the main problem is that the type of error you are talking about is usually the result of metadata problems and these are indeed very hard to track.
    Regards,
    Arie.
    ♦ Please remember to mark appropriate posts as correct/helpful. For the long run, it will benefit us all.
    ♦ Author of Oracle Application Express 3.2 – The Essentials and More

  • Multi-row Delete (MRD) on a view?

    All,
    I created a tabular form on a view, using an instead of trigger to encapsulate the logic for the data manipulations. Works great--until someone checks a row and hits the delete button, at which point APEX throws this error:
    ORA-20001: Error in multi row delete operation: row= 107970-18527, ORA-06502: PL/SQL: numeric or value error: character to number conversion error,
    Error     multi row operation failedAs far as I can tell, it's not even getting to the trigger; I commented out the body of the instead of delete trigger (replacing it with null), and I'm still getting the same error. I have no validations or processes on the page at this point.
    The underlying data of the view requires three columns for a unique identifier, so I've concatenated two of them together as an extra column in the view (creating a varchar2 column), and told the MRD to use the calculated column and the third column as the primary key columns. But even using two of the three numeric columns (tweaking the trigger to use a hard-coded value for the third) as an ID fails miserably.
    Any idea what's going on?
    Thanks,
    -David
    (In case it makes a difference, we're on APEX 4.0.1.)

    Hi David,
    This might help:
    http://oraclequirks.blogspot.com/2011/07/ora-20001-error-in-multi-row-delete.html
    Hope it helps!
    Regards,
    Kiran

  • Validation in a Multi Row Delete

    Hi all,
    i made a page with an updateable report region - all works fine.
    But now i want to do a validation in the process 'Multi Row Delete'.
    The aim is to guarantee that the specific row is not deleted if the validation for that row fails.
    How can i achieve that?
    Any feedback is welcome.
    Best regards
    Martin

    Hi,
    many thanks for your reply.
    Yes in my case it is a tabular form and the validation should be done vor 'multi row delete'. Accordingly to the article you mentioned i created a validation with the following PL/SQL code:
    DECLARE
    vRow PLS_INTEGER;
    BEGIN
    FOR i in 1..apex_application.g_f01.COUNT LOOP
    IF apex_application.g_f01(i) IS NOT NULL THEN
    vRow := TO_NUMBER(apex_application.g_f01(i));
    IF lpkom_api.checkPersonAssigned(apex_application.g_f03(vRow)) THEN
    RETURN 'Delete is not allowed for this row.';
    END IF;
    END IF;
    END LOOP;
    END;
    Best regards
    Martin

  • "1) it takes TOOOOOO LONG for multi-row tabs to close when i click "close all/other tabs" and 2) it takes TOO long for Firefox to appear after i click the icon on the desktop"

    1) When many tabs are opened in multiple rows (say 50 or 100) it may take an enternity for them to close after I click the appropriate command
    2)MOre often than not, it takes the browser too long to appear (open) after I initiat it by clicking the desktop or start menu icon.
    NB: My first question is PRIMARY (critcally important) and second is additional (would very much like to receive an answer but it's not critical).
    Thanks a lot in advance!
    Best regards, Dmitry.

    Sorry about the bookmarks misread, I installed a Multi-Row Tab style, not for me but it in use deleted 126 of 130 tabs in about 3 seconds and then the last 4, no idea why that happens with the with the multi-row style.
    Did those 100 pages have web forms in them that you filled in an Firefox may be saving data along with the session.
    Here is a test page that you can quickly load up to 120 tabs at a time with an extension such as "Linky". See it if it takes an eternity to close them with the Multi Row tabs extension you are using, then try the same with the extension disabled. Works fast for me all tabs are on one row.
    * 001 '''Tab Capacity Test'''<br>http://dmcritchie.mvps.org/firefox/tab_capacity/001_with_underscore.htm
    Two Extensions to Help -- you may already have one or both
    * '''Stylish-Custom''' :: Add-ons for Firefox<br>https://addons.mozilla.org/en-US/firefox/addon/stylish-custom/
    * '''Linky''' :: Add-ons for Firefox<br>https://addons.mozilla.org/en-US/firefox/addon/linky/
    Style that can be installed after installing "Stylish" extension, style will show two rows of tabs you have to scroll up/down. '''This style does not recognize app-tabs formatting, new in Firefox 4.'''
    * '''App: Multi-Row Tab Bar''' - Themes and Skins for Browser <br>http://userstyles.org/styles/10930
    I put all my tabs on one row you probably would not like it, but you might like the one with the tab borders, which almost works again using multi-row tabs:
    * Tabs Bar Minimal Size - Themes and Skins for Browser <br>http://userstyles.org/styles/9043
    * '''Tab Color Underscoring active/read/unread''' - Themes and Skins for Browser<br>http://userstyles.org/styles/9023

  • Need to perform multi-row update/delete

    Gday,
    I have a request to have one update button for a multi-row form. Also needed will be a checkbox as part of the row.
    The check boxes only purpose is to signify the record should be deleted. Thus I am assuming I cannot use default
    apex functionality and must manually build the multi-row form. I guess I would loop through and check to see if a
    record is checked delete otherwise loop through and update all columns for that record? I am assuming I should
    use the examples in http://www.oracle.com/technology/products/database/application_express/howtos/tabular_form.html
    is that all still valid for apex 3.2.1?
    Cheers

    Hello:
    You could also do the following
    Generate the tabular form page using the wizard
    Delete or not display the 'Delete' button
    Delete or not execute the 'ApplyMRD' process
    Create a new page process with a sequence higher than the standard MRU processes. Make this process conditional on the 'Submit' button. Use code similar to the one below for this page processfor i in 1..apex_application.g_f01.count loop   --- f01 is the selector checbox, f02 is the hidden column with the table's PK
      delete from emp where empno=apex_application.g_f02(apex_application.g_f01(i));
    end loop;Now, when you click 'Submit' records with their selector checkbox checked will be deleted by the newly added page process. The rest of the functionality of the tabular form remains the same.
    varad

  • ADF row header and delete all problem

    Hi,
    I am using JDeveloper 11.1.14 and ADF-Bc in my project.
    In one of my page I display a simple table and a button which deletes the selected records.
    I dragged and dropped the 'Delete' operation from the Data Control view object onto the bindings.
    The below method iterates through selected rows and calls the 'Delete' operation which removes the current row.
    The Code for delete is as below
    public void deleteSelectedRows(ActionEvent actionEvent) {
    RowKeySet selectedRows = richTable.getSelectedRowKeys();
    Iterator selRowIter = selectedRows.iterator();
    RowSetIterator empRSIter = voIter.getRowSetIterator();
    while (selRowIter.hasNext()) {
    Key key = (Key)((List)selRowIter.next()).get(0);
    Row currentRow = empRSIter.getRow(key);
    if (currentRow != null) {
    voIter.getViewObject().setCurrentRow(currentRow);
    OperationBinding operation =
    getBindingContainer().getOperationBinding("Delete");
    if (operation != null) {
    operation.execute();
    I have added row header as column in my jsp page inside af:table. ex: <af:column rowHeader="true" width="12" id="c16"/>
    The problem is that if I manually select all rows[using control key] and click on 'Delete' button, the method is working fine[all records are being deleted].
    But If select all records either thorugh ctrl+A or on click of top of row header, all records are being selected in U.i,but the delete operation is not deleting
    all the records.It deletes only part of the records.[Ex: say 7 out of 10 records being displayed].
    Please let me know where I am doing wrong. or if it has something to do with range size.
    Regards,
    Praveen
    Note: I have multi selection enabled on the table

    Hi Frank,
    I have few more observations to add.
    In the below code, if the row removal is commented out, then the selected row count(i.e size ex: 9)
    and the index counter printed are correct.[i.e for example index counter printed will be 1,2,3,4,5,6,7,8,9]
    RowKeySet rowKeySet = (RowKeySet)richTable.getSelectedRowKeys();
    System.out.println("\nSIZZE"+rowKeySet.size());
    CollectionModel cm = (CollectionModel)richTable.getValue();
    int index = 1;
    for (Object facesTreeRowKey : rowKeySet)
    cm.setRowKey(facesTreeRowKey);
    JUCtrlHierNodeBinding rowData =
    (JUCtrlHierNodeBinding)cm.getRowData();
    System.out.println("index"+index);
    index++;
    // rowData.getRow().remove();
    But when row removal is present then the index counter displayed is also wrong.. [ex: 1,2,3,4,5,6]
    Same behavior is observed with 'Delete' operation also.
    Regards,
    Praveen

  • Multi Row Delete & Row selector in 1.5

    Hi All,
    Please forgive my ignorance.
    But, are these processes (Multi Row Delete, Row selector) not available for HTML DB 1.5.
    What is the other way to do this.
    Thanks
    Monika

    Hi Monika,
    It's been a while since I used 1.5 so I can't answer that, however whilst I'm not generally in favour of upgrading just for the sake of it, is there a reason why you wouldn't consider upgrading to a later release?

  • Multi-row delete

    Hello,
    I want to display a checkbox in a multi-row query for deletion.
    when the user will submit, I want to delete all checked record.
    I've tried to do it by creating a checkbox in the select statement of the query (select HTMLDB_ITEM.CHECKBOX (1, 'Y') checkbox, ...) and create a process to do the delete. Here my process code:
    declare
    l_val_rows varchar2(400) default null;
    begin
    for i in 1..htmldb_application.g_f01.count loop
    if instr(nvl(htmldb_application.g_f01(i),0),1) > 0 then
    delete gsr_corporates where id = htmldb_application.g_f02(i);
    end if;
    end loop;
    end;
    2 problems:
    1)
    When I submit, if my checkbox is not checked, I get error "Error in mru internal routine: ORA-20001: no data found in tabular form". If checked, it is working.
    2)
    When checked, I get the error "Error in mru internal routine: ORA-20001: Checksum column ("FCS") is required and was not supplied".
    So, is it a good way to do what I want? If yes, what's wrong? If no, what is your suggestion?
    Thank you
    Jean

    Jean,
    Please take a look at this example:
    http://www.oracle.com/technology/products/database/htmldb/howtos/checkbox.html#HANDLE
    The problem is that when a checkbox is not checked, there is no corresponding entry in the array. Thus, the array indexes for f01 and f02 will be out of sync. To fix this, make the value of a checkbox, when checked, the primary key of the row you want deleted. Then you can simply walk through one array and delete every row that corresponds to an entry in it.
    Sergio

  • Multi-Row Delete from a table via a button without submitting the page

    Hi,
    I have a simple page based on a (temporary) table. There is a submit button that calls a PL/SQL process. However, I would like to have an 'Abort' button that deletes all rows from the table belonging to a specific user.
    I had a look at 'Processes -> Data Manipulation --> Multi Row Delete' but this can only be linked to a page level event such as onSubmit. My onSubmit is linked to another process so this is not an option for me.
    I thought of creating a PL/SQL function for the deletion and calling it from Javascript linked to a button. I have done the PL/SQL and the button but don't know how to call PL/SQL from JS. And is this the correct way of doing something like a deletion? Any documents that show how can this be done will be much appreciated....
    I had a look at the forum and the documentation but could not find anything for multil-row deletion triggered from a button.
    Your help is appreciated as I'm a newbie :-)
    Thanks
    Angela

    Hi,
    I actually found the solution. I created a button (that submits) and a computation that calls the PL/SQL function conditional on that button being pressed. Initially I got confused because I already had another PL/SQL function attached to different button. I didn't think that having two buttons that submit the page and call different functions was possible.
    Thanks
    Angela

  • Multi Row Delete and then I get a unique contraint violation on my PK

    I have a simple table with 2 columns, one a PK. I have a checkbox style, multi-row delete function setup on this (to be honest, APEX set this up automatically).
    I removed the add/edit functionality to keep just the delete button and delete procedure.
    When I select an item, and then click delete, I get a unique constraint violation that I'm violating my Primary Key.
    How can I fix this, or see what it's doing when it tries to delete the row?

    Hi,
    It sounds as though you haven't properly removed all of the add/edit functionality or that you still have some form of validation and/or computation in place or that you have a trigger that is trying to insert records into, for example, a history table (is the constraint on the table you are deleting from - the error message should tell you this?)
    Check that the only process you have is ApplyMRD and that this is pointing to the correct table and has the correct primary key set. Ensure that this has Conditional Processing set for a Request of "MULTI_ROW_DELETE".
    Check for any validations - there is no need to perform validations if your user can not insert or update data unless you want to check that they've ticked one or more checkboxes.
    Check for processes that could run if the user clicks the Delete button. Validations and processes could be conditional on either the button click or on request = "MULTI_ROW_DELETE".
    Review any triggers that you have on the table to ensure that deletions do not try to insert records into another table where the primary key on that table is not being populated.
    Regards
    Andy

  • How to delete all rows data from database

    Hello All.
    I have a database username 'abc'. This database contain 123 tables & have many data.
    I want to empty all the database. Is it possible that clear all the database with a single query.
    if yes then kindly tell me about the query .
    Thanks
    Diamond

    Keep in mind that you cannot rollback the truncate command.
    Once you truncate a table all of it's data AND statistics are gone.
    If you do not want to use PL/SQL to delete all rows you can generate a script by SQL
    SCOTT@ORCL> SELECT ' TRUNCATE TABLE '|| TABLE_NAME||';' FROM USER_TABLES;
    'TRUNCATETABLE'||TABLE_NAME||';'
    TRUNCATE TABLE BONUS;
    TRUNCATE TABLE SALGRADE;
    TRUNCATE TABLE DEPT_LOV;
    TRUNCATE TABLE TITLE;
    TRUNCATE TABLE TEST_DATE;
    TRUNCATE TABLE DEPT;
    TRUNCATE TABLE REP;
    TRUNCATE TABLE REP_PARAM;
    TRUNCATE TABLE EMP;
    10 rows selected.
    SCOTT@ORCL> SELECT 'DELETE FROM '|| TABLE_NAME||';' FROM USER_TABLES;
    'DELETEFROM'||TABLE_NAME||';'
    DELETE FROM BONUS;
    DELETE FROM SALGRADE;
    DELETE FROM DEPT_LOV;
    DELETE FROM TITLE;
    DELETE FROM TEST_DATE;
    DELETE FROM DEPT;
    DELETE FROM REP;
    DELETE FROM REP_PARAM;
    DELETE FROM EMP;
    10 rows selected.
    SCOTT@ORCL>You can save the output in a .sql file and run it.
    Regards,
    Tony

  • Button to delete all empty rows

    I am in the process of creating an interactive form that has a button that add rows for the user to input issues and another button to add follow-ups to those instances. There are 3 different sets of these. However, we do not want to add a delete button to all rows, to allow for accidental deletion of already inputted data.  I would like to create a button that will delete all empty rows, including all subforms.  Either that, or upon saving the document, all empty rows would be deleted - whichever would be easier. Please help!  This seems like it will be a complicated task and I am not that well versed in LiveCycle to be able to figure this out on my own.
    Thank you!

    There is no doubt that looping through nested repeating objects is more complex:
    Here is the script for the first table with follow-up rows:
    // Technical
    var nCount3 = VitalsSubform.Technical._Instance1.count;
    for (var k=0; k<nCount3; k++)
         // this is script to remove the follow-up rows in the first table only
         var nCount6 = xfa.resolveNode("VitalsSubform.Technical.Instance1[" + k + "]").Table1._Row1.count;
         // loop through the rows in the follow-up table
         for (var i=0; i<nCount6; i++)
              if (xfa.resolveNode("VitalsSubform.Technical.Instance1[" + k + "].Table1.Row1[" + i + "]").Cell4.rawValue == null)
                   // remove null row
                   xfa.resolveNode("VitalsSubform.Technical.Instance1[" + k + "]").Table1._Row1.removeInstance(i);
                   // recount nCount in case a row has been deleted
                   nCount6 =xfa.resolveNode("VitalsSubform.Technical.Instance1[" + k + "]").Table1._Row1.count;
                   // account for the row that is now deleted
                   i = i-1;
         // now remove null statements
         if (xfa.resolveNode("VitalsSubform.Technical.Instance1[" + k + "]").Table1.Statement.Statement.rawValue == null)
              VitalsSubform.Technical._Instance1.removeInstance(k);
              var nCount3 = VitalsSubform.Technical._Instance1.count;
              k = k-1;
    It is by no means tested and could still be flaky.
    Have you considered a manual 'x'/delete button for the follow-up rows?
    Here is the form: https://acrobat.com/#d=JMGUKXNQ*qMD18S3W5VxSQ
    Niall

  • Problem with multi row delete

    Hi, I'm new in apex and I tried to build master detail report on some view. Everything is cool but "delete checked" doesn't work.
    "ORA-20001: Error in multi row delete operation: row= , ORA-06502: PL/SQL: numeric or value error: NULL index table key value,"
    the problem is that I don't know what is wrong :), I have a special trigger "instead of delete on MY_VIEW", but in this error problem is not explained.
    Anybody knows what can be wrong? It is probably a problem with trigger or multi row doesn't work with views? I couldn't find how MRD knows what kind of statement use to delete rows so I don't know if the statement that program used is correct. In debug it lokks that:
    0.32: ...Do not run process "ApplyMRU", process point=AFTER_SUBMIT, condition type=REQUEST_IN_CONDITION, when button pressed=
    0.32: ...Process "ApplyMRD": MULTI_ROW_DELETE (AFTER_SUBMIT) #OWNER#:MY_VIEW:ITEM1:ITEM2
    0.33: Show ERROR page...
    0.33: Performing rollback...
    thanks for any help
    //sorry for english mistakes
    edit: it doesn't matter if I use in trigger delete from ... where item1=:OLD.item1 ; or if I use item1=:P4_item1 (which actually saves correct values)
    Edited by: user5931224 on 2009-06-13 08:55

    I realised that this is not a problem with trigger, I changed trigger to "NULL;" and problem is the same. Maybe sb used master detail on view not only on tables and know what can be wrong in this situation?

  • Delete all rows in a table

    I have read two articles how to use sql adapter with delete.
    http://btsguru.blogspot.se/2011/10/wcf-sql-adapter-table-operations.html
    http://social.technet.microsoft.com/wiki/contents/articles/29146.biztalk-server-2013-crud-operation-with-wcf-sql-adapter-and-correlation.aspx?wa=wsignin1.0
    Is it a way to delete all rows in a table?
    I have tried to send <ns0:Rows>*</ns0:Rows> with no luck.
    Challan

    I'm not expert in Biztalk but one of the options to call stored procedure that contains the delete script:
    http://geekswithblogs.net/StuartBrierley/archive/2011/10/19/biztalk-server-2010---using-the-wcf-sql-adapter-to-make.aspx
    Sql Delete all rows from table Script:
    DELETE FROM table_name;
    or 
    TRUNCATE TABLE mytable;
    Trucnate vs Delete:
    http://www.mssqltips.com/sqlservertip/1080/deleting-data-in-sql-server-with-truncate-vs-delete-commands/
    Fouad Roumieh

Maybe you are looking for

  • My iPad 3 has mechanical distortion from the speakers

    Apple replaced my first iPad 3 due to mechanical distortion issues with the internal speaker. Now my new one is doing the same thing. I don't play anything loud or usual I mostly listen to news and podcasts. But within a couple weeks the new iPad beg

  • How to determine the last form open in Forms 9i webforms??

    I am trying to find out if there is a built-in that tells you that you are on the last form in your application?? I've tried the :system.last_form and :system.current_form built-in's but to no avail... If anyone has done this, please let me know. Tha

  • Populate header text of ME22N

    Hi All, I wan tto populate the header text field of the transaction code ME22N. I want to populate the header text by the requester's email-id. Th erequirementment is like all the POs has been created but now the email-ids has to be populated. Is the

  • Having problems updating blog

    I have tried several times tonight to update my blog, but it's not getting to my home page. Here's what I'm doing: 1.) I'm publishing the page to the site folder on my desktop. I'm previewing it and it's fine. 2.) I'm using Filezilla to transfer the

  • Web publish publishing OLD file???

    This is hard to explain because it seems to defy logic. I made an authorware project. During the creation process, I published it for the web regularly to see the changes. Great! No prob! However, when I finally made the last changes and tweaks, when