[sqlite] How to make correct transaction use only SQL?

2008-01-29 Thread Alexander Batyrshin
For example i have this tabe: CREATE TABLE t1 ( id int unique ON CONFLICT ROLLBACK, val char ); And I have to execute this sql file: BEGIN TRANSACTION; INSERT INTO t1 (id, val) VALUES(1, 'val1'); INSERT INTO t1 (id, val) VALUES(2, 'val2'); INSERT INTO t1 (id, val) VALUES(3, 'val3'); INSERT

Re: [sqlite] Default ON CONFLICT clause

2008-01-29 Thread Alexander Batyrshin
Yep. It is last line in this document. Somehow i missed it :) On Jan 30, 2008 3:03 AM, P Kishor <[EMAIL PROTECTED]> wrote: > On 1/29/08, Alexander Batyrshin <[EMAIL PROTECTED]> wrote: > > Hello all, > > What is default ON CONFLICT clause? > > "The algorithm specified in the OR clause of a INSERT

[sqlite] Re: Default ON CONFLICT clause

2008-01-29 Thread Igor Tandetnik
Alexander Batyrshin <[EMAIL PROTECTED]> wrote: What is default ON CONFLICT clause? ABORT Igor Tandetnik - To unsubscribe, send email to [EMAIL PROTECTED]

Re: [sqlite] Default ON CONFLICT clause

2008-01-29 Thread P Kishor
On 1/29/08, Alexander Batyrshin <[EMAIL PROTECTED]> wrote: > Hello all, > What is default ON CONFLICT clause? "The algorithm specified in the OR clause of a INSERT or UPDATE overrides any algorithm specified in a CREATE TABLE. If no algorithm is specified anywhere, the ABORT algorithm is used."

[sqlite] Default ON CONFLICT clause

2008-01-29 Thread Alexander Batyrshin
Hello all, What is default ON CONFLICT clause? -- Alexander Batyrshin aka bash bash = Biomechanica Artificial Sabotage Humanoid - To unsubscribe, send email to [EMAIL PROTECTED]

[sqlite] Re: Callback issue - using pointer as argument

2008-01-29 Thread Igor Tandetnik
David Hautbois <[EMAIL PROTECTED]> wrote: char * get_config_value (sqlite3 * db, char * config_name) { TabResult res; rc= sqlite3_exec( db, query, exec_get_config_value_cb , , ); Strings passed to the callback are valid only within the callback. As soon as the callback returns, the

[sqlite] Callback issue - using pointer as argument

2008-01-29 Thread David Hautbois
Hi I spent 6 hours on this issue and I don't understand why I get a wrong value. My database content : sqlite> select * from config; 1|version|1 2|ftpserver|A 3|ftp_remotedir| 4|ftp_login| 5|ftp_password| A simple query : sqlite> SELECT config_value FROM config WHERE config_name="version"; 1

RE: [sqlite] How Does NOT NULL produce NULLs?

2008-01-29 Thread Lee Crain
No, I'm not performing Outer Joins. This problem occurs on an INSERT statement. A QString object's pointer to memory is ZERO unless an assignment is made. Performing: -> QString object = ""; solves the problem. Lee -Original Message- From: [EMAIL PROTECTED]

Re: [sqlite] How Does NOT NULL produce NULLs?

2008-01-29 Thread drh
"Lee Crain" <[EMAIL PROTECTED]> wrote: > I did expect SQLite to enforce the NOT NULL portion of the SQL > creation statements, no matter what. SQLite *does* enforce NOT NULL no matter what. I think your pointers are getting turned into NULLs someplace else, perhaps somewhere in the QT layer. A

RE: [sqlite] How Does NOT NULL produce NULLs?

2008-01-29 Thread Lee Crain
A "bug" in "my" code is possible. We are using the QT suite and QString objects do not distinguish between an uninitialized QString object (pointer == zero) and an empty string ("") which I think is a flawed lack of distinction. In Lee Crain's Rules Of Software Development Practices, NULL means

Re: [sqlite] How Does NOT NULL produce NULLs?

2008-01-29 Thread Cory Nelson
On Jan 29, 2008 11:01 AM, <[EMAIL PROTECTED]> wrote: > "Lee Crain" <[EMAIL PROTECTED]> wrote: > > I've created a table with several fields, 3 of which are created using > > these SQL statements: > > > > [description] [varchar](255) NOT NULL DEFAULT ('') COLLATE NOCASE, > > > > [keywords]

RE: [sqlite] How Does NOT NULL produce NULLs?

2008-01-29 Thread Lee Crain
Scott, I'm not ignoring your post. I'm going to respond to DRH's post. Thanks, Lee _ -Original Message- From: Scott Hess [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 29, 2008 11:54 AM To: sqlite-users@sqlite.org Subject: Re: [sqlite] How Does NOT NULL

Re: [sqlite] How Does NOT NULL produce NULLs?

2008-01-29 Thread drh
"Lee Crain" <[EMAIL PROTECTED]> wrote: > I've created a table with several fields, 3 of which are created using > these SQL statements: > > [description] [varchar](255) NOT NULL DEFAULT ('') COLLATE NOCASE, > > [keywords][varchar](255) NOT NULL DEFAULT ('') COLLATE NOCASE, > >

Re: [sqlite] How Does NOT NULL produce NULLs?

2008-01-29 Thread Scott Hess
That seems unlikely, since NULL wouldn't come out as the string (null) in any case. Most likely some higher layer is putting the literal '(null)' in for you when you insert. Please post a set of literal input to sqlite3 which demonstrates the problem. .nullvalue '[null]' create table x (

[sqlite] How Does NOT NULL produce NULLs?

2008-01-29 Thread Lee Crain
I've created a table with several fields, 3 of which are created using these SQL statements: [description] [varchar](255) NOT NULL DEFAULT ('') COLLATE NOCASE, [keywords][varchar](255) NOT NULL DEFAULT ('') COLLATE NOCASE, [metadata][varchar](255) NOT NULL DEFAULT ('')

Re: [sqlite] CREATE VIEW or CREATE TEMP TABLE

2008-01-29 Thread Alexander Batyrshin
Offtop: You are trying to make something like statistic for game? -- Alexander Batyrshin aka bash bash = Biomechanica Artificial Sabotage Humanoid - To unsubscribe, send email to [EMAIL PROTECTED]

Re: [sqlite] How to specify regular expression in a query? ( Indexes usage issue)

2008-01-29 Thread Dennis Cote
Bharath Booshan L wrote: There is also a discussion of the REGEXP Function on that page and why your app threw an error when you tried to invoke a REGEXP filter in your query. I have tested that in sqlite3 command-line tool(v3.4.0), but no yield. REGEXP syntax is supported by SQLite, but

[sqlite] database disk image is malformed

2008-01-29 Thread Salles, Joaquim Campos
Hello, Which condition can cause the error: database disk image is malformed. Thanks for the help, Joaquim

[sqlite] CREATE VIEW or CREATE TEMP TABLE

2008-01-29 Thread P Kishor
So, I have a series of SQL selects to do, making for a pretty complicated process. The end result is to be inserted into a new table. I can create a VIEW of each step, SELECTing each subsequent result from the preceding VIEW. Or, I can CREATE TEMP TABLE for each step. Any pros and cons of one or

Re: [sqlite] How to specify regular expression in a query? ( Indexes usage issue)

2008-01-29 Thread Bharath Booshan L
Thanks kjh for your valuable inputs, > If you use US ASCII, there is a collation (COLLATE NOCASE) > that could handle this for you. I am using Unicode characters. > There is also a discussion of the REGEXP Function on that page and why your > app threw an error when you tried to invoke a

Re: [sqlite] How to specify regular expression in a query?

2008-01-29 Thread Konrad J Hambrick
On 01/29/2008 11:16 PM, Bharath Booshan L wrote: How can I instruct GLOB function to perform case-insensitive search similar to LIKE. Can I? Bharath -- A lot depends on the character set you choose to use. If you use US ASCII, there is a collation (COLLATE NOCASE) that could handle this