Strange behavior when deleting rows

Hi, I noticed a strange behavior when deleting a row in the table viewer.
If I press the "minus" button it deletes the selected row without doing any other operations, so ok. But if I press the DEL key it stands for a moment, then starts fetching all the rows of the table and finally deletes the selected row.
This is clearly visible since the viewer normally fetches only 500 rows, but using the DEL key it fetches all the rows.
Obviously this could be a problem with large tables, since in this case there is not a CANCEL button and the whole application would freeze.

Hi Marco,

I am unable to reproduce this. When I follow the steps below, only the selected row is deleted. There is no fetch. Please send me clear steps to reproduce the problem. Also let me know which version of Toad you are using.

  • Go to Schema Browser
  • Select a table which has thousands of rows or more
  • Go to the "Data" tab on the right-hand side
  • Scroll down a bit.
  • Press CTRL+Del to delete the current row (Note: DEL by itself is not supposed to delete rows. DEL just clears the value in the selected cell, or cells if you select multiple cells)
  • Row is deleted as expected without additional fetches.

Thanks

John

My version is Toad for Oracle Base (64-bit) 17.0.341.1977

I understood that the issue is slightly different: I noticed that the line is not deleted but rather cleared. This, in combination with a Sort condition, forces the viewer to fetch all rows if the NULL row is the last in sort order

1 - select a table with more than 500 rows (or Describe)
2 - go to the Data sheet
3 - add a sort condition on any field, with NULLS LAST
4 - select a row by clicking on the left gray square
5 - hit the DEL key (not ctrl-DEL)
6 - all the cells of the row will be cleared. Now the current row becomes the last, so all table rows are fetched to show the current row

By using ctrl-DEL the row is correctly deleted, without fetching.

Oh I see.

Yes, by using the DEL key, Toad sets all of those fields to null with an UPDATE statement. Then it tries to locate the row again, and due to the way you have the data sorted, it has to scroll a long way down to find the row.

So, two things:

  1. If your intention to delete the rows, you should use either CTRL+DEL or the '-' button on the navigator above the grid.

  1. If your intention is to set all field values to NULL, but you don't want the refresh+scroll to happen afterwards, you can go to Options -> Data Grids -> Data, and uncheck the items in the "Refresh grid data" box.

-John

Ok, clear. I used to use DEL with the old versions of Toad, now I will use ctrl-DEL. However, I deselected the refresh checkboxes.
Thanks

Hi Marco,

We changed the DEL behavior because we had complaints from some users that they were expecting it to clear the value in the selected cell instead of delete the entire row.

Imagine if just one cell is selected like this. Here, it seems like DEL should clear the "MANAGER" value.
image

I see from your point of view too though - that if entire record is selected by clicking the gray square left of the row, that deleting the entire row is probably what you want to do, instead of make every cell NULL. But on the other hand, DEL behavior should be consistent no matter what is selected.

-John