[sqlite] Figured out my autoincrement problem

2005-11-04 Thread Dan McDaniel
I originally had the "NULL" value as the first item in the each row of newitems. I moved it down to the values list as shown below and it works. thanks to all who thought about this 'problem' with me. newitems = ( (32,2,20,0,0,0), (34,2,20,0,0,0) ) for

Re: [sqlite] can' t get autoincrement to work

2005-11-04 Thread Dan McDaniel
Autoincrement works with sqlite command line but still doesn't through pysqlite from Python --- Dan McDaniel <[EMAIL PROTECTED]> wrote: > Thanks Clay > > I downloaded version 3-2-7 (Windows xp pro) for both > my home and office system. I am working through > pysqlite > and have set up all the

Re: [sqlite] can' t get autoincrement to work

2005-11-04 Thread Dan McDaniel
Thanks Clay I downloaded version 3-2-7 (Windows xp pro) for both my home and office system. I am working through pysqlite and have set up all the tables through Python with table creation statements like this: cur.execute("CREATE TABLE projects(project_id INTEGER PRIMARY KEY, \ cip_n

Re: [sqlite] Re: converting a mysql database

2005-11-04 Thread Roger Binns
I can't find any documentation that says create might fail for this reason, One likely cause is tag-along programs such as virus checkers, content indexers, backup agents etc. They like to open files immediately after an application has written to one and then closed the file. And while they h

Re: [sqlite] can' t get autoincrement to work

2005-11-04 Thread Clay Dowling
Dan McDaniel wrote: >I have not been able to get autoincrement to work. I >downloaded latest version several days ago to home and >office machine. Can not get it to work on either. >Please help. > > Show us your DDL for the table. In general the field should be an integer primary key. If you d

Re: [sqlite] can' t get autoincrement to work

2005-11-04 Thread Puneet Kishor
On Nov 4, 2005, at 9:18 PM, Dan McDaniel wrote: I have not been able to get autoincrement to work. I downloaded latest version several days ago to home and office machine. Can not get it to work on either. Please help. no one can help unless you tell -- what version you downloaded, what yo

[sqlite] can' t get autoincrement to work

2005-11-04 Thread Dan McDaniel
I have not been able to get autoincrement to work. I downloaded latest version several days ago to home and office machine. Can not get it to work on either. Please help. dan __ Yahoo! FareChase: Search multiple travel sites in one click. http://f

[sqlite] Re: converting a mysql database

2005-11-04 Thread Dave Dyer
I looked into this, and the actual problem is windows returning a "access denied" error code when trying to recreate the journal file immediately after deleting it. I can't find any documentation that says create might fail for this reason, but filemon (from systeminternals.com) says the status

Re: [sqlite] SQLIte doesn't seem to support SQL properly

2005-11-04 Thread Gerald Dachs
I don't understand how this belongs to the thread "Request for comment: Proposed SQLite API changes". Gerald On Fri, 4 Nov 2005 20:20:12 +0100 Marco Bambini <[EMAIL PROTECTED]> wrote: > If table_A has mutiple rows (say like) > > column1 column2 > 1 B > 2

Re: [sqlite] converting a mysql database

2005-11-04 Thread Ulrik Petersen
Hi Dave, Dave Dyer wrote: I'm taking a test cut at converting a existing mysql database to sqlite. I dumped the mysql database, tweaked the prototype into slite format, and converted the escape characters in the data to standard sql format. Here's what happens when I attempt an import: sqlit

[sqlite] converting a mysql database

2005-11-04 Thread Dave Dyer
I'm taking a test cut at converting a existing mysql database to sqlite. I dumped the mysql database, tweaked the prototype into slite format, and converted the escape characters in the data to standard sql format. Here's what happens when I attempt an import: sqlite> .read proto.txt sqlite> .r

Re: [sqlite] SQLIte doesn't seem to support SQL properly

2005-11-04 Thread Clay Dowling
Marco Bambini said: > If I do > update TABLE_B set column1 = ( select column1 from table_A ) > > I expexct to get an error since "select column1 from table_a" is > multivalued > But I dont. The update succeeds as though I wrote "update TABLE_B set > column1 = ( select column1 from table_A r

Re: [sqlite] Request for comment: Proposed SQLite API changes

2005-11-04 Thread Robert Simpson
- Original Message - From: "Dennis Cote" <[EMAIL PROTECTED]> To: Sent: Friday, November 04, 2005 8:48 AM Subject: Re: [sqlite] Request for comment: Proposed SQLite API changes Robert Simpson wrote: It's 100,000 more memory allocations and about 4.6mb of string copies SQLite is doing

[sqlite] SQLIte doesn't seem to support SQL properly

2005-11-04 Thread Marco Bambini
If table_A has mutiple rows (say like) column1 column2 1 B 2 H 3 R 4 Q 5 V And table_B has column1 column2 B R 3

Re: [sqlite] Request for comment: Proposed SQLite API changes

2005-11-04 Thread Derrell . Lipman
Dennis Cote <[EMAIL PROTECTED]> writes: > Furthermore, I don't believe that most users are using an authorizer anyway > (but I could definitely be wrong about that). In that case all the authorizer > callbacks become no-ops don't they? PHP's use of sqlite uses an authorizer callback in the origin

Re: [sqlite] Request for comment: Proposed SQLite API changes

2005-11-04 Thread Dennis Cote
Rob Lohman wrote: This all starts to feel a bit "unsafe". What would happen if a program would load a library that houses the callback and it gets unloaded after the first prepare? Or is it a rule you need to have the callback available for the entire run of the virtual machine? It would have

Re: [sqlite] Request for comment: Proposed SQLite API changes

2005-11-04 Thread Rob Lohman
The authorizer is used to protect against SQL injection attaches when the SQL text originates from user input. Typically an application will turn the authorizer on when preparing user-supplied SQL then turn it right back off again so that its own internal SQL can run unfiltered. Example: sql

Re: [sqlite] Request for comment: Proposed SQLite API changes

2005-11-04 Thread Austin Ziegler
On 11/4/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > The authorizer is used to protect against SQL injection attaches > when the SQL text originates from user input. Typically an > application will turn the authorizer on when preparing user-supplied > SQL then turn it right back off again so

Re: [sqlite] Request for comment: Proposed SQLite API changes

2005-11-04 Thread Dennis Cote
[EMAIL PROTECTED] wrote: The authorizer is used to protect against SQL injection attaches when the SQL text originates from user input. Typically an application will turn the authorizer on when preparing user-supplied SQL then turn it right back off again so that its own internal SQL can run un

Re: [sqlite] Request for comment: Proposed SQLite API changes

2005-11-04 Thread drh
Dennis Cote <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > >Dan Kennedy <[EMAIL PROTECTED]> wrote: > >>> > >>The authorization callback > >>would have to be reinvoked from within sqlite3_step() too. > >> > >> > > > >Yikes! I didn't think of that. > > > > > > I don't see why thi

[sqlite] Question about sqlite_free_table

2005-11-04 Thread Massimo Gaspari
Dear All, Consider the following code if ( sqlite3_get_table(sqlite3,sql,resultp,nrow,ncolumn,errmsg) == SQLITE_OK) { do... do do... sqlite3_free_table(result); return; } else { return; } The question is: Is it right to not call the sqlite3_free_table() funct

[sqlite] Re: Request for comment: Proposed SQLite API changes

2005-11-04 Thread Ulrich Telle
D. Richard Hipp wrote: > "Ulrich Telle" wrote: >> Sure, it would be nice if SQLITE_SCHEMA errors could be handled >> internally by SQLite, but I think it's a non-trivial task to handle >> this kind of error. >> >> When I created my SQLite C++ wrapper wxSQLite3 I thought about handling >> SCHEMA er

Re: [sqlite] Request for comment: Proposed SQLite API changes

2005-11-04 Thread Dennis Cote
[EMAIL PROTECTED] wrote: Dan Kennedy <[EMAIL PROTECTED]> wrote: Another proposal: Suppose that when creating an sqlite3_stmt using sqlite3_prepare, the original SQL text was stored in the sqlite3_stmt. Then when a schema change occurred, the statement was automatically recompiled and rebou

Re: [sqlite] Request for comment: Proposed SQLite API changes

2005-11-04 Thread thatsanicehatyouhave
On 3 Nov 2005, at 13:18, [EMAIL PROTECTED] wrote: Another proposal: Suppose that when creating an sqlite3_stmt using sqlite3_prepare, the original SQL text was stored in the sqlite3_stmt. I'm in favour of this change. I think any code that wraps around prepared/reusable queries will have t

Re: [sqlite] Request for comment: Proposed SQLite API changes

2005-11-04 Thread Dennis Cote
Robert Simpson wrote: It's 100,000 more memory allocations and about 4.6mb of string copies SQLite is doing behind the scenes. Every time SQLite prepares a statement it allocates and copies the string. If you're inserting a million rows into a database using the above "cheese" method (which

Re: [sqlite] Request for comment: Proposed SQLite API changes

2005-11-04 Thread John Stanton
Rob Lohman wrote: Another proposal: Suppose that when creating an sqlite3_stmt using sqlite3_prepare, the original SQL text was stored in the sqlite3_stmt. Then when a schema change occurred, the statement was automatically recompiled and rebound. There would no more SQLITE_SCHEMA errors. But

Re: [sqlite] Request for comment: Proposed SQLite API changes

2005-11-04 Thread John Stanton
Robert Simpson wrote: - Original Message - From: "Dennis Cote" <[EMAIL PROTECTED]> To: Sent: Thursday, November 03, 2005 4:14 PM Subject: Re: [sqlite] Request for comment: Proposed SQLite API changes Robert Simpson wrote: This is one gives me pause. I see lots of people doing thing

Re: [sqlite] Request for comment: Proposed SQLite API changes

2005-11-04 Thread Joe Wilson
> That would compel me to change *all* of the API to use a > "sqlite4_" prefix instead of "sqlite3_". I'm guessing that eventually backwards compatibility will be broken in such a way that there will be an sqlite4 (and perhaps an sqlite5 down the line). When that happens you might consider using

Re: [sqlite] Request for comment: Proposed SQLite API changes

2005-11-04 Thread drh
"Ulrich Telle" <[EMAIL PROTECTED]> wrote: > > Sure, it would be nice if SQLITE_SCHEMA errors could be handled internally > by SQLite, but I think it's a non-trivial task to handle this kind of error. > > When I created my SQLite C++ wrapper wxSQLite3 I thought about handling > SCHEMA errors, but

[sqlite] Re: Request for comment: Proposed SQLite API changes

2005-11-04 Thread Igor Tandetnik
Ulrich Telle <[EMAIL PROTECTED]> wrote: Sure, it would be nice if SQLITE_SCHEMA errors could be handled internally by SQLite, but I think it's a non-trivial task to handle this kind of error. For INSERT, UPDATE or DELETE a simple retry might be a good choice. But how often should the retry take

Re: [sqlite] Re: Request for comment: Proposed SQLite API changes

2005-11-04 Thread Paolo Vernazza
Ulrich Telle wrote: In case of a SELECT statement the situation is still more complex. The SCHEMA error could happen after reading several result rows. If you would then redo the query automatically it would start from scratch delivering the already read rows again. If your application code gath

[sqlite] Re: Request for comment: Proposed SQLite API changes

2005-11-04 Thread Ulrich Telle
> > Suppose this where to change in version 3.3.0 so that the > > actual error code was returned by sqlite3_step(). That would be a good thing, since it would allow appropriate reaction at the right time and the right place. > > Then when a schema change occurred, the statement was automatically