SQLite User Forum

Database does not update
Login

Database does not update

(1) By davis (gagsters888) on 2022-06-27 14:31:49 [link] [source]

Hi,

I tried to execute SQL query but my database does not seem to update it even though the query was executed successfully.

Appreciate if you are able to help

(2.1) By Chris Locke (chrisjlocke1) on 2022-06-27 15:16:29 edited from 2.0 in reply to 1 [link] [source]

What programming language did you execute your SQL in? Have you got an example?
If you begin your SQL with 'begin', then you have to confirm the SQL with 'commit' - it won't be executed until that statement.
Have you tried using the sqlite command-line program?
What operating system are you using?
Is the database on a local drive, network location or some wacky virtual filesystem?

(3) By Harald Hanche-Olsen (hanche) on 2022-06-27 18:03:55 in reply to 1 [link] [source]

To add a bit to what Chris said: Some sqlite bindings in other languages – the python sqlite3 module comes to mind – will automatically open a transaction when you connect to a db file, so that you will have to execute a commit before closing, or the entire transaction is aborted.

(4) By davis (gagsters888) on 2022-06-28 00:53:41 in reply to 3 [source]

Hi Chris and Harald,

Thank you for your prompt reply.

Please refer to the below URL for the example I am referring to in the video.

https://www.youtube.com/watch?v=gIPvqazhZKY

In reference to the video, Actually the issue is when I am at the Browse Data tab which shows the database, after I add new rows in the database and click write changes, I switch to the other tabs such as the "Edit Pragmas / Database Structure / Execute SQL " and when I switch back to the "Browse Data" tab, the database was not updated with the new rows.

I am using windows 10, I save the database in my local drive.

(5) By Simon Slavin (slavin) on 2022-06-28 01:56:22 in reply to 4 [link] [source]

I saw the beginning of the video. Sorry, we can't help. The 'bug' you refer to does not exist in SQLite. It is in the program you are using.

You are using an application called DB Browser. That is not SQLite, it's a program which uses SQLite. If that program is misbehaving you need to contact whoever maintains it, which is not the SQLite team.

(6) By Larry Brasfield (larrybr) on 2022-06-28 02:51:40 in reply to 4 [link] [source]

I concur with Simon's comments on this, and have a few more.

When I install the same application on my Xubuntu system, then modify some fields using the same sequence as shown in your video, I can close the DB, reopen it, and observe that the modified values are still there. This was after creating the DB in a directory for which I had write permission. This makes me think there is something going wrong for you which is not evident in your video.

I was very tempted, as usual under similar circumstances, to just ignore your post. My initial reaction to invitations such as "Dig through this load of mostly extraneous information to see what I'm doing" is to decline under this hypothesis: If somebody cannot take the trouble to abstract and report what they see as the relevant aspects of their problem, then I see their problem as worth very little trouble on my part.

To repeat and underscore Simon's observation: The SQLite library, as released, has never had such a fundamental failure as "Database does not update" when properly instructed. In this case, it is not being properly instructed. Whether that is because your "DB Browser for SQLite" is failing or because you are misusing that application is impossible to see in that little video. I'm guessing the latter because the current version of the application works for me and the feature not working for you is very fundamental and has probably worked from the application's inception.

(8.1) By Chris Locke (chrisjlocke1) on 2022-07-01 09:45:52 edited from 8.0 in reply to 4 [link] [source]

the database was not updated with the new rows.

When you are in the 'Browse Data' tab and you add rows, the rows are added to the database. When you switch tabs and 'the database was not updated', do you mean these rows you added were removed? Do you have another application or DB Browser for SQLite window open into the same database?

Unsure why you added a video about editing cell data when you are adding rows.

The application has a log window which reports the output from SQLite. Does this report any errors?

Note that this forum is primarily for the support of SQLite itself, which is the library DB Browser for SQLite uses - it's a bit like you're posting in the Windows forum when you can't add an image to a Word document - the issue is really with Word, not Windows just because Word uses Windows.
The DB Browser for SQLite issue forum is here: https://github.com/sqlitebrowser/sqlitebrowser/issues

(7) By riya parashar (riyap081) on 2022-07-01 08:58:46 in reply to 1 [link] [source]

When a query is executed the database should be updated as well. You can use the return value of the Execute Non-Query to check whether the query was executed or not.

(9) By Kees Nuyt (knu) on 2022-07-01 10:58:24 in reply to 1 [link] [source]

Did you click the "Write changes" button at the top of the screen?