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
I have to admit my confusion with incremental i/o functions.
I am not sure that problem, which I encountered, is due to
internal bug in my program, I hit a Sqlite bug or Sqlite behaves properly. I
would greatly appreciate any comments!
First, the incremental i/o looked as a God’s sent gift
1. Complete c program for beginners is here:
http://manishtech.wordpress.com/2009/03/30/sqlite-with-c/
2. sqlite3_exec with callback is an obsolete concept from sqlite2
Use sqlite3_prepare_v2 with sqlite3_step as it is linear, more effective and
giving more control approach.
I hope it
lob_write
On Tue, Jan 19, 2010 at 07:14:11AM -0800, a1rex scratched on the wall:
> So, I coded accordingly. I thought that I could keep the same handle to the
> blob forever as long
> as I do not touch the row where my blob is located. At least that is my
> understanding of
>Look at the source for sqlite3_blob_open().
From stepping through the code I
have learned that blob read/write fails and returns SQLITE_ABORT because in
the blob handle structure
structIncrblob {
int flags; /*
Copy of "flags" passed to qlite3_blob_open() */
int nByte;
I am planning to store text in a database which has to accommodate a few
international languages.
In this case I have to use UTF-16LE encoding for my TEXT fields.
I know that once an encoding has been set for a database, it cannot be changed.
Do BLOBS are effected?
I guess I cannot mix
[sqlite] UTF-8 and UTF-16
a1rex wrote:
> I am planning to store text in a database which has to accommodate a few
> international languages.
> In this case I have to use UTF-16LE encoding for my TEXT fields.
Perhaps there are some external reasons, but there's nothing in SQLite that
w
I just encountered very curious case in Sqlite.
I have very simple data base with only one table and one index:
"CREATE TABLE IF NOT EXISTS notes(id INTEGER PRIMARY KEY, note TEXT)";
My updates to the simple text database were very slow. Extremely slow!
I changed my code and achieved 1000
>From: Jens Miltner
>Sent: Wed, February 3, 2010 9:46:06 AM
>Just another thought to consider: depending on the amount of non-ASCII
>(or non-roman) string data stored in your database, in may be more
>efficient to use UTF-8 encoding rather than UTF-16 encoding:
>UTF-8 takes up
>- Original Message
>From: Pavel Ivanov
>To: General Discussion of SQLite Database
>Sent: Wed, February 3, 2010 11:37:17 AM
>Just first thought came to my mind: are you sure that 2 versions of
>code mentioned do the same thing? In particular
Thank you kindly for all your suggestions!
>If you want SQLite to support all ACID properties you cannot change
>anything to speed up updates.
Making sure that I do not loose a character was my primary objective.
> If you are doing bulk updates, and are in a position to re-run the
> data
I use UPDATE for text columns in the table and any changes are committed to the
hard drive right away (well,
after about 120 ms).
This can be verified by using external tool. I use SQLite Manager to 'see' the
changes.
I use also
Pavel,
Thank you very much for your email. I greatly appreciate
your knowledge on the internal workings of Sqlite and your kindness to share
it.
>All incremental writing is committed (and thus is written to disk)
>when blob handle is closed. And even when you close the handle
>transaction is
Thank you very much for your advice!
>to check that transaction
>wasn't committed yet you can connect to the database with external
>command while application is working and try to update or insert
>something. If it fails with message "The database file is locked" then
>application didn't
Pavel,
Thank you so much for your help. Your knowledge is worth
more than gold.
You were absolutely right regarding not closed blob handle!
(for prepare I use only sqlite3_prepare_v2)
I found out that I had one blob handle opened in the unrelated table in the
same database.
This handle was
Process A updates data base table in the tight loop. Nothing special:
loop
sql = "UPDATE table SET blob=:blob WHERE id=?";
rc = sqlite3_prepare_v2(…)
rc = sqlite3_bind_int(…)
sqlite3_bind_blob(…)
rc = sqlite3_step(…)
rc = sqlite3_reset(…)
rc = sqlite3_finalize(…);
Process B just reads
locked” error in both processes
a1rex wrote:
> I thought that I can have 1 writer and many readers
You thought incorrectly. You can have one writer OR many readers.
Igor Tandetnik
___
sqlite-users mailing list
sqlite-users@sqlite
cesses
a1rex wrote:
> I thought that I can have 1 writer and many readers
You thought incorrectly. You can have one writer OR many readers.
Igor Tandetnik
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bi
Sent: Sun, February 14, 2010 2:54:35 PM
Subject: Re: [sqlite] 1 reader 1 writer but sqlite3_step fails with “database
is locked” error in both processes
a1rex wrote:
> I thought that I can have 1 writer and many readers
You thought incorrectly. You can have one writer OR many re
For some reasons it is more convenient for the project to
have a few smaller databases with unrelated data than one containing
everything. My only concern is RAM memory.
How much burden/memory overhead an additional database would introduce?
Thank you for your input,
Samuel
Thank you very much for your help!
Since my typical record is less than 100 bytes I guess that I can use Page Size
= 512 bytes
without degradation of database performance.This would conserve memory.
How vital is default number of pages for database performance?
Can I drastically drop the
Thank you for putting me on the right track! Now I know how to attack the
issue.
Also this pragmas may help me:
PRAGMA default_cache_size = Number-of-pages;
PRAGMA cache_size = Number-of-pages;
PRAGMA page_size = bytes;
PRAGMA max_page_count = N;
Regards,
Samuel
- Original Message
- Original Message
From: Simon dbern...@noos.fr
>However, it seems that some process (that can take
>several tens of seconds) in the first >sqlite3_step does not test for
>interrupt (resulting in simultaneous uninterrupted
>concurrent threads...)
According to
Simon,
I am very surprise that your SQLite operation can take so
long. Is it a very complicated search? Multiple writes?
>I have a text field that launches a full text search query at every key press.
Can you rearrange your algorithm? How many records do you
search? Do you have to search on
You cannot push_back(NULL) null pointer.
Fix is below:
if(result == SQLITE_ROW)
{
vector values;
for(int col = 0; col < cols; col++)
{
>I try to ADD a column by run the querry "ALTER TABLE x
>ADD y NUMERIC" from my application, I can't use the data base any more.
Try this: "ALTER TABLE main.x ADD y NUMERIC" and verify by external tool that
column x has been added.
- Original Message
>From: VasiliyF4
>After I try to ADD a column by run the querry "ALTER TABLE x
>ADD y NUMERIC" from my application, I can't use the data base any more. If I
>try to get or save any data at my DB it cause crash of the application.
Of course your
Well, sorry to hear that.
I tested the function:
vector CSGDb::query(char* query, sqlite3 *database)
{
sqlite3_stmt *statement;
vector results;
if(sqlite3_prepare_v2(database, query, -1, , 0) == SQLITE_OK)
{
int cols =
Chimerian,
I compiled and tested the tutorial example (which you
pointed out) with VC++ on XP Pro. Example is fine, except with the problem of
not checking for NULL pointer, which I fixed for you.
DB is created and values are stored and retrieved. No problem with SQLite or
STL.
I do not
>> 2010/3/6 Chimerian :
>> values.push_back((char*)sqlite3_column_text(statement,
col));
>> // HERE IS ERROR !
>From: Simon Davies
>What error?
>I can not see why THIS line should provoke any error;
This line will
produce a runtime error when sqlite3_column_text(statement,
- Original Message
>From: Simon Davies
>The return from sqlite3_column_text is not valid after subsequent calls to any
>of
>sqlite3_step/sqlite3_reset/sqlite3_finalize.
Yes.
What about void *p = sqlite3_column_blob()?
>From my tests it looks
Thank you very much for your clarification! This is what I suspected.
Regards,
Samuel
- Original Message
From: Igor Tandetnik <itandet...@mvps.org>
a1rex wrote:
> What about void *p = sqlite3_column_blob()?
> From my tests it looks that pointer p survives sqli
>- Original Message
>From: P Kishor
>To the veterans on the list, it is very clear that no one had a "how
>stupid are you" attitude
I totally agree, and I am new here.
I prefer to get any answer - since I will learn from it - than no answer at
all.
>Even if a
>Do The words mean that while one process is writing the database other
>processes could not read the database at the same time?
In short:: YES
__
Be smarter than spam. See how smart SpamGuard is at giving junk email the
>Do The words mean that while one process is writing the database other
>processes could not read the database at the same time?
The reader fails since it cannot obtain SHARED lock required for
reading.
It cannot obtain that lock since the writer already
managed to obtain PENDING or EXCLUSIVE
* :VVV
* @VVV
* $VVV
Are above bindings the same? (Just different prefix to VVV)?
Thank you,
Samuel
From: Pavel Ivanov
To: General Discussion of SQLite Database
Sent: Wed, March 24, 2010 2:16:34 PM
Since we are at this topic let me ask the question: Are the table names case
insensitive?
From: Andy Gibbs
To: sqlite-users@sqlite.org
Sent: Fri, May 7, 2010 8:00:44 AM
Subject: Re: [sqlite] Behaviour of tables with same name
> I
I hope that you know that
sprintf(sql, "SELECT count(*) FROM table1;");
is not a going to give you count(*) FROM table1.
Where is your real query?
From: Prajeed chathuar
To: sqlite-users@sqlite.org
Sent: Thu, May 13, 2010
38 matches
Mail list logo