B4J Question How to get the the number of rows affected by the sql command

liulifeng77

Active Member
Licensed User
Longtime User
eg:sql.ExecNonQuery("update........")or sql.ExecNonQuery("del........"

thanks a lot!
 

Jeffrey Cameron

Well-Known Member
Licensed User
Longtime User
Additionally, if you wish to find out before you execute the command, you can always use "SELECT COUNT(*)" to get a row count based on your WHERE clause, e.g.
B4X:
Dim changes as int =SQL1.ExecQuerySingleResult("SELECT COUNT(*) FROM [myTable] " & myWhereClauseString)
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…