Re: [sqlite] int stored as a string

2013-10-24 Thread Igor Tandetnik
if I write a query based on this column? If it requires text to integer conversion, then most likely there is some. Can I get better performance If I write a query based on integer column(with new schema or new column) rather than existing column? Quite possibly. W

Re: [sqlite] SQLite keeps on searching endlessly

2013-10-19 Thread Igor Tandetnik
Why are you comparing integer values to string literals? -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Support For Table Columns In French Language Text

2013-10-18 Thread Igor Tandetnik
ll that if you want text in these columns to be sorted using French collation. You don't need to do anything special just to have SQLite store characters used in French, or indeed any Unicode characters. -- Igor Tandetnik ___ sqlite-users mailing li

Re: [sqlite] SELECT and UPDATE?

2013-10-18 Thread Igor Tandetnik
elete the record. Is there a way to do the initial selection in one swoop (select and update) or is it two SQL statements? It must be two statements, but you can of course wrap them into a single explicit transaction. -- Igor Tandetnik ___ sqlite-

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

2013-10-17 Thread Igor Tandetnik
On 10/17/2013 3:35 AM, dean gwilliam wrote: On 16/10/2013 22:04, Igor Tandetnik wrote: 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"

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
nd where the resulting list of "name"s contains no duplicates. select distinct name from items where not exists (select 1 from aliases where std_name = name or raw_name = name); -- Igor Tandetnik ___ sqlite-users mailing list sqlite-user

Re: [sqlite] creating a random sub group

2013-10-14 Thread Igor Tandetnik
this: update MyTable set SubGroup=1 where rowid in ( select rowid from MyTable order by random() limit 100 ); -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Temporary Tables

2013-10-10 Thread Igor Tandetnik
On 10/10/2013 1:16 PM, John wrote: Do you need to/should you drop temporary tables when you are done with them? You may. If you don't, the temp db and all tables in it will be deleted when you close the connection. -- Igor Tandetnik ___ s

Re: [sqlite] Bug: analyze.c does not honor SQLITE_64BIT_STATS

2013-10-09 Thread Igor Tandetnik
o looks like a compiler-specific non-portable extension. The correct spelling is #elif -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] updating using a value from another table

2013-10-07 Thread Igor Tandetnik
i = (select i from b where b.a = a.a) where exists (select 1 from b where a.a = b.a); Or alternatively, without a WHERE clause: update a set i = coalesce((select i from b where b.a = a.a), i); -- Igor Tandetnik ___ sqlite-users mailing list sqlite-

Re: [sqlite] delete the extra row from 2 similar tables with 2 key

2013-09-28 Thread Igor Tandetnik
m not sure of), you are looking for something like this: delete from lldp_stats_tx_port_table_clear where not exists ( select 1 from lldp_stats_tx_port_table t where t.if_idx = lldp_stats_tx_port_table_clear.if_idx and t.dest_addr_idx = lldp_stats_tx_port_table_clear.dest_addr_idx); --

Re: [sqlite] Bug in sqlite3.exe?

2013-09-24 Thread Igor Tandetnik
quot; is an alias here. The query is equivalent to select count(*) from country AS languages; AS is optional and can be omitted. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Compare Similar Cells

2013-09-22 Thread Igor Tandetnik
ative sample of data in your table, and the result you would like to obtain from the query when run on that sample. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Compare and INSERT INTO syntax issue

2013-09-22 Thread Igor Tandetnik
custom5 > '%' and skipcount < cast( substr(custom5, 1, 4) as int ); -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] List record from one table and all matching in another

2013-09-21 Thread Igor Tandetnik
ItemDataId)" to get the data out, then format it to taste in your application code. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Is this code OK?

2013-09-19 Thread Igor Tandetnik
. It's not reusing the variable per se that's a problem, it's losing a pointer to memory that was allocated but not yet freed. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/

Re: [sqlite] Is this code OK?

2013-09-19 Thread Igor Tandetnik
are not using the error message it returns - why do you pass &errmsg at all? Just pass NULL there. If you do pass a non-NULL pointer as the last parameter, then SQLite would allocate memory for it. You should then free said memory, or else you

Re: [sqlite] Help with a self join please

2013-09-14 Thread Igor Tandetnik
rom ( select ClassID, sum(case ReportNumber when 5 then -Points when 6 then Points else 0 end) Improv from Grades group by ClassID, StudentID ) group by ClassID; Calculating the percentage is left as an exercise for the reader. -- Igor Tandetnik ___ sql

Re: [sqlite] select with date

2013-09-12 Thread Igor Tandetnik
ke it bankdate > date('now','start of month','-1 day') -- or bankdate >= date('now','start of month') -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Query preperation time does not scale linearly with growth of no. of tables

2013-09-10 Thread Igor Tandetnik
than that. Exponential means adding each one new table would cause the running time to be multiplied by some factor. You certainly don't have it *that* bad. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org

Re: [sqlite] UPDATE question

2013-09-06 Thread Igor Tandetnik
ed as UNIQUE" part. Make it create table t1 (pk integer primary key, name text, seq integer, UNIQUE(name, seq) ) ; See how well your technique is working for you now. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlit

Re: [sqlite] Query preperation time does not scale linearly with growth of no. of tables

2013-09-06 Thread Igor Tandetnik
ng in the query. This includes tables mentioned directly, and also those pulled in indirectly via views, triggers or foreign keys. If I may be so bold, I would say that a design that calls for a database with 10,000 tables doesn't feel right to me. -- Igor

Re: [sqlite] UPDATE question

2013-09-06 Thread Igor Tandetnik
e used this system many times to avoid conflicts, but it may not work where the table needs to be accessed concurrently, as rows will sort of disappear temporarily (or at least change to an unusable state). Well, that's exactly what transactions are there for. -

Re: [sqlite] Sqlite handler in trigger

2013-09-05 Thread Igor Tandetnik
e again: there is no mechanism built into SQLite that would allow one process to be automatically notified that another process made a change to the database. Which part of this sentence did you find unclear the first time round? -- Igor Tandetnik ___

Re: [sqlite] Collating sequences. Was: Query problems

2013-09-05 Thread Igor Tandetnik
text collate c2); select x from t1 union select x from t2 order by x; Which collation is used by UNION to deduplicate? Which collation is used by ORDER BY to sort? -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http

Re: [sqlite] Sqlite handler in trigger

2013-09-05 Thread Igor Tandetnik
rocess made a change to the database. If that's what you want, you would have to implement that in your application - you can't somehow trick SQLite into doing it for you. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.

Re: [sqlite] Please help me optimize this LEFT JOIN query.

2013-09-04 Thread Igor Tandetnik
ified != '') grouped on grouped.movies = genres.movies GROUP BY genres ORDER BY name" Try FROM genres LEFT JOIN movies grouped ON (genres.movies = movies.movies AND icon_modified != '') The use of nested SELECT likely prevents SQLite from using the

Re: [sqlite] count from 2 tables

2013-09-03 Thread Igor Tandetnik
nt(*) from service_port_table sp where s.service_no = sp.service_no) > 2; -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Question about index usage

2013-08-31 Thread Igor Tandetnik
a phone book, sorted by last name then first name. Using this book, you can easily find all Smiths, and all John Smiths, but it's not helpful in finding all people named John. The order of columns in the index matters. -- Igor Tandetnik ___ s

Re: [sqlite] curious: Why no "shared library" or DLL?

2013-08-30 Thread Igor Tandetnik
) is a DLL. You can have it if you want it. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] To BEGIN or not to BEGIN. That is the question...

2013-08-28 Thread Igor Tandetnik
ou want to execute two or more statements atomically, so that either they all succeed, or one fails and then the database is rolled back to the original state. If you don't start a transaction explicitly, then each statement is implicitly wrapped in its own transaction. --

Re: [sqlite] ISO-8601 date string and '>' comparison buggy

2013-08-28 Thread Igor Tandetnik
--- SQLite doesn't have "datetime" data type. All these values are plain strings, and are compared as such. It just so happens that, if you use a suitable format consistently, usual string comparisons also order dates and times correctly. So, don't mix a

Re: [sqlite] Group by in sqlite 3.8 works a little differently depending on the spaces at the end

2013-08-28 Thread Igor Tandetnik
ly by 3.7.15 and earlier: GROUP BY should prefer the table column over the alias. There were a couple of releases in between that behaved differently. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Collation advice

2013-08-27 Thread Igor Tandetnik
s W as a variant of V (it's considered a secondary distinction, like that between A and Á). - Lithuanian puts Y between I and J -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Collation advice

2013-08-27 Thread Igor Tandetnik
On 8/27/2013 9:08 AM, Igor Tandetnik wrote: On 8/27/2013 6:37 AM, Jan Slodicka wrote: Besides this I am aware of only 1 problem - Swedish should treat v/w identically. Not anymore. There was a reform in 2006, and V and W now sort separately. ... but in Finnish, they are still sorted

Re: [sqlite] Collation advice

2013-08-27 Thread Igor Tandetnik
On 8/27/2013 6:37 AM, Jan Slodicka wrote: Besides this I am aware of only 1 problem - Swedish should treat v/w identically. Not anymore. There was a reform in 2006, and V and W now sort separately. -- Igor Tandetnik ___ sqlite-users mailing list

Re: [sqlite] Collation advice

2013-08-26 Thread Igor Tandetnik
On 8/26/2013 4:28 PM, _ph_ wrote: (btw. Muenster / Münster would fall back to full comparison due to the ü) Yes, but if you want to create a collation that sorts Muenster next to Münster, then that collation would also need to sort Muenster after, say, "mug" or "mule"

Re: [sqlite] Collation advice

2013-08-26 Thread Igor Tandetnik
By the way, the correct name for such sequences is not "digraphs", but "contractions": http://www.unicode.org/reports/tr10/#Contractions -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Collation advice

2013-08-26 Thread Igor Tandetnik
alphabet do not use digraphs Lithuanian has 'y' sorting between 'i' and 'j'. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Collation advice

2013-08-26 Thread Igor Tandetnik
rn that is with iOS (I'm really only familiar with Windows desktop, where changing the system locale is possible, and moreover different users on the same machine may run under different locales). -- Igor Tandetnik ___ sqlite-users maili

Re: [sqlite] BETWEEN and explicit collation assignment

2013-08-22 Thread Igor Tandetnik
te nocase) create index t(x collate someothercase) insert into t values ('A'); select count(*) from t where x = 'a' nocase; Well, I personally would not want to use a DBMS that requires me to do that for every single comparison operator in every single query I use. I suppose we w

Re: [sqlite] BETWEEN and explicit collation assignment

2013-08-22 Thread Igor Tandetnik
On 8/22/2013 8:41 PM, Simon Slavin wrote: On 23 Aug 2013, at 1:14am, Igor Tandetnik wrote: Once again, a concrete example: create table t(x text collate nocase); insert into t values ('A'); select count(*) from t where x = 'a'; In your opinion, what result should t

Re: [sqlite] BETWEEN and explicit collation assignment

2013-08-22 Thread Igor Tandetnik
erent collations are compared without explicit rule. Yes, I've already conceded that the case where operands have conflicting collations could be treated as an error. But that doesn't requite new syntax or new machinery, just a minor tweak to existing rules. It doesn't need to

Re: [sqlite] BETWEEN and explicit collation assignment

2013-08-22 Thread Igor Tandetnik
what exactly are the benefits of your approach? Is there something that can be done your way but can't be done the current way? Is there some bad outcome that's possible the current way but prevented your way? Do you just prefer your (as yet unspecified) syntax on purely aesthetic gr

Re: [sqlite] BETWEEN and explicit collation assignment

2013-08-22 Thread Igor Tandetnik
On 8/22/2013 3:12 PM, Simon Slavin wrote: On 22 Aug 2013, at 8:04pm, Igor Tandetnik wrote: [snip] I pretty much agree with everything you wrote there. But it has nothing to do with my original objection which was the explicit use of a COLLATE operator inside an expression. If you agree

Re: [sqlite] BETWEEN and explicit collation assignment

2013-08-22 Thread Igor Tandetnik
rgues: "I feel that rather than notice a specific error in the implementation of BETWEEN [Clemens] has highlighted a conceptual error in SQLite." In other words: let's not just fix this particular bug and go back to business as usual; let's instead completely change the way c

Re: [sqlite] BETWEEN and explicit collation assignment

2013-08-22 Thread Igor Tandetnik
On 8/22/2013 2:10 PM, Simon Slavin wrote: Sorry, hit 'send' too early. On 22 Aug 2013, at 6:15pm, Igor Tandetnik wrote: But again, by what formal mechanism does a property of the column affect the behavior of the operator? I see no reason for it to do that. So to be clear: cr

Re: [sqlite] BETWEEN and explicit collation assignment

2013-08-22 Thread Igor Tandetnik
On 8/22/2013 11:49 AM, Simon Slavin wrote: On 22 Aug 2013, at 2:36pm, Igor Tandetnik wrote: On 8/22/2013 8:52 AM, Simon Slavin wrote: Nevertheless do you understand the point I'm trying to make -- that collations are a modifier for comparisons not individual values ? I do understand

Re: [sqlite] BETWEEN and explicit collation assignment

2013-08-22 Thread Igor Tandetnik
view better if you just did this: in http://sqlite.org/datatype3.html section 6.1, replaced two occurrences of "with precedence to the left operand" with "It's an error if two operands have different collations". This keeps the existing, well defined mechanisms intact

Re: [sqlite] BETWEEN and explicit collation assignment

2013-08-22 Thread Igor Tandetnik
end) . With such a function, "a = b collate muchStronger" is equivalent to "hulkify(a) = hulkify(b) collate BINARY". In other words, hulkify(x) is to muchStronger what upper(x) is to NOCASE. -- Igor Tandetnik ___ sqlite-users mail

Re: [sqlite] BETWEEN and explicit collation assignment

2013-08-21 Thread Igor Tandetnik
avior in a consistent way. I don't think it would fly, if only for reasons of backward compatibility and compatibility with other database systems, but at least this argument is defensible. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-use

Re: [sqlite] BETWEEN and explicit collation assignment

2013-08-21 Thread Igor Tandetnik
On 8/21/2013 2:55 PM, Simon Slavin wrote: On 21 Aug 2013, at 5:02pm, Igor Tandetnik wrote: I imagine you'd still want to be able to put COLLATE clause on the column definition, as in "create table t (x collate NOCASE);". How is this supposed to work in your hypothetical

Re: [sqlite] BETWEEN and explicit collation assignment

2013-08-21 Thread Igor Tandetnik
new world? Collation is a property of the value, similar to type and affinity - it must be, to allow this kind of annotation. Along with other properties, collation then affects the behavior of operators acting on the value. -- Igor Tandetnik ___

Re: [sqlite] name resolutionn in GROUP BY

2013-08-14 Thread Igor Tandetnik
re not selected. Most DBMS allow sorting (and grouping) by arbitrary expressions, which means that the standard is not directly applicable. One has to extrapolate. Igor Tandetnik On 8/14/2013 2:41 PM, Marc L. Allen wrote: This appears to be how MS SQL handles it... looking at the definitions

Re: [sqlite] name resolutionn in GROUP BY

2013-08-14 Thread Igor Tandetnik
reference a column of T. ORDER BY clause is different - column names there resolve in the context of the whole preceding SELECT statement, not just its FROM part: 3) Let T be the table specified by the . 4) If ORDER BY is specified, then each in the sha

Re: [sqlite] delete the extra row from 2 similar tables

2013-08-11 Thread Igor Tandetnik
lldp_stats_tx_port_table_clear. Is this what you are looking for? delete from lldp_stats_tx_port_table_clear where if_idx not in (select if_idx from lldp_stats_tx_port_table); -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080

Re: [sqlite] INSERT with rowid column

2013-08-06 Thread Igor Tandetnik
id column is an alias for the rowid, shouldn't I be able to not supply it? Yes you should be. You do that by providing an explicit list of columns that omits it: insert into tests(name) values ('test 1'); -- Igor Tandetnik ___ sqlite-

Re: [sqlite] Query optimization: Checking for existence before performing action

2013-08-02 Thread Igor Tandetnik
does not involve any triggers. ... whereas that from Simon Davies does. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] can column name come from a table?

2013-07-29 Thread Igor Tandetnik
lect columnName from columnNameTable ...); -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Using VACUUM on an empty file will create a defaultdatabase

2013-07-25 Thread Igor Tandetnik
ommand? Or rm command? Or cp command? There are lots of ways a person could "destroy complete environments" - why are you singling out one of the more obscure and relatively harmless ones? -- Igor Tandetnik ___ sqlite-users mailing list sqlite-u

Re: [sqlite] Multiple autoinc columns?

2013-07-23 Thread Igor Tandetnik
On 7/24/2013 12:34 AM, Kai Peters wrote: Is it possible to have two (or more) autoincrement columns per table? No, not automatically. With some work, you could simulate it using AFTER INSERT trigger. -- Igor Tandetnik ___ sqlite-users mailing list

Re: [sqlite] Multiple return values from aggregate function

2013-07-21 Thread Igor Tandetnik
somehow. I don't really know much about them beyond the fact that they exist (http://www.sqlite.org/vtab.html), but they can manufacture whole resultsets. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cg

Re: [sqlite] Order By clause in aggregate functions?

2013-07-21 Thread Igor Tandetnik
On 7/21/2013 5:01 PM, Simon Slavin wrote: I had to fake it. The parameter I passed to my aggregate function was a string as follows: theOrder||':'||theValue My function extension had to split the values into two parts Couldn't you just pass two parameters, separately? --

Re: [sqlite] Anything like "select 7 as a, 8 as b, a / b as c; " possible whatsoever?

2013-07-21 Thread Igor Tandetnik
ctly legal. It's OK to refer to column aliases in ORDER BY clause. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Table name in attach'ed databases

2013-07-20 Thread Igor Tandetnik
er certain circumstances, single quotes (the latter is only possible in context where string literals cannot syntactically appear). Personally, I feel it is best to stick to valid identifiers if at all possible, and to double quote-enclosed names otherwise. -- Igor

Re: [sqlite] Anything like "select 7 as a, 8 as b, a / b as c; " possible whatsoever?

2013-07-20 Thread Igor Tandetnik
believe the query as written is deficient? -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Table name in attach'ed databases

2013-07-20 Thread Igor Tandetnik
Try select * from "123test".employees limit 1; A name that's not a valid identifier (a sequence of letters and digits beginning with a letter) should be enclosed in double quotes. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-

Re: [sqlite] Anything like "select 7 as a, 8 as b, a / b as c; " possible whatsoever?

2013-07-20 Thread Igor Tandetnik
On 7/20/2013 3:29 PM, E.Pasma wrote: Op 20 jul 2013, om 16:13 heeft Igor Tandetnik het volgende geschreven: select id, a, b, a/b as c from ( SELECT id, (SELECT [very complex subselect here, that uses categories.id as input]) AS a, (SELECT [another very complex subselect here, that uses

Re: [sqlite] Anything like "select 7 as a, 8 as b, a / b as c; " possible whatsoever?

2013-07-20 Thread Igor Tandetnik
( SELECT id, (SELECT [very complex subselect here, that uses categories.id as input]) AS a, (SELECT [another very complex subselect here, that uses categories.id as input]) AS b FROM categories ) ORDER BY c; -- Igor Tandetnik ___ sqlite-users mailing

Re: [sqlite] Query on sqlit3_malloc()

2013-07-19 Thread Igor Tandetnik
do so. For example, sqlite3_mprintf returns a pointer to memory allocated with sqlite3_malloc, which the caller should eventually deallocate with sqlite3_free. sqlite3_get_table allocates memory for the resulting table, which the caller should deallocate with sqlite3_free_table. -- Igor Tand

Re: [sqlite] Integer data type

2013-07-19 Thread Igor Tandetnik
On 7/19/2013 8:29 AM, Paolo Bolzoni wrote: Interesting problem, can you add a new comparison operator to sqlite3? Yes, but only for strings, not for ints. http://sqlite.org/c3ref/create_collation.html -- Igor Tandetnik ___ sqlite-users mailing

Re: [sqlite] function auxiliary data

2013-07-16 Thread Igor Tandetnik
ld work the way you want. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] sqlite3_bind_text truncates strings with "."

2013-07-16 Thread Igor Tandetnik
? I don't quite see how the conclusion follows from the premise. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Another 2 questions about SQLite

2013-07-13 Thread Igor Tandetnik
ementation details, subject to change without notice. You may of course continue to live dangerously; just don't be surprised when you upgrade to a newer SQLite version and you program breaks. -- Igor Tandetnik ___ sqlite-users mailing list sqlite

Re: [sqlite] Another 2 questions about SQLite

2013-07-12 Thread Igor Tandetnik
n what you get from the remainder of the SELECT is undefined." -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Another 2 questions about SQLite

2013-07-12 Thread Igor Tandetnik
On 7/12/2013 12:30 PM, James K. Lowden wrote: On Mon, 08 Jul 2013 00:37:55 -0400 Igor Tandetnik wrote: I don't believe it's SQLite's job to ensure the programmer doesn't shoot herself in the foot. After all, you don't expect, say, the C++ compiler to prevent you

Re: [sqlite] Unexpected result from SQLite; WebSQL(SQLite) gets it right in sqlfiddle

2013-07-11 Thread Igor Tandetnik
On 7/11/2013 9:19 AM, Igor Tandetnik wrote: On 7/10/2013 1:30 PM, compscilaw . wrote: The correct result is one row; SQLite returns all rows. I'm getting three rows (with program_id of 4, 5 and 6), which looks correct to me. Why do you expect one row? Note that I'm using the

Re: [sqlite] Unexpected result from SQLite; WebSQL(SQLite) gets it right in sqlfiddle

2013-07-11 Thread Igor Tandetnik
he correct result is one row; SQLite returns all rows. I'm getting three rows (with program_id of 4, 5 and 6), which looks correct to me. Why do you expect one row? -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqli

Re: [sqlite] Unexpected result from SQLite; WebSQL(SQLite) gets it right in sqlfiddle

2013-07-11 Thread Igor Tandetnik
ition tests for the case where the matching record is not in fact found on the right hand side of such join. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Speeding up slow select

2013-07-10 Thread Igor Tandetnik
pects). You may want to drop it. Barring that, you can disable it for this particular query, by writing ...WHERE +status_timeline_relationship.timeline_id = 2 AND ... Note the unary plus - it doesn't affect the result, but makes the column ineligible for

Re: [sqlite] Calling sqlite3_column_int on a column with a too large number?

2013-07-10 Thread Igor Tandetnik
billions: what happens using sqlite3_column_int to get that result? SQLite will return 1410065408, which is 1^10 mod 2^32. Use sqlite3_column_int64 to get the unmodified value. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] Reference to an undefined field

2013-07-09 Thread Igor Tandetnik
n't the engine assert in this case? http://www.sqlite.org/c3ref/column_blob.html If the SQL statement does not currently point to a valid row, or if the column index is out of range, the result is undefined. -- Igor Tandetnik ___ sqlite-users mailin

Re: [sqlite] Unstable ON DELETE actions

2013-07-09 Thread Igor Tandetnik
ELETE trigger that executes several statements in the desired order. - If two foreign keys come into conflict, SQLite silently ignores one of them instead of raising an error. So don't create two foreign keys that come into conflict. -- Igor

Re: [sqlite] Another 2 questions about SQLite

2013-07-07 Thread Igor Tandetnik
On 7/8/2013 12:09 AM, James K. Lowden wrote: On Thu, 04 Jul 2013 16:08:38 -0400 Igor Tandetnik wrote: On 7/4/2013 3:15 PM, James K. Lowden wrote: This weird case is one of (I would say) misusing the connection. IMO SQLite should return an error if prepare is issued on a connection for which

Re: [sqlite] Another 2 questions about SQLite

2013-07-07 Thread Igor Tandetnik
lts are unpredictable. So don't do that, and then you won't need detailed understanding of SQLite internals. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] table format for most efficient query

2013-07-05 Thread Igor Tandetnik
>= rangestart and and :x < rangeend; -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] table format for most efficient query

2013-07-05 Thread Igor Tandetnik
On 7/5/2013 9:13 AM, Paul Sanderson wrote: my primary key would not be unique :( That's an oxymoron - primary key is unique, by definition. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cg

Re: [sqlite] table format for most efficient query

2013-07-04 Thread Igor Tandetnik
efficiently. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Another 2 questions about SQLite

2013-07-04 Thread Igor Tandetnik
x27;s still way better than being unable to make any changes at all. We (the SQLite users) have seen this movie before, and we didn't like it. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-b

Re: [sqlite] Another 2 questions about SQLite

2013-07-04 Thread Igor Tandetnik
On 7/4/2013 3:15 PM, James K. Lowden wrote: If two processes sharing a connection... This is a physical impossibility. There ain't no such thing as two processes sharing a connection. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-

Re: [sqlite] Another 2 questions about SQLite

2013-07-01 Thread Igor Tandetnik
ustify any conclusion. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Another 2 questions about SQLite

2013-07-01 Thread Igor Tandetnik
On 7/1/2013 10:33 PM, James K. Lowden wrote: On Sun, 30 Jun 2013 23:27:23 -0400 Igor Tandetnik wrote: If you change data that a live SELECT statement is iterating over, the outcome is unpredictable. It may appear to work, it may skip rows, it may return some rows more than once Really

Re: [sqlite] Another 2 questions about SQLite

2013-06-30 Thread Igor Tandetnik
On 6/30/2013 11:17 PM, Igor Korot wrote: On Sun, Jun 30, 2013 at 7:47 PM, Igor Tandetnik wrote: On 6/30/2013 10:27 PM, Igor Korot wrote: 1. I'm trying to minimize the number of requests I'm doing to the DB. What I need is a way to count the number of rows that the query return t

Re: [sqlite] Another 2 questions about SQLite

2013-06-30 Thread Igor Tandetnik
, the outcome is unpredictable. It may appear to work, it may skip rows, it may return some rows more than once, it may report rows out of order (for queries with ORDER BY clause). Don't do that. -- Igor Tandetnik ___ sqlite-users mailing list s

Re: [sqlite] Another 2 questions about SQLite

2013-06-30 Thread Igor Tandetnik
crew up the original select statement? Something like this: Just run this statement; DELETE FROM players WHERE players.isnew="1"; You are making it way too complicated. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] sqlite3: .import command handles quotation incorrectly

2013-06-26 Thread Igor Tandetnik
e - would take a few minutes to make and save him a lot of trouble - I even offered help doing it - but he is intent on arguing that SQLite should change and do it "smarter" - (which is his right) - and now I'm trying to show why it isn't smarter in the hope of finding a resol

Re: [sqlite] sqlite3: .import command handles quotation incorrectly

2013-06-26 Thread Igor Tandetnik
RFC 4180, then it would appear that the rules are not in fact set in stone, and are in fact subject to interpretation and disagreement. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Questions about exclusive transation

2013-06-25 Thread Igor Tandetnik
(e.g. trying to prepare a syntactically incorrect statement). Especially, is that possible that the 'commit' could get an error of SQLITE_BUSY? No, it is not. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://

Re: [sqlite] Deadlock with multiple connections

2013-06-20 Thread Igor Tandetnik
oid this scenario, start writer transactions with BEGIN IMMEDIATE. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] How to select from a temp table with same name as a main table.

2013-06-19 Thread Igor Tandetnik
least recently | attached. As the first (i.e., most recently) attached, main always loses. You seem to have it backwards. The first would be least recent (that is, oldest); the last would be most recent. -- Igor Tandetnik ___ sqlite-users mailing list

<    1   2   3   4   5   6   7   8   9   10   >