Re: [sqlite] BLOB and TEXT comparisons

2019-07-13 Thread Darren Duncan
What's going on is that a Blob and a Text are logically different values and so can never possibly equal each other. Also they aren't represented by the same bytes either, because every value includes its type and the comparison is comparing the bytes indicating the type as well, which

Re: [sqlite] BLOB and TEXT comparisons

2019-07-12 Thread Clemens Ladisch
Charles Leifer wrote: > SELECT SUBSTR(?, 1, 3) == ? > > However, if I mix the types, e.g. sqlite3_bind_text("abcde") and > sqlite3_bind_blob("abc") then the comparison returns False. > > Fom a byte-to-byte perspective, this comparison should always return True. > > What's going on? Apparently,

[sqlite] BLOB and TEXT comparisons

2019-07-12 Thread Charles Leifer
I ran into a somewhat surprising result and wanted to just get a little clarification. I'll use the following statement as an example: SELECT SUBSTR(?, 1, 3) == ? And the parameters will be: * "abcde" * "abc" If I bind both parameters using the same type, the comparison returns True: *

Re: [sqlite] Blob and Text columns: what's the difference?

2018-08-28 Thread Tim Streater
On 28 Aug 2018, at 15:36, Keith Medcalf wrote: > On Tuesday, 28 August, 2018 07:50, Tim Streater wrote: >>How does it know not to do that if I want to send some binary data to a Text >>column? > > Simply because you do not request that those things be done. > > So, the "things" that may occur

Re: [sqlite] Blob and Text columns: what's the difference?

2018-08-28 Thread Keith Medcalf
On Tuesday, 28 August, 2018 07:50, Tim Streater wrote: >What is actually the difference between a column declared as TEXT and >one declared as BLOB in an SQLite database? Not a thing. You are free to store data of any type in any column in any row. The "TEXT" declaration only means that

Re: [sqlite] Blob and Text columns: what's the difference?

2018-08-28 Thread Ben Asher
Ah great to know. Thanks! Ben On Tue, Aug 28, 2018 at 7:29 AM Richard Hipp wrote: > On 8/28/18, Ben Asher wrote: > > I seem to remember that BLOBs cannot be indexed. I can’t find > documentation > > on that though. Does anyone else recall the same thing and have a link, > or > > maybe someone

Re: [sqlite] Blob and Text columns: what's the difference?

2018-08-28 Thread Richard Hipp
On 8/28/18, Ben Asher wrote: > I seem to remember that BLOBs cannot be indexed. I can’t find documentation > on that though. Does anyone else recall the same thing and have a link, or > maybe someone can correct me? You might be remembering the limitations of Oracle. Other database engines

Re: [sqlite] Blob and Text columns: what's the difference?

2018-08-28 Thread Simon Slavin
On 28 Aug 2018, at 2:50pm, Tim Streater wrote: > What is actually the difference between a column declared as TEXT and one > declared as BLOB in an SQLite database? What does SQLite do to textual data > that I ask it to put into a TEXT column? BLOB data is always handled as a block of a

Re: [sqlite] Blob and Text columns: what's the difference?

2018-08-28 Thread J. King
On 2018-08-28 09:50:01, "Tim Streater" wrote: What is actually the difference between a column declared as TEXT and one declared as BLOB in an SQLite database? What does SQLite do to textual data that I ask it to put into a TEXT column? How does it know not to do that if I want to send some

Re: [sqlite] Blob and Text columns: what's the difference?

2018-08-28 Thread Ben Asher
I seem to remember that BLOBs cannot be indexed. I can’t find documentation on that though. Does anyone else recall the same thing and have a link, or maybe someone can correct me? Ben On Tue, Aug 28, 2018 at 6:50 AM Tim Streater wrote: > What is actually the difference between a column

[sqlite] Blob and Text columns: what's the difference?

2018-08-28 Thread Tim Streater
What is actually the difference between a column declared as TEXT and one declared as BLOB in an SQLite database? What does SQLite do to textual data that I ask it to put into a TEXT column? How does it know not to do that if I want to send some binary data to a Text column? The reason I'm

Re: [sqlite] BLOB sizes beyond 2GB?

2017-03-28 Thread Paul Sanderson
I was a bit/very dull, schoolboy error :( re 32-bit - long week and it's only Tuesday :) Re: storing the length in the blob itself this would affect parsing the serial types where, as now, you can determine the record length by looking at the serial types and 'skip' through them to load a

Re: [sqlite] BLOB sizes beyond 2GB?

2017-03-28 Thread Dominique Devienne
On Tue, Mar 28, 2017 at 12:52 PM, Paul Sanderson < sandersonforens...@gmail.com> wrote: > I am sure Richard will correct me if I am wrong. But... > > The format for a record is > > 1. payload length varint > 2. rowid varint (optional) > 3. serial type array varint > 4. serial types > followed by

Re: [sqlite] BLOB sizes beyond 2GB?

2017-03-28 Thread Paul Sanderson
I am sure Richard will correct me if I am wrong. But... The format for a record is 1. payload length varint 2. rowid varint (optional) 3. serial type array varint 4. serial types followed by the data for the serial types The issue are as I see them: The payload length varint above, this is the

Re: [sqlite] BLOB sizes beyond 2GB?

2017-03-28 Thread Dominique Devienne
On Tue, Mar 28, 2017 at 11:08 AM, Richard Hipp wrote: > On 3/27/17, Andrew Cunningham wrote: > > Is it likely the maximum BLOB size will be increased in a not too distant > > future version of SQLite? > > The maximum blob size could, in theory, be

Re: [sqlite] BLOB sizes beyond 2GB?

2017-03-28 Thread Richard Hipp
On 3/27/17, Andrew Cunningham wrote: > HI, > Is it likely the maximum BLOB size will be increased in a not too distant > future version of SQLite? > The maximum blob size could, in theory, be increased to 4GiB. But the current file format will not accommodate anything

[sqlite] BLOB sizes beyond 2GB?

2017-03-28 Thread Andrew Cunningham
HI, Is it likely the maximum BLOB size will be increased in a not too distant future version of SQLite? In a world of machines where 1TB memory is not unusual the current upper limit of ~2GB is proving to be restrictive for my use. One might suggest that storing binary data of that size using

Re: [sqlite] BLOB type not showing in table description after using create table as

2015-02-13 Thread Clemens Ladisch
Tiemogo, Idrissa wrote: > When I derive a table from another table containing blob type. > The describing the new table doesn’t show “blob". > > sqlite> create table t1 (p_id int, geometry blob); > sqlite> pragma table_info(t1); > 0|p_id|int|0||0 > 1|geometry|blob|0||0 > sqlite> create table t2 as

[sqlite] BLOB type not showing in table description after using create table as

2015-02-13 Thread Tiemogo, Idrissa
I am using sqlite 3.8.6 on MacOSX Yosemite 10.10.2. When I derive a table from another table containing blob type. The describing the new table doesn’t show “blob". See below: sqlite> select sqlite_version(); 3.8.6 sqlite> create table t1 (p_id int, geometry blob); sqlite> pragma

Re: [sqlite] blob + rowID Insert question

2014-08-28 Thread Carlos Ferreira
Thanks!! -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Igor Tandetnik Sent: sexta-feira, 29 de Agosto de 2014 00:20 To: sqlite-users@sqlite.org Subject: Re: [sqlite] blob + rowID Insert question On 8/28/2014 2:18 PM

Re: [sqlite] blob + rowID Insert question

2014-08-28 Thread Igor Tandetnik
On 8/28/2014 2:18 PM, Carlos Ferreira wrote: In the next line: UPDATE myTable SET theBlob = WHERE id = The "whatever" is a long string containing the data? The "whatever" should be ? (question mark) - a parameter placeholder ( could be another one). Prepare the statement, bind the data to

Re: [sqlite] blob + rowID Insert question

2014-08-28 Thread Simon Slavin
On 28 Aug 2014, at 7:18pm, Carlos Ferreira wrote: > Using your suggestion of the UPDATE Statement, and assuming I have a block > of memory with pointer p and size s ( different from the previous size ), > that I want to use as the data of my new blob, do you suggest I

Re: [sqlite] blob + rowID Insert question

2014-08-28 Thread Carlos Ferreira
w should I serialize it? What kind of encoding? Thanks Carlos -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Simon Slavin Sent: quinta-feira, 28 de Agosto de 2014 19:08 To: General Discussion of SQLite Database Subject: Re: [sq

Re: [sqlite] blob + rowID Insert question

2014-08-28 Thread Carlos Ferreira
Thanks :) :) -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Simon Slavin Sent: quinta-feira, 28 de Agosto de 2014 19:08 To: General Discussion of SQLite Database Subject: Re: [sqlite] blob + rowID Insert question On 28 Aug

Re: [sqlite] blob + rowID Insert question

2014-08-28 Thread Simon Slavin
On 28 Aug 2014, at 7:06pm, Carlos Ferreira wrote: > Is there any way to replace a BLOB for a give ROW ID? Use the UPDATE command: UPDATE myTable SET theBlob = WHERE id = Simon. ___ sqlite-users mailing list

[sqlite] blob + rowID Insert question

2014-08-28 Thread Carlos Ferreira
Hi All, I have a table with one unique column of the type BLOB. Because I am using the direct SQLite functions to read and write BLOBS, the access is made referencing the ROW IDs. Is there any way to replace a BLOB for a give ROW ID? If I perform DELETE and INSERT I am not sure the

Re: [sqlite] BLOB & Other Data Type

2013-08-26 Thread _ph_
You can see that e.g. with a select statement: create table test ( Name TEXT, Age Int); INSERT INTO Test VALUES ('Klaus', 22); INSERT INTO Test VALUES ('Meier', '022'); SELECT * FROM Test WHERE Age=22; In this case, the comparison is made on integers, '022' converted to integer

Re: [sqlite] BLOB & Other Data Type

2013-08-22 Thread Hick Gunter
differ (see the referenced page for examples). -Ursprüngliche Nachricht- Von: techi eth [mailto:techi...@gmail.com] Gesendet: Donnerstag, 22. August 2013 06:08 An: General Discussion of SQLite Database Betreff: [sqlite] BLOB & Other Data Type Hi, What is difference by using Colum

[sqlite] BLOB & Other Data Type

2013-08-21 Thread techi eth
Hi, What is difference by using Colum data type as blob or Any other (Text,INT,REAL,NUMERIC) http://www.sqlite.org/datatype3.html According to above link I understand “The value is a blob of data, stored exactly as it was input”.I beleive that it what required. Ex : Please let me know

Re: [sqlite] Blob Data Assignments

2012-03-23 Thread Igor Tandetnik
Nigel Verity wrote: > I'm new to SQLite, coming from an Access/VB background. Having moved over to > Linux I'm now developing an application using > Gambas. One of the requirements is to store a scanned document (PDF) in a > record as a blob, along with its metadata.

Re: [sqlite] Blob Data Assignments

2012-03-23 Thread Simon Slavin
On 23 Mar 2012, at 4:29pm, Nigel Verity wrote: > I'm new to SQLite, coming from an Access/VB background. Having moved over to > Linux I'm now developing an application using Gambas. One of the requirements > is to store a scanned document (PDF) in a record as a blob,

[sqlite] Blob Data Assignments

2012-03-23 Thread Nigel Verity
Hi I'm new to SQLite, coming from an Access/VB background. Having moved over to Linux I'm now developing an application using Gambas. One of the requirements is to store a scanned document (PDF) in a record as a blob, along with its metadata. I've no problem selecting the document, but I'm

Re: [sqlite] BLOB concatenation?

2012-01-20 Thread Pavel Ivanov
>  > SELECT quote(cast(X'5445' || X'5354' as blob)); > >        Indeed, it seems to work.  Thanks! But beware that it's not guaranteed to work if blobs have embedded '\0' character (as it's actually not guaranteed to work if blobs don't have a valid UTF-8/UTF-16 text). Although I believe it works

Re: [sqlite] BLOB concatenation?

2012-01-20 Thread Ivan Shmakov
> Pavel Ivanov writes: [...] >> Unfortunately, the string concatenation operator, when applied to >> two BLOB's, results in a text string instead of a BLOB, like: >> SELECT quote (X'5445' || X'5354'); => 'TEST' > Maybe the following? > SELECT quote(cast(X'5445' || X'5354' as blob));

Re: [sqlite] BLOB concatenation?

2012-01-20 Thread Pavel Ivanov
>        Unfortunately, the string concatenation operator, when applied >        to two BLOB's, results in a text string instead of a BLOB, like: > > SELECT quote (X'5445' || X'5354'); >  => 'TEST' Maybe the following? SELECT quote(cast(X'5445' || X'5354' as blob)); Pavel On Fri, Jan 20,

[sqlite] BLOB concatenation?

2012-01-20 Thread Ivan Shmakov
With substr (), it's possible to split a BLOB, like: SELECT quote (substr (X'1337cafe', 3, 2)); => X'CAFE' However, how do I concatenate two blobs? Unfortunately, the string concatenation operator, when applied to two BLOB's, results in a text string instead of

Re: [sqlite] Blob newbie problem

2011-05-12 Thread StyveA
Black, Michael (IS) wrote: > > Do I understand you're still seeing a segfault? I assume you're not > seeing your "Year retrieved..." statement? > > You haven't showed us your table definition. > > Change your strcmp to strcasecmp and see if that fixes it for you. > > Michael D. Black > >

Re: [sqlite] Blob newbie problem

2011-05-12 Thread Igor Tandetnik
StyveA wrote: > I tried with your tips, and I've seen that I was missing the call of my > callback function, and now the segfault is in it.. Personally, I vastly prefer sqlite3_step / sqlite3_column* interface to sqlite3_exec. I never use the latter except for

Re: [sqlite] Blob newbie problem

2011-05-12 Thread Black, Michael (IS)
on Systems Advanced Analytics Directorate From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on behalf of StyveA [styve.at...@technicolor.com] Sent: Thursday, May 12, 2011 7:39 AM To: sqlite-users@sqlite.org Subject: EXT :Re: [sqlite] Blob newb

Re: [sqlite] Blob newbie problem

2011-05-12 Thread StyveA
Igor Tandetnik wrote: > > Prepare doesn't touch the database in any way. It just parses the text of > the statement, and prepares execution plan. Step is where the real work is > done. > > You need to issue BEGIN statement if you want to start an explicit > transaction (and then COMMIT or END

Re: [sqlite] Blob newbie problem

2011-05-12 Thread Igor Tandetnik
StyveA wrote: > For the COMMIT/END point, I though that sqlite_prepare(..) was sufficient > to do it, so Begin is mandatory? Prepare doesn't touch the database in any way. It just parses the text of the statement, and prepares execution plan. Step is where the real

Re: [sqlite] Blob newbie problem

2011-05-12 Thread StyveA
Igor Tandetnik wrote: > > StyveA wrote: >> I'm a newbie using sqlite3, and i'm trying to save in a database some >> blob >> datas (just string and integer), >> but I can't get my data back.. I just obtain a segfault.. >> I have searched in forums, but did'nt find

Re: [sqlite] Blob newbie problem

2011-05-12 Thread Igor Tandetnik
StyveA wrote: > I'm a newbie using sqlite3, and i'm trying to save in a database some blob > datas (just string and integer), > but I can't get my data back.. I just obtain a segfault.. > I have searched in forums, but did'nt find anything that could help me.. > > int

[sqlite] Blob newbie problem

2011-05-12 Thread StyveA
Hello, I'm a newbie using sqlite3, and i'm trying to save in a database some blob datas (just string and integer), but I can't get my data back.. I just obtain a segfault.. I have searched in forums, but did'nt find anything that could help me.. Here is my code :

Re: [sqlite] Blob in the callback of sqlite3_exec

2011-02-08 Thread Ray
Thanks. You remind me those NULs :) On Feb 8, 12:12 am, "Igor Tandetnik" wrote: > Ray wrote: > > What's the actual type of blob in the callback of sqlite3_exec? Is it > > string or remains binary? > > Bytes are reported as-is, with an added zero

Re: [sqlite] Blob in the callback of sqlite3_exec

2011-02-07 Thread Igor Tandetnik
Ray wrote: > What's the actual type of blob in the callback of sqlite3_exec? Is it > string or remains binary? Bytes are reported as-is, with an added zero terminator. But since there's no length indicator, you'll have trouble with embedded NULs. Drop sqlite3_exec, use

[sqlite] Blob in the callback of sqlite3_exec

2011-02-07 Thread Ray
Hi guys, What's the actual type of blob in the callback of sqlite3_exec? Is it string or remains binary? Since when I query the database to get all rows and columns the blob values are not same as what I get from other SQLite tools. ___ sqlite-users

Re: [sqlite] is there any way for create a sqlite blob field with python?

2010-06-16 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 06/16/2010 11:35 AM, Fabio Spadaro wrote: > You can also determine the path and file name from the blob or should I > create a column attached with this information stored? You are overthinking this. A blob is just a collection of bytes in the

Re: [sqlite] is there any way for create a sqlite blob field with python?

2010-06-16 Thread Fabio Spadaro
Hi, 2010/6/16 Roger Binns > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 06/16/2010 04:14 AM, Fabio Spadaro wrote: > > But the next time I select a single line instead of two: > > fetchall [( > 0x02CC2A30>,)] > > > > What's wrong. > > Errr, nothing.

Re: [sqlite] is there any way for create a sqlite blob field with python?

2010-06-16 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 06/16/2010 04:14 AM, Fabio Spadaro wrote: > But the next time I select a single line instead of two: > fetchall [( 0x02CC2A30>,)] > > What's wrong. Errr, nothing. Blobs are returned as buffers too. (This way you can distinguish them

Re: [sqlite] BLOB Support

2010-06-16 Thread Sam Carleton
On Wed, Jun 16, 2010 at 10:04 AM, Teg wrote: > Hello Sam, > > I store multiple gigs of image files, some as large as 2-3 megs in > Sqlite DB's. For pretty much the same reason, the convenience of > having them in one package. For my requirements, extracting the images > from the

Re: [sqlite] BLOB Support

2010-06-16 Thread Teg
Hello Sam, I store multiple gigs of image files, some as large as 2-3 megs in Sqlite DB's. For pretty much the same reason, the convenience of having them in one package. For my requirements, extracting the images from the DB, and displaying them isn't a bottleneck. It's fast enough. Search

Re: [sqlite] is there any way for create a sqlite blob field with python?

2010-06-16 Thread Fabio Spadaro
Hi, 2010/6/15 Roger Binns > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 06/15/2010 01:46 PM, Fabio Spadaro wrote: > > I am developing an interface to Python 's SQLite and would it be > > you can store files in the sqlite database. To do this > > obviously need

Re: [sqlite] BLOB Support

2010-06-16 Thread Sam Carleton
On Wed, Jun 16, 2010 at 8:34 AM, P Kishor wrote: > On Wed, Jun 16, 2010 at 7:23 AM, Andreas Henningsson > wrote: >> Do some testing to find out if it suits the application you develop. >> But just in general .. file systems are build to handle

Re: [sqlite] is there any way for create a sqlite blob field with python?

2010-06-16 Thread Fabio Spadaro
Hi, 2010/6/16 Fabio Spadaro > Hi > > 2010/6/15 Roger Binns > > -BEGIN PGP SIGNED MESSAGE- >> Hash: SHA1 >> >> On 06/15/2010 01:46 PM, Fabio Spadaro wrote: >> > I am developing an interface to Python 's SQLite and would it be >> > you can

Re: [sqlite] BLOB Support

2010-06-16 Thread P Kishor
On Wed, Jun 16, 2010 at 7:23 AM, Andreas Henningsson wrote: > Do some testing to find out if it suits the application you develop. > But just in general .. file systems are build to handle files, databases are > for handle data. > Well, at the risk of being

Re: [sqlite] BLOB Support

2010-06-16 Thread Andreas Henningsson
Do some testing to find out if it suits the application you develop. But just in general .. file systems are build to handle files, databases are for handle data. I don't think BLOB in SQlite will increasing the performance compared to store the files in the file system. Some SQlite APIs do not

Re: [sqlite] BLOB Support

2010-06-16 Thread P Kishor
for some reason, I remember you asking the same question not too long ago, and getting a bunch of answers. I recall chipping in with an answer myself. DIdn't any of those answers help? On Wed, Jun 16, 2010 at 1:58 AM, Navaneeth Sen B wrote: > Hi All, > I would like to

Re: [sqlite] is there any way for create a sqlite blob field with python?

2010-06-16 Thread Fabio Spadaro
Hi 2010/6/15 Roger Binns > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 06/15/2010 01:46 PM, Fabio Spadaro wrote: > > I am developing an interface to Python 's SQLite and would it be > > you can store files in the sqlite database. To do this > > obviously need

Re: [sqlite] BLOB Support

2010-06-16 Thread Simon Slavin
On 16 Jun 2010, at 8:14am, Navaneeth Sen B wrote: > I am using SQLite. > > Thanks > Sen > > ** > > On 6/16/2010 12:40 PM, Simon Slavin wrote: >> On 16 Jun 2010, at 7:58am, Navaneeth Sen B wrote: >> >>> 3. What is the difference produced in storing the

Re: [sqlite] BLOB Support

2010-06-16 Thread Navaneeth Sen B
Hi Simon, I am using SQLite. Thanks Sen ** On 6/16/2010 12:40 PM, Simon Slavin wrote: > On 16 Jun 2010, at 7:58am, Navaneeth Sen B wrote: > > >>3. What is the difference produced in storing the file inside DB(not >> in blob format) and storing

Re: [sqlite] BLOB Support

2010-06-16 Thread Simon Slavin
On 16 Jun 2010, at 7:58am, Navaneeth Sen B wrote: > 3. What is the difference produced in storing the file inside DB(not > in blob format) and storing the same file in BLOB format in the DB? What tool are you expecting to use to store the file inside the DB ? Simon.

[sqlite] BLOB Support

2010-06-16 Thread Navaneeth Sen B
Hi All, I would like to know more about this BLOB support in SQLite. Some of my queries are: 1. One of my colleague suggested that using BLOB support for storing images in the DB is a good idea, whereas storing AVCHD data(huge size) as blobs is not a good idea. I need a bit more

Re: [sqlite] is there any way for create a sqlite blob field with python?

2010-06-15 Thread Simon Slavin
On 15 Jun 2010, at 10:26pm, Roger Binns wrote: > On 06/15/2010 02:16 PM, Simon Slavin wrote: >> An image file is just a file. If you really want to store a file in a >> database, open the file, read the contents, and store what you read in a >> BLOB field. > > That is the general correct

Re: [sqlite] is there any way for create a sqlite blob field with python?

2010-06-15 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 06/15/2010 02:16 PM, Simon Slavin wrote: > An image file is just a file. If you really want to store a file in a > database, open the file, read the contents, and store what you read in a BLOB > field. That is the general correct answer but not

Re: [sqlite] is there any way for create a sqlite blob field with python?

2010-06-15 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 06/15/2010 01:46 PM, Fabio Spadaro wrote: > I am developing an interface to Python 's SQLite and would it be > you can store files in the sqlite database. To do this > obviously need to create a blob field but how to store image files? If you are

Re: [sqlite] is there any way for create a sqlite blob field with python?

2010-06-15 Thread Simon Slavin
On 15 Jun 2010, at 9:46pm, Fabio Spadaro wrote: > I am developing an interface to Python 's SQLite and would it be > you can store files in the sqlite database. To do this > obviously need to create a blob field but how to store image files? An image file is just a file. If you really want to

[sqlite] is there any way for create a sqlite blob field with python?

2010-06-15 Thread Fabio Spadaro
Hi all. I am developing an interface to Python 's SQLite and would it be you can store files in the sqlite database. To do this obviously need to create a blob field but how to store image files? -- Fabio Spadaro www.fabiospadaro.com ___ sqlite-users

[sqlite] BLOB handle expires when unrelated table is UPDATED!?

2010-01-18 Thread a1rex
According to the documentation athttp://www.sqlite.org/c3ref/blob_open.html “ If the row that a BLOB handle points to is modified by an UPDATE, DELETE, or by ON CONFLICT side-effects then the BLOB handle is marked as "expired". This is true if any column of the row is changed, even a column

Re: [sqlite] Which is faster raw file I/O or sqlite BLOB

2009-12-29 Thread Pavel Ivanov
of them then SQLite will be faster. Pavel On Tue, Dec 29, 2009 at 3:55 AM, _h_ <hiralsmaill...@gmail.com> wrote: > Hi, > > I am planning to use BLOB to store file contents. > So can you please suggest, which is faster 'raw file I/O' or 'sqlite BLOB'. > > >

[sqlite] Which is faster raw file I/O or sqlite BLOB

2009-12-29 Thread _h_
Hi, I am planning to use BLOB to store file contents. So can you please suggest, which is faster 'raw file I/O' or 'sqlite BLOB'. Thank you in advance. -H ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman

Re: [sqlite] blob c/c++ sample code

2009-07-09 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Wayne Anderson wrote: > I'm unclear about several things, but chief among them is how to set > the initial size of a blob. If you are using SQL then use: INSERT into foo values(zeroblob(12345)) If you are using bindings with a statement like:

[sqlite] blob c/c++ sample code

2009-07-09 Thread Wayne Anderson
Hello, I'm converting an old application file format to use SQLite as a back end. For several sections of the file data I will need to use blobs. I'm unclear about several things, but chief among them is how to set the initial size of a blob. The documentation indicates that you need

Re: [sqlite] BLOB Literals and NULL

2009-05-22 Thread John Machin
On 23/05/2009 10:56 AM, Greg and Tracy Hill wrote: > Is it possible to use the BLOB literal sytax X'ABCD' with encoded NULLs? > > For example: > > INSERT INTO mytable VALUES (X'BADF00D0') I see no NULL here, encoded or otherwise. I don't even see an ASCII NUL here; NUL is character terminology,

Re: [sqlite] BLOB Literals and NULL

2009-05-22 Thread Simon Slavin
On 23 May 2009, at 1:56am, Greg and Tracy Hill wrote: > Is it possible to use the BLOB literal sytax X'ABCD' with encoded > NULLs? My understanding is that you can store anything you want as a BLOB. But that when you read that value back again, you'll get a BLOB back. You can't write a

Re: [sqlite] BLOB Literals and NULL

2009-05-22 Thread Igor Tandetnik
"Greg and Tracy Hill" wrote in message news:bay112-w186a5fad8703c04c8f30c0dd...@phx.gbl > Is it possible to use the BLOB literal sytax X'ABCD' with encoded > NULLs? Yes. > For example: > > INSERT INTO mytable VALUES (X'BADF00D0') > > When I do this, the length of the data is

[sqlite] BLOB Literals and NULL

2009-05-22 Thread Greg and Tracy Hill
Is it possible to use the BLOB literal sytax X'ABCD' with encoded NULLs? For example: INSERT INTO mytable VALUES (X'BADF00D0') When I do this, the length of the data is 2 instead of the expected 4. I know I could use prepared statements but the library I am using doesn't expose them. Any

Re: [sqlite] Blob length in characters vs size in bytes

2009-05-13 Thread John Machin
On 14/05/2009 12:23 AM, Salvatore Di Guida wrote: > Hi all! > Since I am a newcomer in SQLite, as a preliminary question, what is the > difference between > sqlite> select length(X'01'); > and > sqlite> select length('01'); > It seems that the former gives the size in bytes, the latter the

Re: [sqlite] Blob length in characters vs size in bytes

2009-05-13 Thread Igor Tandetnik
Salvatore Di Guida wrote: > If so, why do this query return very different answers: > sqlite> select length(X'01'); > 1 > sqlite> select length(X'0'); > SQL error: unrecognized token: "X'0'" ? X'0' is not a valid BLOB literal, so SQLite reports a syntax error. BLOB

Re: [sqlite] Blob length in characters vs size in bytes

2009-05-13 Thread Salvatore Di Guida
Hi! Other questions inline: > To: sqlite-users@sqlite.org > From: itandet...@mvps.org > Date: Wed, 13 May 2009 11:48:11 -0400 > Subject: Re: [sqlite] Blob length in characters vs size in bytes > > Salvatore Di Guida <diguid...@hotmail.com> > wrote: > >

Re: [sqlite] Blob length in characters vs size in bytes

2009-05-13 Thread Igor Tandetnik
Salvatore Di Guida wrote: > Since I am a newcomer in SQLite, as a preliminary question, what is > the difference between > sqlite> select length(X'01'); > and > sqlite> select length('01'); > It seems that the former gives the size in bytes, the latter the > length of the

[sqlite] Blob length in characters vs size in bytes

2009-05-13 Thread Salvatore Di Guida
Hi all! Since I am a newcomer in SQLite, as a preliminary question, what is the difference between sqlite> select length(X'01'); and sqlite> select length('01'); It seems that the former gives the size in bytes, the latter the length of the string. The SQLite documentation says that the

Re: [sqlite] BLOB Incremental IO

2008-10-31 Thread Sherief N. Farouk
> I have a problem with BLOB writing. I need to write > some binary stream into sqlite table. As I understood, incremental > BLOB I/O requires space of constant size to be preallocated > with zeroblob, but I don't know the size of stream in advance. > And sqlite doesn't allow to change the size of

Re: [sqlite] BLOB Incremental IO

2008-10-31 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 ??? wrote: > As I understood, incremental > BLOB I/O requires space of constant size to be preallocated > with zeroblob, That is correct. > but I don't know the size of stream in advance. Then you can't use the incremental I/O for

[sqlite] BLOB Incremental IO

2008-10-31 Thread ??????? ????????
I have a problem with BLOB writing. I need to write some binary stream into sqlite table. As I understood, incremental BLOB I/O requires space of constant size to be preallocated with zeroblob, but I don't know the size of stream in advance. And sqlite doesn't allow to change the size of BLOB

Re: [sqlite] blob /transaction wierdness

2008-07-01 Thread smlacc1 leador
this worked great. thank you. On Tue, Jul 1, 2008 at 6:10 PM, Igor Tandetnik <[EMAIL PROTECTED]> wrote: > smlacc1 leador <[EMAIL PROTECTED]> wrote: > > I'm having some trouble with blobs. I have 4 blobs tht I want to > > insert into a db, and it works fine when I execute each insert as a > >

Re: [sqlite] blob /transaction wierdness

2008-07-01 Thread Alex Katebi
Can you update your SQLite to the latest revision? On Tue, Jul 1, 2008 at 3:42 PM, smlacc1 leador <[EMAIL PROTECTED]> wrote: > Hi, > > I'm having some trouble with blobs. I have 4 blobs tht I want to insert > into a db, and it works fine when I execute each insert as a single commit. > However,

Re: [sqlite] blob /transaction wierdness

2008-07-01 Thread smlacc1 leador
ok, I'll try that. Thanks. On Tue, Jul 1, 2008 at 6:10 PM, Igor Tandetnik <[EMAIL PROTECTED]> wrote: > smlacc1 leador <[EMAIL PROTECTED]> wrote: > > I'm having some trouble with blobs. I have 4 blobs tht I want to > > insert into a db, and it works fine when I execute each insert as a > >

Re: [sqlite] blob /transaction wierdness

2008-07-01 Thread Ken
Yup thats what i was thinking, sqlite3_column. My mistake and thanks for catching that! Igor Tandetnik <[EMAIL PROTECTED]> wrote: Ken wrote: > Column numbering for binding starts at 0 Not 1. > sqlite3_bind_blob(state,1,c1,1,SQLITE_TRANSIENT); Not true. Parameters in sqlite3_bind_* are

Re: [sqlite] blob /transaction wierdness

2008-07-01 Thread Igor Tandetnik
smlacc1 leador <[EMAIL PROTECTED]> wrote: > I'm having some trouble with blobs. I have 4 blobs tht I want to > insert into a db, and it works fine when I execute each insert as a > single commit. However, when i try to use transactions to input > blocks of 255 inserts, blob 4 gets inputted in the

Re: [sqlite] blob /transaction wierdness

2008-07-01 Thread Igor Tandetnik
Ken <[EMAIL PROTECTED]> wrote: > Column numbering for binding starts at 0 Not 1. > sqlite3_bind_blob(state,1,c1,1,SQLITE_TRANSIENT); Not true. Parameters in sqlite3_bind_* are numbered from 1. Columns in sqlite3_column_* are numbered from 0. Igor Tandetnik

Re: [sqlite] blob /transaction wierdness

2008-07-01 Thread Ken
Column numbering for binding starts at 0 Not 1. sqlite3_bind_blob(state,1,c1,1,SQLITE_TRANSIENT); smlacc1 leador <[EMAIL PROTECTED]> wrote: Hi, I'm having some trouble with blobs. I have 4 blobs tht I want to insert into a db, and it works fine when I execute each insert as a single

Re: [sqlite] blob /transaction wierdness

2008-07-01 Thread Ken
Column numbering for binding starts at 0 Not 1. sqlite3_bind_blob(state,1,c1,1,SQLITE_TRANSIENT); smlacc1 leador <[EMAIL PROTECTED]> wrote: Hi, I'm having some trouble with blobs. I have 4 blobs tht I want to insert into a db, and it works fine when I execute each insert as a single

[sqlite] blob /transaction wierdness

2008-07-01 Thread smlacc1 leador
Hi, I'm having some trouble with blobs. I have 4 blobs tht I want to insert into a db, and it works fine when I execute each insert as a single commit. However, when i try to use transactions to input blocks of 255 inserts, blob 4 gets inputted in the position of blob3, blob 3 in position of

Re: [sqlite] blob error

2008-05-20 Thread D. Richard Hipp
On May 20, 2008, at 8:16 AM, [EMAIL PROTECTED] wrote: > Hello i'm using sqlite with turbogears, and any time i try to store > a file in a blobcol of more that 1mb i get this error: > DataError: String or BLOB exceeded size limit > > reading the paper the default value of sqlite for blobclo is

[sqlite] blob error

2008-05-20 Thread [EMAIL PROTECTED]
Hello i'm using sqlite with turbogears, and any time i try to store a file in a blobcol of more that 1mb i get this error: DataError: String or BLOB exceeded size limit reading the paper the default value of sqlite for blobclo is 10 but why i get this error Thanks and Regards Luca

Re: [sqlite] Blob truncation

2008-04-24 Thread Dennis Cote
Vasil Boshnyakov wrote: > > It is not so effective to read the file twice - the first time to check the > compressed size and the second pass - to do the actual streaming in the > blob. That is what I am trying to avoid. Yes, I understand that, but SQLite is designed to store and retrieve

Re: [sqlite] blob :: storing files within sqlite3

2008-04-24 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 João Macaíba wrote: > I've installed sqlite3 through a binary package. How can I know what is > the maximum length permited to a blob column ? The sqlite3_limit C api can tell you (introduced in 3.5.8). Unless compiled with a non-default value for

Re: [sqlite] blob :: storing files within sqlite3

2008-04-24 Thread Eduardo Morras
At 09:57 24/04/2008, you wrote: >Hi. > >I intend to use sqlite3 to store files. > >I've tested inserting an 7.6MB file in a blob column but it returns a >SQLite3::TooBigException. I'm using ruby API. > >I've installed sqlite3 through a binary package. How can I know what is >the maximum length

Re: [sqlite] blob :: storing files within sqlite3

2008-04-24 Thread John Stanton
My guees is that you have encountered a limitation in the Ruby wrapper. Can you write the BLOB in chunks using your interface? João Macaíba wrote: > Hi. > > I intend to use sqlite3 to store files. > > I've tested inserting an 7.6MB file in a blob column but it returns a >

  1   2   3   >