Re: [sqlite] near "?": syntax error

2010-04-28 Thread Manoj M
Thanks for all help.
Yes, its an application issue. We fixed it.

Regards,
Manoj Marathayil



On Wed, Apr 28, 2010 at 5:16 PM, Richard Hipp  wrote:
> On Wed, Apr 28, 2010 at 7:30 AM, Alexey Pechnikov 
> wrote:
>
>> 2010/4/28 Manoj M :
>> > I am getting error message "near "?": syntax error" randomly while
>> > executing the query "SELECT [record] FROM [ac_contacts_cache] LIMIT 0,
>> > 3".
>>
>> The SQL "LIMIT 0, 3" is incorrect. Use "LIMIT 3 OFFSET 0" instead.
>>
>
> SQLite accepts both variations on the LIMIT syntax.  They do exactly the
> same thing.
>
> Manoj has an application problem of some kind.  He is sending something to
> sqlite3_prepare() that is different from what he things he is sending.  Or,
> perhaps he has multiple threads running with SQLite mutexes disabled.  Or
> prehaps he is send a string into sqlite3_prepare() and then freeing and/or
> overwriting that string before sqlite3_prepare() returns.  In any event, it
> is not SQLite that is causing Manoj's problem, and without additional
> information, we can't really determine the source of the problem.
>
>
>
>>
>> --
>> Best regards, Alexey Pechnikov.
>> http://pechnikov.tel/
>> ___
>> sqlite-users mailing list
>> sqlite-users@sqlite.org
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>>
>
>
>
> --
> -
> D. Richard Hipp
> d...@sqlite.org
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] near "?": syntax error

2010-04-28 Thread Manoj M
I am getting error message "near "?": syntax error" randomly while
executing the query "SELECT [record] FROM [ac_contacts_cache] LIMIT 0,
3".

Table schema:

CREATE TABLE IF NOT EXISTS
[ac_contacts_cache] (
[record] TEXT NOT NULL
)

Any help here is appreciated.

Regards,
Manoj Marathayil
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] SQLite fts3: search for a string in a column

2010-04-13 Thread Manoj M
Is there any way to search for a particular string in a column?

I want to search like SELECT * from email_fts WHERE email_fts MATCH
'to:"a...@b.com" OR from:"c...@d.com"'

sqlite> .schema email_fts

CREATE VIRTUAL TABLE [email_fts] USING fts3 ( [from], [subject],
[body], [to], [cc], [filename]


Regards,
Manoj Marathayil
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Recovery program

2008-11-14 Thread Manoj M
Hi,

I am working with a project that requires a SQLite recovery module.

I have a corrupted database(see the link below) where if I am issuing
a query like "select * from objects where dbname='information_schema'"
leads to application crash(even sqlite commandline program). As I was
looking for possible ways, I saw sqlite command-line program is able
to dump my sample corrupted database and then able to create a new
database from this(using .read filename).

Is this(.dump) is the standard for recovering a corrupted database?
what is special with .dump commad? can we also follow the same method
for crash recovery? Is there any other better method to do it(using
some exception handling)?

sample corrupted db attached
https://rcpt.yousendit.com/624254893/4d5c40a04a2eb6cdf2468bd999485ef2

Thanks in advance!

Regards,
Manoj Marathayil
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] END TRANSACTION failed with "database is locked"

2008-10-09 Thread Manoj M
Hi, Thanks for your replies.

Actually I have only one thread writing to the table and there can be 'n'
number of threads reading the table. I am not yet found why this "database
locked" error came in my application.

Since the database is locked even "End TRANSACTION" also won't help, right?

I will comeback with more details 2row as today is holiday here.

Regards,
Manoj Marathayil


On Wed, Oct 8, 2008 at 9:30 PM, <[EMAIL PROTECTED]> wrote:

> Send sqlite-users mailing list submissions to
>sqlite-users@sqlite.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> or, via email, send a message with subject or body 'help' to
>[EMAIL PROTECTED]
>
> You can reach the person managing the list at
>[EMAIL PROTECTED]
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of sqlite-users digest..."
>
>
> Today's Topics:
>
>   1. END TRANSACTION failed with "database is locked"
>  (Manoj Marathayil)
>   2. Re: END TRANSACTION failed with "database is locked"
>  (Alexandre Courbot)
>   3. Re: END TRANSACTION failed with "database is locked" (Ken)
>   4. Re: Record locking (Ken)
>
>
> --
>
> Message: 1
> Date: Wed, 8 Oct 2008 19:20:02 +0530
> From: "Manoj Marathayil" <[EMAIL PROTECTED]>
> Subject: [sqlite] END TRANSACTION failed with "database is locked"
> To: sqlite-users@sqlite.org
> Message-ID:
><[EMAIL PROTECTED]>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Hi,
> I am executing some operations in a loop and all the operations are wrapped
> inside a transaction. During one iteration the "END TRANSACTION" returned
> with an error "database is locked". Since this is in a loop my next request
> to "BEGIN TRASACTION" failed with "cannot start a transaction within a
> transaction". What is the normal way to get rid of this situation? Is it
> right to check the status with "sqlite3_get_autocommit" and issue a
> "ROLLBACK TRASACTION" if it inside a transaction before issuing BEGIN?
>
> Regards,
> Manoj
>
>
> --
>
> Message: 2
> Date: Wed, 8 Oct 2008 22:58:59 +0900
> From: "Alexandre Courbot" <[EMAIL PROTECTED]>
> Subject: Re: [sqlite] END TRANSACTION failed with "database is locked"
> To: "General Discussion of SQLite Database" 
> Message-ID:
><[EMAIL PROTECTED]>
> Content-Type: text/plain; charset=ISO-8859-1
>
> > I am executing some operations in a loop and all the operations are
> wrapped
> > inside a transaction. During one iteration the "END TRANSACTION" returned
> > with an error "database is locked". Since this is in a loop my next
> request
> > to "BEGIN TRASACTION" failed with "cannot start a transaction within a
> > transaction". What is the normal way to get rid of this situation? Is it
> > right to check the status with "sqlite3_get_autocommit" and issue a
> > "ROLLBACK TRASACTION" if it inside a transaction before issuing BEGIN?
>
> This is probably because you still have one active query when during
> the commit. Try to sqlite3_finalize all your queries before the
> commit.
>
> Alex.
>
>
> --
>
> Message: 3
> Date: Wed, 8 Oct 2008 08:46:39 -0700 (PDT)
> From: Ken <[EMAIL PROTECTED]>
> Subject: Re: [sqlite] END TRANSACTION failed with "database is locked"
> To: General Discussion of SQLite Database 
> Message-ID: <[EMAIL PROTECTED]>
> Content-Type: text/plain; charset=iso-8859-1
>
> The second error problem is due to the first.
> ?Another process has begun a transaction Prior to you running the commit.
> /End transaction. At this point you have no choice but to rollback and re
> run the loop.
>
> A Proper fix might include changing the begin transaction to a "begin
> immediate",? Then Either The begin will either fail and not be able to start
> a TXN. Or it will succeed.. If it fails simply wait a while and retry.
>
> I would not follow the other posters advice regarding finalize. You want to
> use sqlite3_reset on all of the prepared statements. Before you close the
> database you should finalize or if your unlikely to need the statement in a
> while then finalize.
>
> HTH
> Ken
>
>
> --- On Wed, 10/8/08, Manoj Marathayil <[EMAIL PROTECTED]> wrote:
> From: Manoj Marathayil <[EMAIL PROTECTED]>
> Subject: [sqlite] END TRANSACTION failed with "database is locked"
> To: sqlite-users@sqlite.org
> Date: Wednesday, October 8, 2008, 8:50 AM
>
> Hi,
> I am executing some operations in a loop and all the operations are wrapped
> inside a transaction. During one iteration the "END TRANSACTION"
> returned
> with an error "database is locked". Since this is in a loop my next
> request
> to "BEGIN TRASACTION" failed with "cannot start a transaction
> within a
> transaction". What is the normal way to get rid of this situation? Is it
> right to check the status with "sqlite3_get_autocommit" and issue a
> "ROLLBACK TRASACTION"

Re: [sqlite] END TRANSACTION failed with "database is locked"

2008-10-08 Thread Manoj M
Hi, Thanks for your replies.

Actually I have only one thread writing to the table and there can be 'n'
number of threads reading the table. I am not yet found why this "database
locked" error came in my application.

Since the database is locked even "End TRANSACTION" also won't help, right?

I will comeback with more details 2row as today is holiday here.

Regards,
Manoj Marathayil


On Wed, Oct 8, 2008 at 9:30 PM, <[EMAIL PROTECTED]> wrote:

> Send sqlite-users mailing list submissions to
>sqlite-users@sqlite.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> or, via email, send a message with subject or body 'help' to
>[EMAIL PROTECTED]
>
> You can reach the person managing the list at
>[EMAIL PROTECTED]
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of sqlite-users digest..."
>
>
> Today's Topics:
>
>   1. END TRANSACTION failed with "database is locked"
>  (Manoj Marathayil)
>   2. Re: END TRANSACTION failed with "database is locked"
>  (Alexandre Courbot)
>   3. Re: END TRANSACTION failed with "database is locked" (Ken)
>   4. Re: Record locking (Ken)
>
>
> --
>
> Message: 1
> Date: Wed, 8 Oct 2008 19:20:02 +0530
> From: "Manoj Marathayil" <[EMAIL PROTECTED]>
> Subject: [sqlite] END TRANSACTION failed with "database is locked"
> To: sqlite-users@sqlite.org
> Message-ID:
><[EMAIL PROTECTED]>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Hi,
> I am executing some operations in a loop and all the operations are wrapped
> inside a transaction. During one iteration the "END TRANSACTION" returned
> with an error "database is locked". Since this is in a loop my next request
> to "BEGIN TRASACTION" failed with "cannot start a transaction within a
> transaction". What is the normal way to get rid of this situation? Is it
> right to check the status with "sqlite3_get_autocommit" and issue a
> "ROLLBACK TRASACTION" if it inside a transaction before issuing BEGIN?
>
> Regards,
> Manoj
>
>
> --
>
> Message: 2
> Date: Wed, 8 Oct 2008 22:58:59 +0900
> From: "Alexandre Courbot" <[EMAIL PROTECTED]>
> Subject: Re: [sqlite] END TRANSACTION failed with "database is locked"
> To: "General Discussion of SQLite Database" 
> Message-ID:
><[EMAIL PROTECTED]>
> Content-Type: text/plain; charset=ISO-8859-1
>
> > I am executing some operations in a loop and all the operations are
> wrapped
> > inside a transaction. During one iteration the "END TRANSACTION" returned
> > with an error "database is locked". Since this is in a loop my next
> request
> > to "BEGIN TRASACTION" failed with "cannot start a transaction within a
> > transaction". What is the normal way to get rid of this situation? Is it
> > right to check the status with "sqlite3_get_autocommit" and issue a
> > "ROLLBACK TRASACTION" if it inside a transaction before issuing BEGIN?
>
> This is probably because you still have one active query when during
> the commit. Try to sqlite3_finalize all your queries before the
> commit.
>
> Alex.
>
>
> --
>
> Message: 3
> Date: Wed, 8 Oct 2008 08:46:39 -0700 (PDT)
> From: Ken <[EMAIL PROTECTED]>
> Subject: Re: [sqlite] END TRANSACTION failed with "database is locked"
> To: General Discussion of SQLite Database 
> Message-ID: <[EMAIL PROTECTED]>
> Content-Type: text/plain; charset=iso-8859-1
>
> The second error problem is due to the first.
> ?Another process has begun a transaction Prior to you running the commit.
> /End transaction. At this point you have no choice but to rollback and re
> run the loop.
>
> A Proper fix might include changing the begin transaction to a "begin
> immediate",? Then Either The begin will either fail and not be able to start
> a TXN. Or it will succeed.. If it fails simply wait a while and retry.
>
> I would not follow the other posters advice regarding finalize. You want to
> use sqlite3_reset on all of the prepared statements. Before you close the
> database you should finalize or if your unlikely to need the statement in a
> while then finalize.
>
> HTH
> Ken
>
>
> --- On Wed, 10/8/08, Manoj Marathayil <[EMAIL PROTECTED]> wrote:
> From: Manoj Marathayil <[EMAIL PROTECTED]>
> Subject: [sqlite] END TRANSACTION failed with "database is locked"
> To: sqlite-users@sqlite.org
> Date: Wednesday, October 8, 2008, 8:50 AM
>
> Hi,
> I am executing some operations in a loop and all the operations are wrapped
> inside a transaction. During one iteration the "END TRANSACTION"
> returned
> with an error "database is locked". Since this is in a loop my next
> request
> to "BEGIN TRASACTION" failed with "cannot start a transaction
> within a
> transaction". What is the normal way to get rid of this situation? Is it
> right to check the status with "sqlite3_get_autocommit" and issue a
> "ROLLBACK TRASACTION"