aNewLyfe Posted August 30, 2009 Share Posted August 30, 2009 hi there, i have a problem with deleting rows. searched forum, tried too many times but cannot figured it out. my problem is: sqlite delete is not deleting really or rolling deleted data back after restart. used commands : _SQLite_Exec($DBN, "DELETE FROM "&$curtable&" WHERE id = '" & $curpersonid & "';") _SQLite_Exec($DBN, "COMMIT") after this, when i press the list people button it does list correctly. (deleted person not in the list) but it creates a file @scriptdir with name: "[databasename].db-journal" and rolls data back from it to original database after restart. (i think)(also, this file is in-use so i cannot delete it.) i need your help. i will be very very appreciated. btw, sorry for my poor english wish u understand. ~ Every Living Thing is a Code Snippet of World Application ~ Link to comment Share on other sites More sharing options...
Zedna Posted August 30, 2009 Share Posted August 30, 2009 (edited) Try to add semicolon after COMMIT Also use BEGIN together with COMMIT _SQLite_Exec($DBN, "BEGIN;") _SQLite_Exec($DBN, "DELETE FROM "&$curtable&" WHERE id = '" & $curpersonid & "';") _SQLite_Exec($DBN, "COMMIT;") EDIT: In many simple scripts you can also use DELETE without COMMIT _SQLite_Exec($DBN, "DELETE FROM "&$curtable&" WHERE id = '" & $curpersonid & "';") Edited August 30, 2009 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
aNewLyfe Posted August 30, 2009 Author Share Posted August 30, 2009 (edited) Try to add semicolon after COMMIT Also use BEGIN together with COMMIT _SQLite_Exec($DBN, "BEGIN;") _SQLite_Exec($DBN, "DELETE FROM "&$curtable&" WHERE id = '" & $curpersonid & "';") _SQLite_Exec($DBN, "COMMIT;") EDIT: In many simple scripts you can also use DELETE without COMMIT _SQLite_Exec($DBN, "DELETE FROM "&$curtable&" WHERE id = '" & $curpersonid & "';") Thanks 4 answer but, --> Function: _SQLite_Exec --> Query: COMMIT; --> Error: cannot commit transaction - SQL statements in progress Lemme guess, i have to _SQLite_Close($DBN) after any exec or query ?? or, _SQLite_Exec($DBN, "END;") before COMMIT ? Edited August 30, 2009 by mistakilla ~ Every Living Thing is a Code Snippet of World Application ~ Link to comment Share on other sites More sharing options...
Zedna Posted August 30, 2009 Share Posted August 30, 2009 (edited) No. Your guess are wrong. Post more (whole) code. Edited August 30, 2009 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
aNewLyfe Posted August 30, 2009 Author Share Posted August 30, 2009 No. Your guess are wrong.Post more (whole) code.solved. you gave me the idea so thank you very much !ive just _SQLite_QueryFinalize($hQuery)'ed. and that silly journal file gone. btw, it ate my 1 day ~ Every Living Thing is a Code Snippet of World Application ~ Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now