• Welcome, Guest. Please login.
 
September 17, 2019, 10:55:32 am

News:

Welcome to the SQLitening support forums!


Loading image into sqlite database

Started by jackf, September 02, 2015, 08:43:30 am

Previous topic - Next topic

jackf

Hi,

I am trying to insert images , pdf files, text files into sqlite database. can you please help me on this.

I tried to store images into database by "blob" data. But I am having issues with it.

1. Is there any way store and retrieve the files like(images, pdf files etc) into sqlite database through command terminal.

2. If there is a way how can I do that please provide me commands

3. If not please provide me the alternate methods to overcome my issue.

Note: My requirement is to store the files into database not in physical location by storing path in database.

Please help me.

Jean-Pierre LEROY

September 02, 2015, 11:23:43 am #1 Last Edit: September 03, 2015, 08:14:15 am by Jean-Pierre LEROY
Hi Jack,

This topic could help you:

http://www.sqlitening.com/support/index.php?topic=2600

Regards,
Jean-Pierre

jackf

Hi,,


Thanks for the prompt response. I read the post already.. But I my question is how to insert/retrieve  images through command terminal or by using PHP code..


Thank You,
Jack

Bern Ertl

1. No, unless you can type in the binary data representing the document.

3. BLOB data is the only way.

CREATE TABLE IF NOT EXISTS ExtDoc ( RowID AS INTEGER PRIMARY KEY, xData)
INSERT INTO ExtDoc ( xData) VALUES (?)
<bind buffer holding binary data>

Are you using SQLitening or SQLite?

jackf

Hi Bern,

Thanks for the information. Please give me an example to insert images and retrieve images from the database.

I am using "Sqlite".

Note: I am not clear about "xData" can you please explain me in detail.

Thank you,

Bern Ertl

ExtDoc is just a name I chose for a sample Table
xData is just a name I chose for a sample field of Table ExtDoc.

Those were just basic SQL statement examples.  I might suggest you do some reading here:

http://www.sqlite.org/lang.html

SQLite functions are explained here:

http://www.sqlite.org/c3ref/funclist.html

I don't have a complete SQLite code to share with you.  I do most of my coding with SQLitening.