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

  UPDATE Customers SET Customer_Name = 'Smith' WHERE Customer_Name = 'Jones'

and return a integer of 3 if three rows were effected?

Thanks

asked 16 Jan, 18:20

gchq's gravatar image

gchq
1814819
accept rate: 33%

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

(17 Jan, 01:02) Volker Barth

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

permanent link

answered 16 Jan, 18:53

John%20Smirnios's gravatar image

John Smirnios
9.0k377114
accept rate: 39%

v17 Central doesn't return the number of rows updated after an UPDATE
Look, please, History Tab: alt text

permanent link

answered 17 Jan, 07:01

Ilia63's gravatar image

Ilia63
801283452
accept rate: 16%

edited 17 Jan, 07:02

Yep, but that's the DBISQL tool, not SQL Central...

(17 Jan, 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, 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, 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, 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, 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...

enter code here

(19 Jan, 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, 09:45) gchq
showing 1 of 7 show all flat view
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×90

question asked: 16 Jan, 18:20

question was seen: 364 times

last updated: 20 Jan, 09:45