PureBasic Forum
https://www.purebasic.fr/english/

SQlite: Count affected rows
https://www.purebasic.fr/english/viewtopic.php?f=12&t=73966
Page 1 of 1

Author:  dige [ Wed Nov 06, 2019 2:43 pm ]
Post subject:  SQlite: Count affected rows

If you need to know whether an DatabaseUpdate() has caused a change, you can query this as follows:

Code:
Procedure.i Sqlite3_CountChanges (DBID)
  Protected SQL.S = "SELECT changes()", Result.l = -1
 
  If DatabaseQuery(DBID, SQL)
    If NextDatabaseRow(DBID)
      Result = GetDatabaseLong(DBID, 0)
    EndIf
    FinishDatabaseQuery(DBID)
  Else
    Debug DatabaseError()
  EndIf
 
  ProcedureReturn Result
EndProcedure

Author:  Kiffi [ Wed Nov 06, 2019 3:43 pm ]
Post subject:  Re: SQlite: Count affected rows

Nice! :D

Thanks & Greetings ... Peter

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/