Re: [sqlite] sqlite3_prepare memory leak

2008-11-16 Thread Sherief N. Farouk
> Hi, > > Sherief, thank you for our kind help. You're welcome :). > I really did use globals. > I found a way to run DumpMemorLeaks after all globals and static > variables are deallocated, I used > _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); I should've RTFMed harder :(. >

Re: [sqlite] Recovery program

2008-11-16 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 raf wrote: > i also needed the ability to restore an sqlite3 database > after a corruption. What exactly are you doing that corrupts the database in the first place? If the machine you are using is randomly corrupting data then having your own journa

Re: [sqlite] INTEGER PRIMARY KEY and Triggers

2008-11-16 Thread Craig Smith
On Nov 17, 2008, at 12:45 AM, [EMAIL PROTECTED] wrote: >> I am addicted to using INTEGER PRIMARY KEY AUTOINCREMENT as the id >> fields in my SQLite projects, yet I would like to try some triggers >> as >> well. Of course, every time I add a trigger that accesses a table >> with these types of

Re: [sqlite] Escaped values throws error

2008-11-16 Thread Dan
On Nov 17, 2008, at 1:25 AM, P Kishor wrote: > On 11/16/08, Ben Marchbanks <[EMAIL PROTECTED]> wrote: >> Abridged sample of the insert statement that produces an error when >> trying to insert escaped text. >> >> >> INSERT INTO pageWords (word) VALUES (" \"nitch\" "); > > SQL text strings are

Re: [sqlite] INTEGER PRIMARY KEY and triggers

2008-11-16 Thread Dan
On Nov 16, 2008, at 2:46 AM, Craig Smith wrote: > I am addicted to using INTEGER PRIMARY KEY AUTOINCREMENT as the id > fields in my SQLite projects, yet I would like to try some triggers as > well. Of course, every time I add a trigger that accesses a table > with these types of id fields, all

Re: [sqlite] sqlite3_bind_text problem

2008-11-16 Thread Matthew Allen
-- Original Message -- To: (sqlite-users@sqlite.org) From: Igor Tandetnik ([EMAIL PROTECTED]) Subject: Re: [sqlite] sqlite3_bind_text problem Date: 17/11/2008 11:58:18a > Despite what the indentation might suggest, the "else" clause at (3) > corresponds to the "if" statement at (

Re: [sqlite] Recovery program

2008-11-16 Thread raf
Manoj M wrote: > 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 pro

Re: [sqlite] sqlite3_bind_text problem

2008-11-16 Thread Igor Tandetnik
"Matthew Allen" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > http://www.memecode.com/temp/Sqlite_Test.zip [921kb] #define SERIALIZE_STR(Var, Col) \ if (Write) \ { \ (1) if (Var) \ (2) if (!Check(sqlite3_bind_text(Stmt, Col+1, (const char*)Var, -1, SQLITE_STATIC))) \ retu

Re: [sqlite] Escaped values throws error

2008-11-16 Thread Igor Tandetnik
"Ben Marchbanks" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Now I remember why I wasn't using single quotes in SQLite statements - > > because escaped single quoted values like > > 'Billy\'s bike' > > cause it to fail. You probably want 'Billy''s bike'. Backslashes don't have an

Re: [sqlite] sqlite3_bind_text problem

2008-11-16 Thread Matthew Allen
-- Original Message -- To: (sqlite-users@sqlite.org) From: Igor Tandetnik ([EMAIL PROTECTED]) Subject: Re: [sqlite] sqlite3_bind_text problem Date: 14/11/2008 11:47:54p > > And it return SQLITE_OK, however the value in the DB is NULL, or an > > empty string. > > I don't see any o

Re: [sqlite] Sqlite3Explorer Sqlite Report Designer

2008-11-16 Thread Cariotoglou Mike
here is an idea : I might be able to modify the dll to accept datasets in a different, "standard" format, like XML. this would imply that your product would need to retrieve data in whatever format it needs, transform it to my format, pass it to the dll which will do the design and reporting. it

Re: [sqlite] Escaped values throws error

2008-11-16 Thread Eric Minbiole
> This is my first foree into PDO-SQLite and I saw samples using binding, > I am using prepare() though without binding. > > So you think that had I used binding my escape issue would not be an issue ? Correct. Though I've not used PDO-SQLite (I use the C interface), I would think that using bo

Re: [sqlite] Escaped values throws error

2008-11-16 Thread Ben Marchbanks
This is my first foree into PDO-SQLite and I saw samples using binding, I am using prepare() though without binding. So you think that had I used binding my escape issue would not be an issue ? *Ben Marchbanks* www.magazooms.com Signature Email: [EMAIL PROTECTED]

Re: [sqlite] Escaped values throws error

2008-11-16 Thread Eric Minbiole
> Now I remember why I wasn't using single quotes in SQLite statements - > > because escaped single quoted values like > > 'Billy\'s bike' > > cause it to fail. Again I think its related to PHP-PDO SQLite > implementation. Have you considered using prepared statements and bound parameters?

Re: [sqlite] Escaped values throws error

2008-11-16 Thread Ben Marchbanks
Now I remember why I wasn't using single quotes in SQLite statements - because escaped single quoted values like 'Billy\'s bike' cause it to fail. Again I think its related to PHP-PDO SQLite implementation. *Ben Marchbanks* www.magazooms.com Signature Email: [

Re: [sqlite] Escaped values throws error

2008-11-16 Thread Ben Marchbanks
Hmmm - thanks for straightening me out guys - somehow I thought that SQLite used double quotes *Ben Marchbanks* www.magazooms.com Signature Email: [EMAIL PROTECTED] Phone: (864) 284.9918 John Stanton wrote: > An SQL literal uses single

Re: [sqlite] Escaped values throws error

2008-11-16 Thread Ben Marchbanks
Thanks - I did find a solution since I was not successful using sqlite_escape_string. I think that the SQLite implementation in PHP via PDO is the culprit. I wound up using double escape - str_replace("\"","\"\"",$value); *Ben Marchbanks* www.magazooms.com Signatur

Re: [sqlite] Escaped values throws error

2008-11-16 Thread John Stanton
An SQL literal uses single quotes. Ben Marchbanks wrote: > Abridged sample of the insert statement that produces an error when > trying to insert escaped text. > > > INSERT INTO pageWords (word) VALUES (" \"nitch\" "); > > SQLSTATE[HY000]: General error: 1 near "nitch": syntax error' > >

[sqlite] Trigger commands don't update "new" record?

2008-11-16 Thread Chris Eich
I have an events table where SET events for a given device_id and event_code are followed by CLR events. CREATE TABLE device_event ( event_id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, device_id INTEGER NOT NULL REFERENCES device, event_date INTEGER NOT NULL, event_code INTEGER NO

Re: [sqlite] Escaped values throws error

2008-11-16 Thread Jay A. Kreibich
On Sun, Nov 16, 2008 at 01:19:27PM -0500, Ben Marchbanks scratched on the wall: > Abridged sample of the insert statement that produces an error when > trying to insert escaped text. > > > INSERT INTO pageWords (word) VALUES (" \"nitch\" "); It is throwing an error because this is not vali

Re: [sqlite] Escaped values throws error

2008-11-16 Thread P Kishor
On 11/16/08, Ben Marchbanks <[EMAIL PROTECTED]> wrote: > Abridged sample of the insert statement that produces an error when > trying to insert escaped text. > > > INSERT INTO pageWords (word) VALUES (" \"nitch\" "); SQL text strings are delimited by single quotes. If your really want to ins

[sqlite] Escaped values throws error

2008-11-16 Thread Ben Marchbanks
Abridged sample of the insert statement that produces an error when trying to insert escaped text. INSERT INTO pageWords (word) VALUES (" \"nitch\" "); SQLSTATE[HY000]: General error: 1 near "nitch": syntax error' Using PHP Version 5.2.4 PDO SQLite - version 1.0.1 $Id: pdo_sqlite.c,

[sqlite] Database Locked

2008-11-16 Thread Ben Marchbanks
I am writing a php script to back up mysql to sqlite(3) via PDO My process is : -- Create SQLite database connection Loop several tables Describe mysql table Drop sqlite table if exists, Create matching sqlite table query mysql table for recordset. insert r

Re: [sqlite] Sqlite3Explorer Sqlite Report Designer

2008-11-16 Thread Merv
You can download the program here http://www.realpointscorp.com/MGFAQUERY1.rar I use this program myself in my applications. I have some ideas of how to increase it's functions but I do not want to waste my time if no-one else is interested as I use my application software to provide the extra f

Re: [sqlite] [UnicodeEncodeError] Don't know what else to try

2008-11-16 Thread Gilles Ganault
On Fri, 14 Nov 2008 10:59:23 +0100, Michael Schlenker <[EMAIL PROTECTED]> wrote: >A tool like chardet helps: >http://chardet.feedparser.org/ Thanks for the link. Turns out some data were Unicode, while others were 1252. ___ sqlite-users mailing list sql

Re: [sqlite] Comparing a field between two databases?

2008-11-16 Thread Alexandre Courbot
Hi, attach is probably what you want: http://www.sqlite.org/lang_attach.html Alex. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

[sqlite] Comparing a field between two databases?

2008-11-16 Thread Gilles Ganault
Hello I have two SQLite files, each with the exact same structure. I need to check the value in a field in both tables, and check if it's identical. Is there a way to use sqlite3.exe to open two databases, and perform a SELECT to compare the value of a field in the databases? Thank you. ___