Italian SQL1.EndTransaction - udg (first post)    Dec 08, 2021   (1 reaction) EndTransaction appartiene alla versione per B4A
Klaus was quicker than me :)
SQL1.BeginTransaction
Try
<blah blah>
SQL1.TransactionSuccessful
Catch
Log(LastException.Message)
#If B4i OR B4J
SQL1.Rollback
#END IF
End Try
#If B4A
SQL B4A Question strange TransactionSuccessful - emexes (first post)    Dec 22, 2022   (1 reaction) Probably clearer by the code example at: https://www.b4x.com/android/help/sql.html#sql_begintransaction
SQL1.BeginTransaction
Try
'block of statements like:
For i = 1 to 1000
SQL1.ExecNonQuery("INSERT INTO table1 VALUES(...)
Next
SQL1.TransactionSuccessful
Catch
Log(LastException.Mess B4J Tutorial Access DB (mdb) BeginTransaction and AddNonQueryToBatch - OliverA (first post)    Mar 01, 2024   (3 reactions) It just requires an additional call at the right place:
sql.ExecNonQuery("COMMIT;")
See:
(Thanks to @jmon https://www.b4x.-and-ucanaccess.62909/post-477390
https://www.b4x.-with-ucanaccess-not-committing-inserts-solved.96142/post-606832 B4A Question SQLite Open, Insert Update Delete test for successful completion - Mahares (first post)    Jan 23, 2018   (3 reactions) Hey Domingo: You do something like this; SQL1.BeginTransaction Try 'Execute the sql statements or the NON Query statements: DELETE/UPDATE/INSERT. SQL1.TransactionSuccessful Catch 'the transaction will be cancelled Log(LastException.Message) End Try SQL1.EndTransaction B4A Tutorial SQL tutorial - Erel    Oct 02, 2019   (20 reactions) The above code took less than half a second to run on a real device.
Without the BeginTransaction / EndTransaction block it took about 70 seconds.
A transaction block can also be used to guarantee that a set of changes were successfully done. Either all changes are made or none are made.
By calling B4A Question I have a problem with SQLite that fails when inserting a large number of records into a table. Please Help. - klaus (first post)    Mar 07, 2024   (2 reactions) Or this code:
Sub Button1_Click
Dim SQL2 As SQL
SQL2.Initialize(DBFileDir,DBFileName,True)
Log("0")
Msgbox("0","")
SQL2.ExecNonQuery("Delete From masclis")
Log("1")
Msgbox("1","")
SQL2.BeginTransaction
Try
For wI=0 To 30000
SQL2.Exec B4A Question [SOLVED] SQL Result - MarkusR (first post)    Jul 16, 2019   (1 reaction) if it fails via try catch SQL1.BeginTransaction Try 'block of statements like: For i = 1 to 1000 SQL1.ExecNonQuery("INSERT INTO table1 VALUES(...) Next SQL1.TransactionSuccessful Catch Log(LastException.Message) 'no changes will be made End Try SQL1.EndTransaction https://www.b4x.com/a B4J Question [RESOLVED] Server Out of Memory Error - Jmu5667 (first post)    Apr 23, 2018 sql.BeginTransaction
sSQL = "UPDATE .dbo.devices_hello " & _
"SET " & _
"active_user = '', " & _
"active = 0, " & _
"last_user = '" & pubID & "', " & _
"last_u B4J Question login and signup b4j - behnam_tr (first post)    Apr 25, 2024   (1 reaction) For offline Create a new table in the database called user, then from b4j Dim Sql1 As SQL Sql1.InitializeSQLite(File.DirApp, "mydb.db" , False) 'insert to DB Main.Sql1.BeginTransaction Try /// my db > user > id,name,pass,date Main.Sql1.ExecNonQuery2("INSERT B4J Code Snippet Parse SQL Schema File Into SQLite - cklester (first post)    Oct 30, 2020 At first, I pulled those lines out and ran the appropriate command:
if cmd = "BEGIN TRANSACTION;" then
sql1.BeginTransaction
and same for commit. But then I figured there was no reason to do that to properly transacted SQL.
@Erel , let me know if having the BEGIN TRANSACTION; and COMMIT; in Page: 1   2   3   4   5   6   7   Powered by ColBERT |