Friday, November 25, 2016

Editing cells in SQL Developer

I rarely edit my databases directly, and of those rare edits, I'd say that less than 1% are done to individual cells.  Usually, it's because I need to twiddle a knob that Liferay has buried in an XML CLOB. So when I do need an editable grid, I can only remember how to get to it by browsing, which is incredibly tedious.

But there's a better way!

  1. Find the offending cell using the query worksheet, then copy the WHERE clause.
  2. In the query, hold down ⌘ (Ctrl on Windows) while mouse hovering over the table name.  The table name becomes a link.

  3. Click on that link.  (Once you know about this behavior, you can ⌘-click without hovering.)
  4. Now you're in the data grid for the selected table.  Paste the WHERE clause from your buffer and hit Enter.

  5. Double click on any record to edit it, or right-click on the row to use Single Record View.
  6. YOU WIN.  EVERYBODY WINS.

For the sake of completeness, here's the tedious way:

  1. In the connections browser, expand the schema.
  2. Expand Tables.
  3. Scroll, scroll, scroll down to the desired table.  Wait, you missed it.  Scroll back up.
  4. Click on the table name.  This opens the data grid, as in step 4 above.

h/t That Jeff Smith