Unsupported Screen Size: The viewport size is too small for the theme to render properly.

Dangerous Multi-Row Table Updates In Results Window

forums forums SQLyog SQLyog: Bugs / Feature Requests Dangerous Multi-Row Table Updates In Results Window

  • This topic is empty.
Viewing 1 reply thread
  • Author
    Posts
    • #34147
      Jan.S
      Member

      Sorry, discard my previous reply. I did not read that you were updating from the results window.

      While updating from the results window, only fields from a table which are present in the result set, are used for updating.

      Lets say you have a table with primary key 'id' and another field 'data'.

      If your result set has only 'data' in it, then it will update the table with the query

      UPDATE table SET field = value2 WHERE field = value1

      as other fields in the table are not available.

      If the table's primary key is part of the result set, then it will use the primary key in the where clause.

    • #34148
      aramando
      Member

      Ah, right, thanks. That does make sense.

      Although I am happier about this way of operation now that I understand it, and can envisage scenarios where this could be useful, I still think it would be better if SQLyog always included the primary key in the underlying query when editing in the result window. I'm sure that wouldn't be too difficult for SQLyog to do, and it makes sense that when you are editing a single cell of the result table you can only change a single row's field.

Viewing 1 reply thread
  • You must be logged in to reply to this topic.