I've just noticed that v17 Central doesn't return the number of rows updated after an UPDATE... It gives you a warm fuzzy feeling that you did the right thing when you see 'one row(s) updated' and it's what you intended to do... Is there a hidden checkbox somewhere that restores this feature? On the same subject if I wanted to add that to one of our utilities (outside of Sybase Central) what method can be used to return the number of rows updated? Say
and return a integer of 3 if three rows were effected? Thanks |
I don't know about the Sybase Central part but there are several ways to get the number of rows affected by a statement depending on your client. For ESQL, there is a field set in your SQLCA: http://dcx.sap.com/index.html#sqla170/en/html/3be2f5e26c5f101499c1907455d3c6be.html In ODBC, there is a SQLRowCount function: https://msdn.microsoft.com/en-us/library/ms711835(v=vs.85).aspx You can also just execute "select @@rowcount". |
Yep, but that's the DBISQL tool, not SQL Central...
(17 Jan '17, 07:56)
Volker Barth
Replies hidden
That is actually what I meant - tend to think of Sybase Central as the overall application and Interactive SQL as just another tool within that app... The rows updated information in Results was very useful in prior versions and seeing '0 row(s) updated' is a major red flag that generally means user error.
(17 Jan '17, 10:36)
gchq
@gchq: Sorry, I still don't get the point. - If you relate to Interactive SQL, then where exactly do you notice a "0 row(s) updated" notification when more rows have been updated? As said, I agree that v17 misses the former "Messages" tab and the display of those messages within the according "History" tab is confusing but the number of rows should be correct, as in Ilia's sample (and my own experience).
(18 Jan '17, 02:42)
Volker Barth
It's just a handy reference without opening another tab - 40 row(s) updated - probably good 0 rows(s) updated - probably wrong criteria or wrong table 48,000000 row(s) updated - probably time to restore from the last backup. Having said that when you run a SELECT in prior versions, then an UPDATE you have to open another tab in any event as the SELECTED rows are still in the results pane
(18 Jan '17, 08:03)
gchq
Well, the old DBISQLC utility (still available with v17, and still heavily used by the SQL Anywhere engineers themselves...) has a separate Statistics pane, and therefore SQL statements, result sets (only one!) and statistics are shown in their respective panes just beneath each other. Good old times:) I'd love to show an image but unfortunately, my upload attempts are failing today...:(
(18 Jan '17, 08:24)
Volker Barth
FWIW, here's what v16 and v17 DBISQL show when doing a simple UPDATE within the same v17 demo database. As stated, I do think that it's no improvement that v17 shows the row count within the History tab, but besides that, in my tests both v16 and v17 do show the real number of modified rows...
(19 Jan '17, 11:40)
Volker Barth
Probably just me clicking the SQL statement and not getting feedback in the results tab that I am used to seeing that's a little unnerving :-)
(20 Jan '17, 09:45)
gchq
|
Hm, how do you update data directly in SQL Central via UPDATE statements? (I'd think you can edit data interactively within SC's Data View grids...) - Or are you relating to DBISQL? - Note, for v17, those "statistics" and messages have been merged into the history window, unfortunately, as discussed here...