Re: [sqlite] Sorry, trivail question probably, chr(0) in blob.
Sorry for asking, but is there a read blob for this without binding? At this moment i'm using ..GetTable() and seems to offer only null terminated strings. - Original Message - From: "Christian Smith" <[EMAIL PROTECTED]> To: <sqlite-users@sqlite.org> Sent: Wednesday, July 27, 2005 6:13 PM Subject: Re: [sqlite] Sorry, trivail question probably, chr(0) in blob. On Wed, 27 Jul 2005, Edwin Knoppert wrote: I reread the faq hundred times but i don't understand the \000 remark. For INSERT how can i embed BLOB data having single quote and chr(0) bytes? Currently i replace all singlequotes with 2x single quotes and that works fine. The chr(0) byte did not succeed. I'm using the dll and don't do any c to prepare me the encoding call(s). Afaik this one should be obsolete with v3.x anyway is it? BLOBS can be inserted by using the form: X'x1x2x3..xn' Where: x1..xn are two hex-digit representation of data. eg. sqlite> select X'48656c6c6f20576f726c6400'; Hello World sqlite> select quote(X'48656c6c6f20576f726c6400'); X'48656C6C6F20576F726C6400' You'll have to convert to the hex form yourself, as SQL appears to have no way to quote NUL bytes within a string. Thanks! -- /"\ \ /ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL X - AGAINST MS ATTACHMENTS / \
Re: [sqlite] Sorry, trivail question probably, chr(0) in blob.
Wow, super! I made a very fast converter for that so.. Thanks! - Original Message - From: "Christian Smith" <[EMAIL PROTECTED]> To: <sqlite-users@sqlite.org> Sent: Wednesday, July 27, 2005 6:13 PM Subject: Re: [sqlite] Sorry, trivail question probably, chr(0) in blob. On Wed, 27 Jul 2005, Edwin Knoppert wrote: I reread the faq hundred times but i don't understand the \000 remark. For INSERT how can i embed BLOB data having single quote and chr(0) bytes? Currently i replace all singlequotes with 2x single quotes and that works fine. The chr(0) byte did not succeed. I'm using the dll and don't do any c to prepare me the encoding call(s). Afaik this one should be obsolete with v3.x anyway is it? BLOBS can be inserted by using the form: X'x1x2x3..xn' Where: x1..xn are two hex-digit representation of data. eg. sqlite> select X'48656c6c6f20576f726c6400'; Hello World sqlite> select quote(X'48656c6c6f20576f726c6400'); X'48656C6C6F20576F726C6400' You'll have to convert to the hex form yourself, as SQL appears to have no way to quote NUL bytes within a string. Thanks! -- /"\ \ /ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL X - AGAINST MS ATTACHMENTS / \
Re: [sqlite] Sorry, trivail question probably, chr(0) in blob.
On Wed, 27 Jul 2005, Edwin Knoppert wrote: >I reread the faq hundred times but i don't understand the \000 remark. > >For INSERT how can i embed BLOB data having single quote and chr(0) bytes? >Currently i replace all singlequotes with 2x single quotes and that works fine. >The chr(0) byte did not succeed. >I'm using the dll and don't do any c to prepare me the encoding call(s). >Afaik this one should be obsolete with v3.x anyway is it? BLOBS can be inserted by using the form: X'x1x2x3..xn' Where: x1..xn are two hex-digit representation of data. eg. sqlite> select X'48656c6c6f20576f726c6400'; Hello World sqlite> select quote(X'48656c6c6f20576f726c6400'); X'48656C6C6F20576F726C6400' You'll have to convert to the hex form yourself, as SQL appears to have no way to quote NUL bytes within a string. > >Thanks! > -- /"\ \ /ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL X - AGAINST MS ATTACHMENTS / \
Re: [sqlite] Sorry, trivail question probably, chr(0) in blob.
I will look that up, read something about binding. But *can* 'escaping' be used as alternative? - Original Message - From: "Cory Nelson" <[EMAIL PROTECTED]> To: <sqlite-users@sqlite.org> Sent: Wednesday, July 27, 2005 5:41 PM Subject: Re: [sqlite] Sorry, trivail question probably, chr(0) in blob. in sqlite 3.x you can bind data to prepared statements, no escaping is required. On 7/27/05, Edwin Knoppert <[EMAIL PROTECTED]> wrote: I reread the faq hundred times but i don't understand the \000 remark. For INSERT how can i embed BLOB data having single quote and chr(0) bytes? Currently i replace all singlequotes with 2x single quotes and that works fine. The chr(0) byte did not succeed. I'm using the dll and don't do any c to prepare me the encoding call(s). Afaik this one should be obsolete with v3.x anyway is it? Thanks! -- Cory Nelson http://www.int64.org
Re: [sqlite] Sorry, trivail question probably, chr(0) in blob.
in sqlite 3.x you can bind data to prepared statements, no escaping is required. On 7/27/05, Edwin Knoppert <[EMAIL PROTECTED]> wrote: > I reread the faq hundred times but i don't understand the \000 remark. > > For INSERT how can i embed BLOB data having single quote and chr(0) bytes? > Currently i replace all singlequotes with 2x single quotes and that works > fine. > The chr(0) byte did not succeed. > I'm using the dll and don't do any c to prepare me the encoding call(s). > Afaik this one should be obsolete with v3.x anyway is it? > > Thanks! > > -- Cory Nelson http://www.int64.org
[sqlite] Sorry, trivail question probably, chr(0) in blob.
I reread the faq hundred times but i don't understand the \000 remark. For INSERT how can i embed BLOB data having single quote and chr(0) bytes? Currently i replace all singlequotes with 2x single quotes and that works fine. The chr(0) byte did not succeed. I'm using the dll and don't do any c to prepare me the encoding call(s). Afaik this one should be obsolete with v3.x anyway is it? Thanks!