[sqlite] Table constraints

2013-10-16 Thread Joseph L. Casale
Hi, I have a table as follows: CREATE TABLE t ( id INTEGER NOT NULL, a VARCHAR NOT NULL COLLATE 'nocase', b VARCHAR COLLATE 'nocase', c VARCHAR CHECK (c IN ('foo', 'bar', NULL)) COLLATE 'nocase', PRIMARY KEY (id) ); How does one elegantl

[sqlite] FW: sqlite-users Digest, Vol 70, Issue 16

2013-10-16 Thread Paul Bainter
Joe, Thank You, Thank You, that is exactly what I needed. I couldn't think of how to debug this, so with your suggestion, I put a try block in my code and wrote the stack trace out to a text file and that gave me exactly what I needed. I was missing a dll, but it ended up having nothing to do wi

Re: [sqlite] select all fields of a column in one table that are not in a column in another table

2013-10-16 Thread Igor Tandetnik
On 10/16/2013 4:49 PM, dean gwilliam wrote: if I have two tables 1 aliases (std_name, raw_name) 2 items (name..) what would the query look like to select all "name" fields in "itms" that match neither "std_name" or "raw_name" in "aliases" and where the resulting list of "name"s contains no du

[sqlite] select all fields of a column in one table that are not in a column in another table

2013-10-16 Thread dean gwilliam
I'm just wondering... if I have two tables 1 aliases (std_name, raw_name) 2 items (name..) what would the query look like to select all "name" fields in "itms" that match neither "std_name" or "raw_name" in "aliases" and where the resulting list of "name"s contains no duplicates. I ask becaus

Re: [sqlite] ALTER COLUMN in sqlite

2013-10-16 Thread John McKown
Thank you for the information. I guess I assumed the Lite was also for "not too big". The uses I've seen on my Linux system all seem to be that. Oh, and I'm reading your book, off and on, as I get time. I have the Kindle edition. But I keep getting side tracked by silly people at work who keep pest

Re: [sqlite] ALTER COLUMN in sqlite

2013-10-16 Thread Jay A. Kreibich
On Wed, Oct 16, 2013 at 07:32:08AM -0500, John McKown scratched on the wall: > I'm not truly against such a thing. But we need to remember the main use > for SQLite is to be small, fast, and "embedded". At least as best as I can > tell, it is not meant to compete with MariaDB (nee MySQL) or Postgre

Re: [sqlite] Feature Request: Binding Arrays

2013-10-16 Thread Dominique Devienne
On Wed, Oct 16, 2013 at 1:28 PM, Richard Hipp wrote: > Please see http://www.sqlite.org/src/artifact/2ece66438?ln=13-75 Thanks. Being familiar with vtables, I had imagined as much, even though stopped short of doing it in practice. This takes care of hiding the DML statements from auth/trace h

Re: [sqlite] ALTER COLUMN in sqlite

2013-10-16 Thread John McKown
That was very interesting and informative. I'm a "normal" IT type person (as "normal" as most IT people, I guess ). I know very little about the application that you talked about, but it did help me to understand why SQLite might be used instead of a "more normal" SQL server data base like PostgreS

Re: [sqlite] ALTER COLUMN in sqlite

2013-10-16 Thread a . furieri
On Wed, 16 Oct 2013 07:32:08 -0500, John McKown wrote: I can't say for sure, but would somebody want to store 20 million rows in a SQLite data base? Why? I really am curious Hi John, you could eventually find interesting in some way my own first hand experiences in the Geographic/GeoSpatial f

Re: [sqlite] Analyze optimizing views?

2013-10-16 Thread Richard Hipp
On Wed, Oct 16, 2013 at 10:29 AM, Daniel Polski wrote: > Hello, > Does the ANALYZE command gather statistics and optimize for views I've > created or only "real tables"? > Only real tables. Views are just macros that are applied to queries when the queries are run. If you have: CREATE TABL

[sqlite] Analyze optimizing views?

2013-10-16 Thread Daniel Polski
Hello, Does the ANALYZE command gather statistics and optimize for views I've created or only "real tables"? Best regards, Daniel ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Feature Request: Binding Arrays

2013-10-16 Thread techi eth
It is really useful feature. I have a use case where I need to log the data in continuous interval & store in database. If array type is supported by sqlite then in single row I can store data in array of time stamp & array of value. Is it specific to int type or any other data type can be support

Re: [sqlite] Feature Request: Binding Arrays

2013-10-16 Thread Paul van Helden
> Since version 3.6.21, circa 2009-12-07. Note however that this capability > is not built in. It is an extension that you need to compile and link > separately. > > OK... Herewith my vote to make it standard then, like SQLITE_ENABLE_COLUMN_METADATA was enabled for the precompiled binary at some

Re: [sqlite] ALTER COLUMN in sqlite

2013-10-16 Thread John McKown
I'm not truly against such a thing. But we need to remember the main use for SQLite is to be small, fast, and "embedded". At least as best as I can tell, it is not meant to compete with MariaDB (nee MySQL) or PostgreSQL. It doesn't appear to be _committed_ to being 100% SQL compliant (as in exactly

Re: [sqlite] Trying to figure out how to circumvent sqlite3_win32_mbcs_to_utf8

2013-10-16 Thread Richard Hipp
On Wed, Oct 16, 2013 at 7:51 AM, Mike Clagett wrote: > Hi - > > We have a C++ (VisualC++) app that is reading from and writing to a sqlite > database. Profiling reveals that it is spending 883.437 of its 2160.988 > seconds in the sqlite3_win32_mbcs_to_utf8 function. Wow. That routine should o

Re: [sqlite] Feature Request: Binding Arrays

2013-10-16 Thread Richard Hipp
On Wed, Oct 16, 2013 at 7:40 AM, Paul van Helden wrote: > Fantastic! I've been wanting this for a long time. > > Since which version do we have sqlite3_intarray_x? > > Since version 3.6.21, circa 2009-12-07. Note however that this capability is not built in. It is an extension that you need

[sqlite] Trying to figure out how to circumvent sqlite3_win32_mbcs_to_utf8

2013-10-16 Thread Mike Clagett
Hi - We have a C++ (VisualC++) app that is reading from and writing to a sqlite database. Profiling reveals that it is spending 883.437 of its 2160.988 seconds in the sqlite3_win32_mbcs_to_utf8 function. We are using std::basic_string as our string type and I can only assume that these are

Re: [sqlite] Feature Request: Binding Arrays

2013-10-16 Thread Paul van Helden
Fantastic! I've been wanting this for a long time. Since which version do we have sqlite3_intarray_x? On Wed, Oct 16, 2013 at 1:28 PM, Richard Hipp wrote: > Please see http://www.sqlite.org/src/artifact/2ece66438?ln=13-75 > > > -- > D. Richard Hipp > d...@sqlite.org > _

Re: [sqlite] FTS4 + spellfix1 with multiple languages

2013-10-16 Thread Raf Geens
On 10/16/13 08:48, Dan Kennedy wrote: On 10/15/2013 08:13 PM, Raf Geens wrote: Hi, I have a FTS4 table that contains entries in multiple languages (using the languageid option). I also have a spellfix1 table that I use to search with misspelled words on the FTS4 table. In the spellfix1 do

Re: [sqlite] Feature Request: Binding Arrays

2013-10-16 Thread Richard Hipp
Please see http://www.sqlite.org/src/artifact/2ece66438?ln=13-75 -- D. Richard Hipp d...@sqlite.org ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Feature Request: Binding Arrays

2013-10-16 Thread Dominique Devienne
On Wed, Oct 16, 2013 at 12:03 PM, Clemens Ladisch wrote: > Dominique Devienne wrote: > > select * from some_table where some_column in (...) > > > > 2) In other places we synthesize the query text by splicing list.join(", > ") > > in the in (list) where clause. > > > > Both solutions are unsatisfa

Re: [sqlite] Feature Request: Binding Arrays

2013-10-16 Thread Clemens Ladisch
Dominique Devienne wrote: > select * from some_table where some_column in (...) > > 2) In other places we synthesize the query text by splicing list.join(", ") > in the in (list) where clause. > > Both solutions are unsatisfactory, because ... 2) constantly reparse and > prepare queries, which can

[sqlite] Feature Request: Binding Arrays

2013-10-16 Thread Dominique Devienne
We have an SQLite virtual-table heavy application with a lot of the GUI driven by SQL queries, and often times we have queries of the form select * from some_table where some_column in (...) where ... is coming from prior selections in the GUI, or filtering, etc... 1) In some places, we create t

[sqlite] ALTER COLUMN in sqlite

2013-10-16 Thread mitzanu
There's no ALTER COLUMN in sqlite. I believe the option is to: •Rename the table to a temporary name •Create a new table without the NOT NULL constraint •Copy the content of the old table to the new one •Remove the old table Can you guys implement ALTER COLUMN in sqlite? it would be a great feat

[sqlite] JDBC Driver Issue

2013-10-16 Thread mitzanu
Sqlite JDBC : I have a bug in Jdbc driver. The method DatabaseMetaData.getColumns(String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern) throws SQLException; does not correctly return the value in resultSet.getInt(11 ) - NULLABLE OR