Python Forum
How retrieve sqlite3 database saved image and access in python3
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How retrieve sqlite3 database saved image and access in python3
#1
I stored image file in sqlite3 database. Now i need to get that image and show. How i get back that image from database.
??
Reply
#2

  1. Check if you have sqlite3 command shell by typing (change directory to where database is located):
    sqlite3 mydatabasename
  2. If not installed, following instructions here: https://sqlite.org/cli.html
  3. Once installed, start the tool from command line by typing command in step 1.
  4. If you want to see command list, type .help
  5. type
    .output 'my_database_tables.sql';
  6. type
    .dump
  7. type
    .quit

Now the entire database will be in sql format in a file named 'my_database_tables.sql'
You can examine the data to determine where your image is located.
Once you know that, you can restart sqlite3 command line tool and use SQL to select and dump the image.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Create SQLite3 database with peewee Jim53_1980 2 600 Dec-20-2023, 02:38 PM
Last Post: buran
  Regex replace in SQLite3 database WJSwan 1 749 Dec-04-2023, 05:55 PM
Last Post: Larz60+
  Rows not adding to sqlite3 database using SQLAlchemy Calab 11 1,597 Jun-02-2023, 05:53 PM
Last Post: bowlofred
  Basic SQL query using Py: Inserting or querying sqlite3 database not returning data marlonbown 3 1,304 Nov-08-2022, 07:16 PM
Last Post: marlonbown
  Using .pb saved model for object detection hobbyist 2 1,139 Aug-03-2022, 05:55 AM
Last Post: hobbyist
  bytes object saved as .mp4 jttolleson 10 5,750 Feb-25-2022, 02:42 PM
Last Post: jttolleson
  Python Variables and Sqlite3 Database Staples200 1 3,092 May-25-2021, 02:40 AM
Last Post: Staples200
  Why can't numpy array be restored to a saved value? pjfarley3 1 1,683 Nov-25-2020, 07:40 AM
Last Post: pjfarley3
  sqlite3 database problem Maryan 2 2,427 Oct-05-2020, 05:21 AM
Last Post: buran
  Only getting last record saved...Why Milfredo 10 4,275 Sep-10-2020, 03:00 AM
Last Post: Milfredo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020