2
In Sqlserver I use after the insert
or update
i use:
SET @LINHAS_AFETADAS = @@ROWCOUNT
So I get the affected line number, I would like to know what the equivalent in Mysql, I searched the web but only found solutions in codes, need to be done directly in query
, tried ROW_COUNT()
, but this function returned 0
for no affected line and -1
for 1 or more lines.
Thanks Fernando, really I was testing in Mysql Workbench ,in the application ROW_COUNT() worked as expected.
– André
@Andre, I’m glad I could help. I noticed you’re new here. So, if the answers have completely solved your doubts regarding the question, please mark the answer that helped you best as an answer, and can also give positive votes in the other answers that helped you. And if you still have doubts edit the question with the same, or comment on the answers.
– Fernando Leal