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

Similar Messages

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

  • 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

  • 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

  • ORA-20001: Error in multi row delete operation: ORA-01403: no data

    Whenever I attempt a multi-row delete on my master detail page, I recieve the error:
    ORA-20001: Error in multi row delete operation: ORA-01403: no dataI have seen in other threads that the primary key attribute of the underlying table needs to be set to 'Show' in the report attributes. I have tried this both with it displaying as 'Hidden' ('Show' is unchecked) and with it displaying as text. Either way still gives me the same error.
    Is there anything else not mentioned in the other threads that could be causing this error for me?
    Thanks.
    BoilerUP

    Jimmy,
    In your multi row delete process you specify schema name, table and column name. Your report needs to be of type “SQL query (Updateable report)”. And your report needs to include the primary key column of your table. The column or alias name of that report column needs to correspond with the actual column name of your table.
    Marc

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

    Hi,
    Am trying to do a multi row delete on a report. Have added a [row selector] to the report and a 'multi row delete' process. Copied this from a sample app i got, but when i try and delete a row(s) i get the following error message:
    Unexpected error, unable to find item name at application or page level.
    ERR-1002 Unable to find item ID for item "P2_ROWS" in application "120".
    Can anyone give me any hints as to why this might be happeneing?
    Best regards
    Simon

    Simon,
    Are you still having trouble with this?
    Scott

  • 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

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

  • Multi row block record_group or cursor?

    I've done a lot of research on the Forms OTN forum and can't find a solution to this problem. I'll continue to research until an answer is posted to this thread. I've used the forms forums and Metalink for years and they've been a great help.
    My problem -
    I have a multi-row block built off a view. Each row has a check box. The canvas also has a button. When the button is pressed, each record checked will be processed. The problem is, I need to sort the data selected (checked) before it's processed. To complicate matters, the sort criteria is not in the view. My plan was to build a cursor off the block, but I'm having problems populating due to the multi-row aspect.. I also tried building a record_group but again ran into complications with it being multi-row. I'm not sure which method to use since I haven't found a clear-cut solution.
    btw - using 10gR2.
    TIA,
    abc

    AB, you're sure not very clear on this.
    Aweiden has the correct suggestion: Create a PL/SQL table in the form, rather than a record group.
    Here are the steps I would follow:
    1. User queries and displays the data, and then checks some checkboxes. Do not use a when-checkbox-changed trigger, since they can check, then un-check boxes.
    2. When user presses the process button, loop through the block as Aweiden has done above. However, I would call a procedure from within the loop to look up the values from the Mel_Item table. Store the values returned from the procedure within your pl/sql table, adding one row to the table for each row in your block that was checked.
    As a side note, how difficult is it to join the Mel_Item table with your view when you query the block? You could store those sort values from Mel_Item along with the data from the view.
    3. Once you are done processing the data block loop, sort the pl/sql table. (Maybe I can find the code lying around here somewhere, but a table sort like that can be coded in maybe 20 lines).
    I am not sure, but are you saying above ("...insert each row into another table (other information is different so its not duplicate rows entirely)...") that you are inserting the data from the user-checked rows into a database table? That is certainly easier to do than writing your own sort, I guess.
    4. After the pl/sql table is sorted, loop through it one more time, processing the data in the required sequence.
    Actually, pl/sql table processing is quite fast. You don't really need to sort the rows. All you need do is to step through the table checking for the first row to process (by finding the lowest value of the sort items). Process that row's data, then remove (delete) it from the table, then repeat the process until you have processed and removed every row from the array. I believe I would use this method rather than trying to sort the pl/sql table, OR inserting into a database table.
    Edited by: Steve Cosner on Oct 23, 2008 10:39 PM

  • Multi Row Insert

    I have read a few posts that mention a multi-row-insert but I can't find it.
    There is a multi row update and a multi row delete.
    I am using html db 1.6. We will be upgrading after we get this version of our app up and running, but don't want to take time out for the upgrade right now.
    Is multi_row_insert new to Application Express 2.0?
    Thanks,
    Gregory

    No, the multi row insert is not new to 2.0
    The builtin MRU processes handle multi-row updates and multi-row inserts. However, the default Add Rows process that the wizard creates on a tabular form does create only 1 blank row when you click the Add Row button. To increase this, just open the Add Rows process page and change 1 to a different number.

  • 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

  • Multi row portal form based on a single table or view

    Hi,
    I have to create a multi row (tabular format) portal form based on a single table. Please help.
    Thanks

    Hi,
    A workaround to create multi row for based on single table has been discussed in the following :
    http://forums.oracle.com/forums/message.jsp?id=469778
    Thanks
    Vineet

Maybe you are looking for

  • How to change chords & keys for loops?

    Hey, guys! I'm a total newbie, so I was hoping someone could give me "step-by-step" instructions for how to do this.... I am creating a song using one of the blue acoustic guitar loops in Logic Pro 9 & I have the option to "Play in" any chord/key ima

  • No syntax errors in a sql query

    Hello, We are trying to eliminate Toad from our Standards. One of our people did a test for me to decided weather or not to go with SQL Developer. He compared TOAD with SQL Developer & SQL Plus. He intentially put select * ffrr table_name; to see if

  • How do I get my mouse to zoom when scrolling?

    I've set my mouse to zoom while scrolling in preferences but it doesn't work. Any fixes?

  • WEBI Time format when using Universe

    Hi, I have a WEBI report built on a universe that uses a BW query as a datasource. In my BW report I have two time key figures of type DEC. Actual Time and Scheduled Time in format HH:MM:SS or -HH:MM:SS if it is a negative value. It works well in Bex

  • Convertring data

    Hi, I have problem with convertring data... I get with my database date : Date data = user.getDate(); // return date object now I must parse this date to format yyyy-mm-dd so : DateFormat df = DateFormat.getDateInstance(); String sDate = df.format(da