Re: [sqlite] aggregate functions with DISTINCT

2015-01-12 Thread Igor Tandetnik
On 1/12/2015 9:53 AM, Dominique Devienne wrote: My little brain has no idea how the "a;b:c/c,d" came about from the input rows, so I don't find it logical at all myself... Simple, really. For each ('x', '@') row, string_agg adds '@x' to the resulting string (except the separator is omitted for

Re: [sqlite] Error while executing query: no such column: t1.*B.Switch-Tower-Sector

2015-01-08 Thread Igor Tandetnik
ATE t2 SET [*B.ANT_ORIENTATION] = (SELECT t2.ANT_ORIENTATION FROM t2 WHERE t2.[*SSID-CELLID-SECTOR] = t1.[*B.Switch-Tower-Sector]); Before you can use a table name elsewhere, you must introduce it in a FROM clause (or INSERT INTO, UPDATE or DELETE clause). -- Igor

Re: [sqlite] Time Zone Conversions

2015-01-07 Thread Igor Tandetnik
when 'PST' then '+8' -- add more clauses to taste else '+0' end) || ' hours'); But first, you would need to change your timestamp format to one recognized by SQLite, e.g. '2014-04-11 02:00:00' -- Igor Tandetnik _

Re: [sqlite] Is this date supposed to be less than or more than the other?

2015-01-02 Thread Igor Tandetnik
On 1/2/2015 4:54 PM, J Decker wrote: select * from messages where received < datetime( 'now', '-3600' ) datetime( 'now', '-3600' ) returns NULL; the second parameter is not a valid modifier string. Most comparisons with N

Re: [sqlite] Trigger not working with empty table [reproducible]

2014-12-31 Thread Igor Tandetnik
you meant something like WHEN new.last_price NOT IN (SELECT last_price ...) -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Encrypted database

2014-12-13 Thread Igor Tandetnik
e database precisely so that it can't be opened by other tools, only by your application, haven't you? If not, what was the goal of the exercise? If you want the database to be accessible via any SQLite database management tool, don't encry

Re: [sqlite] How do I update multiple rows in a single sql statement

2014-12-09 Thread Igor Tandetnik
On 12/9/2014 10:38 AM, James K. Lowden wrote: If the subquery to the right of the SET clause produces more than one row, the statement fails. Are you sure? Normally, a scalar subquery doesn't fail when the resultset contains more than one row - it just silently produces the value from the fir

Re: [sqlite] How do I update multiple rows in a single sql statement

2014-12-08 Thread Igor Tandetnik
(a view; or REPLACE INTO may sometimes be pressed into service). But I, for one, kinda miss UPDATE ... FROM. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] How do I update multiple rows in a single sql statement

2014-12-08 Thread Igor Tandetnik
ating the whole three-conjuncts condition twice - once in SET id=, and again in WHERE. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] How do I update multiple rows in a single sql statement

2014-12-08 Thread Igor Tandetnik
e values in the current row of temp_table - it's either always true, or always false. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] How do I update multiple rows in a single sql statement

2014-12-08 Thread Igor Tandetnik
least one row in temp_table matches one row in some_table. In other words, it updates no rows, or all rows - never just some. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] appending the output of a query

2014-12-02 Thread Igor Tandetnik
, parent, FileName FROM rtable WHERE ID = 510 UNION ALL SELECT rcte.level + 1 as level, rtable.parent, rtable.FileName FROM rcte JOIN rtable ON rcte.parent = rtable.ID WHERE rtable.FileName <> '.') SELECT FileName FROM rcte ORDER BY level desc; -

Re: [sqlite] appending the output of a query

2014-12-02 Thread Igor Tandetnik
ically guaranteed that rows will be grouped in the right order, but it's very likely to work in practice. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] creating trigger to handle multiple types of insert

2014-11-26 Thread Igor Tandetnik
, ...) VALUES( (case when new.EventNodeId < 0 then null else new.EventNodeId end), ...); -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Testing the 'I' in ACID

2014-11-25 Thread Igor Tandetnik
the code. Insofar as the article defines "serializable" as "behaving as if executed serially", transactions in SQLite are trivially shown to be serializable - because they are, in fact, forced to be executed serially. -- Igor Tandetnik

Re: [sqlite] Testing the 'I' in ACID

2014-11-25 Thread Igor Tandetnik
On 11/25/2014 5:32 PM, Simon Slavin wrote: SQLite doesn't support massive concurrency because it locks the entire database during changes. Not entirely true. WAL mode allows one writer working concurrently with multiple readers. -- Igor Tand

Re: [sqlite] Serializing an object's vector or array using sqlite3 in c++

2014-11-20 Thread Igor Tandetnik
On 11/21/2014 12:52 AM, Thane Michael wrote: I've been searching for a way to serialize an object's vector using sqlite3 There's nothing in sqlite3 that would help (or hinder) this task. What made you believe otherwise? --

Re: [sqlite] Is this a bug? autoincrement in int primary key vs integer primary key

2014-11-16 Thread Igor Tandetnik
On 11/16/2014 10:51 AM, Paul Sanderson wrote: AUTOINCREMENT is only allowed on an INTEGER PRIMARY KEY No it's not a bug. AUTOINCREMENT is only allowed on INTEGER PRIMARY KEY. Which part of the error message do you find unclear? For details, see http://www.sqlite.org/autoinc.html ___

Re: [sqlite] [SQLite]Basic queries

2014-11-13 Thread Igor Tandetnik
code on win7 32bits OS. Though I haven't specified any compile option, in this case, For which OS platform is the generated binary? for 32bits win OS or 64bits win OS? Depends on which compiler you built it with - 32-bit or 64-bit. -- Igor Tand

Re: [sqlite] cnt(x) what do the brackets signify

2014-11-12 Thread Igor Tandetnik
On 11/12/2014 12:52 PM, Paul Sanderson wrote: I have googled but can't see what cnt(x) actually signifies - cnt is not a function The same thing it signifies in "CREATE TABLE cnt(x);" "cnt" is an "ephemeral" table with a single

Re: [sqlite] Triggers and CTE's

2014-11-11 Thread Igor Tandetnik
On 11/11/2014 8:37 PM, Richard Hipp wrote: On Tue, Nov 11, 2014 at 8:22 PM, Igor Tandetnik wrote: On 11/11/2014 6:15 PM, Ben Newberg wrote: Looks like a bug to me. The statement works standalone, but not within a trigger. There are many limitations and restrictions on the statements

Re: [sqlite] Triggers and CTE's

2014-11-11 Thread Igor Tandetnik
ect wk + 1 from Weeks limit 10) select wk from Weeks; This works both ways. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] SQLite where clause tree

2014-11-10 Thread Igor Tandetnik
/ * /\ 5 4 This tree makes no sense whatsoever - it somehow has a literal as an inner node, with two children. In a correct expression tree, literals would be in the leaves and operators in the inner nodes, with each subtree representing one operand. -- Igor Tandetnik

Re: [sqlite] How to check if a record exists

2014-11-04 Thread Igor Tandetnik
t/present). May work faster than the variant using count() if there are many records satisfying the condition (EXISTS stops as soon as it finds the first matching record), but that may not be a consideration in your case (DatasetID sounds like primary key)

Re: [sqlite] Stuck and drowning trying to work out some SQL.

2014-11-01 Thread Igor Tandetnik
On 11/1/2014 11:52 AM, Luuk wrote: Is the 'else null' part needed??, or can it be deleted Yes, it can be removed. CASE expression returns null when no case matches. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlit

Re: [sqlite] Stuck and drowning trying to work out some SQL.

2014-11-01 Thread Igor Tandetnik
then Time_Event else null end) Start_Time, min(case State when 'Closed' then Time_Event else null end) End_Time from Table_1 group by Disruption_id; Might be faster as it doesn't require joins and works in a single pass. Both queries would benefit from an index o

Re: [sqlite] Clarification on sqlite handling of mixed aggregate and non-aggregate columns

2014-10-29 Thread Igor Tandetnik
On 10/29/2014 5:42 PM, Baruch Burstein wrote: SELECT max(a), b FROM t WHERE a<50; Is there some way to filter *after* this is applied? Wrap it in another select: select * from ( SELECT max(a) maxa, b FROM t WHERE a<50 ) where b is not null; -- Igor Tan

Re: [sqlite] WHERE expression with operators from text functions?

2014-10-18 Thread Igor Tandetnik
nge accepted". While possible (if I recall correctly, SQL with CTE is Turing-complete), I would not recommend it in practice. Do use FTS, it was designed for this kind of queries. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org h

Re: [sqlite] group question

2014-10-18 Thread Igor Tandetnik
ifies conditions on the underlying table rows, before aggregation is performed. If you want to only report groups containing exactly three rows, use HAVING clause. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:808

Re: [sqlite] WHERE expression with operators from text functions?

2014-10-17 Thread Igor Tandetnik
tr(tail, 1, instr(tail || '+', '+')-1), substr(tail, instr(tail || '+', '+') + 1) from split where tail != '' ) select * from mytable where not exists ( select str from split where str is not nul

Re: [sqlite] Inmemory database in sqlite

2014-10-16 Thread Igor Tandetnik
memory databases right ? None, naturally. That would defeat the whole purpose - the database would no longer be in-memory. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite

Re: [sqlite] Inmemory database in sqlite

2014-10-16 Thread Igor Tandetnik
whom? -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Search query alternatives.

2014-10-15 Thread Igor Tandetnik
use UNION ALL - it's much cheaper (this is assuming you insist on keeping multiple tables). -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Make a database read-only?

2014-10-14 Thread Igor Tandetnik
ested in going down this path. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Make a database read-only?

2014-10-14 Thread Igor Tandetnik
On 10/14/2014 10:12 AM, John Hascall wrote: Some code you may find useful to enforce the readonly byte Of course, anyone smart enough to change the byte from read-only to read-write before making changes, would also be smart enough to set it back afterwards. -- Igor Tandetnik

Re: [sqlite] [SQL Query] Top 10 of 5 different groups sorted by length

2014-10-14 Thread Igor Tandetnik
bles. My query uses neither views nor CTE. I'm a little curious about how a comment on the former could be construed to reflect in any way on the latter. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.o

Re: [sqlite] Make a database read-only?

2014-10-14 Thread Igor Tandetnik
hard drive in the privacy of their home? In any case, you can't really stop them from doing whatever they want with their own file, even if that file started life as a copy of yours. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-

Re: [sqlite] [SQL Query] Top 10 of 5 different groups sorted by length

2014-10-13 Thread Igor Tandetnik
.PlanDate = '2014-02-13' order by (strftime('%s', r2.End) - strftime('%s', r2.Start)) desc limit 10 ); It'll probably be noticeably slower than your unrolled query, though. -- Igor Tandetnik ___ sqlite-users mailin

Re: [sqlite] decoding a bitmask

2014-10-13 Thread Igor Tandetnik
- so of course it only checks out when the other side of the comparison is also a one-bit value. You want CASE WHEN visits.transition & 0x0080 THEN 'Blocked' ELSE '' END -- Igor Tandetnik ___ sqlite-users mailing list

Re: [sqlite] following a trail of references

2014-10-12 Thread Igor Tandetnik
, previousid, location from path join mytable on (path.previousid = mytable.id) ) select * from path; -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Check if file exists in SQL syntax?

2014-10-10 Thread Igor Tandetnik
such a function - but it provides a way for you to create your own custom functions. So you can write one. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] calculating in the command line interface

2014-10-01 Thread Igor Tandetnik
On 10/1/2014 10:34 AM, Stephan Beal wrote: You're doing integer math. You need floating point: select round(1/2,10) as t; You probably meant round(1.0/2, 10), or round(1/2.0, 10) or similar. -- Igor Tandetnik ___ sqlite-users mailing

Re: [sqlite] sqlite max arguments assistance

2014-09-22 Thread Igor Tandetnik
On 9/22/2014 4:08 PM, jungle Boogie wrote: Hi Igor, On 22 September 2014 12:52, Igor Tandetnik wrote: Dollar sign or not, the outcome you observe suggests that the values are stored as strings. What does this query return? select typeof(transaction_amount), count(*) from august group by 1

Re: [sqlite] sqlite max arguments assistance

2014-09-22 Thread Igor Tandetnik
On 9/22/2014 3:42 PM, Jungle Boogie wrote: From: Igor Tandetnik The fact that the result is printed complete with $ sign suggests strongly that the values are stored, and compared, as strings. '$999.63' > '$16695.36' when using alphabetical comparison. This is my mis

Re: [sqlite] sqlite max arguments assistance

2014-09-22 Thread Igor Tandetnik
result is printed complete with $ sign suggests strongly that the values are stored, and compared, as strings. '$999.63' > '$16695.36' when using alphabetical comparison. -- Igor Tandetnik ___ sqlite-users mailing list sqlit

Re: [sqlite] How preserve the string metric in an extension.

2014-09-19 Thread Igor Tandetnik
eplaced by a typedef name defined as int, or the type of argv can be written as char ** argv, and so on. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] How preserve the string metric in an extension.

2014-09-19 Thread Igor Tandetnik
); I have correctly "aaa" So what seems to be the problem then? I don't understand why this difference I don't understand why you expected there to *not* be a difference between a program that performs a nonsensical action, and a program that uses the API in accordan

Re: [sqlite] Sorting by month with two dates input

2014-09-01 Thread Igor Tandetnik
ce of billdate" represented in the database - as NULL or as empty string? I suspect it's the latter. coalesce() only treats nulls as "special", not empty strings. See how the answer changes if you replace coalesce(billdate,bdate) with (case when billdate != '' the

Re: [sqlite] blob + rowID Insert question

2014-08-28 Thread Igor Tandetnik
nt, bind the data to the parameter using sqlite3_bind_blob (which you have already discovered), then execute the statement. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Edinburgh Buses

2014-08-26 Thread Igor Tandetnik
!= StartOfR2.num -- R1 and R2 are not the same route AND EndOfR2.num = StartOfR2.num -- two stops on the same route AND EndOfR2.id = Finish.id -- R2 actually visits Finish ; I'm not quite sure what role stops.pos field plays. If it's somehow significant, working it int

Re: [sqlite] Edinburgh Buses

2014-08-25 Thread Igor Tandetnik
hat the end stop of one is the start stop of the other. I suggest you draw a picture, then write down all the conditions that need to be true to ensure that all the dots and lines connect to each other the right way. -- Igor Tandetnik ___ sqlite-users

Re: [sqlite] Handling Timezones

2014-07-29 Thread Igor Tandetnik
On 7/29/2014 8:23 PM, Will Fong wrote: I'm using SQLite as a backend to a small website and I have users in multiple timezones. When users login, their timezone is retrieved from the user table. Well, SQLite delegates to the C runtime for timezone handling. I suspect tzset() et al could be use

Re: [sqlite] Handling Timezones

2014-07-29 Thread Igor Tandetnik
' and 'utc' modifiers. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] SQL Join question

2014-07-28 Thread Igor Tandetnik
returned. Line 2 - the FROM clause - specifies where you want to get that data from. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] ISO time leap second.

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

Re: [sqlite] ISO time leap second.

2014-07-28 Thread Igor Tandetnik
On 7/28/2014 11:49 AM, Jan Nijtmans wrote: 2014-07-28 17:10 GMT+02:00 Igor Tandetnik : All your fix does is have the parser accept "60" as valid seconds field. That's not very interesting. Yes, that's exactly all that I'm after. ISO 8601 does not specify how

Re: [sqlite] ISO time leap second.

2014-07-28 Thread Igor Tandetnik
ttle benefit (if any at all; an argument could be made that leap seconds introduce more problems than they solve). -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Variable number of parameters in a prepared statement's IN clause

2014-07-20 Thread Igor Tandetnik
statement? The number of parameters is fixed at the time the statement is prepared. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Setting boundaries in a search

2014-07-15 Thread Igor Tandetnik
D 14, but is there another faster way? So you already know the answer. How exactly does it fail to satisfy your requirements? -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] trying to get things to work from the command line on windows 7 x64

2014-07-10 Thread Igor Tandetnik
On 7/10/2014 4:17 PM, Jonathan Leslie wrote: Now, when I run a.exe, it crashes with an "application was unable to start correctly (0xc07b)" error. sqlite3.dll must be in your PATH, or else in the same directory with the EXE. -- Igor

Re: [sqlite] Query help

2014-07-08 Thread Igor Tandetnik
associated names from t2 and t3 select recno, t2.name, t3.name from t1 join t2 using (a) join t3 using (b); -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Sqlite in dead lock state when deleting records from the same table from different threads

2014-07-02 Thread Igor Tandetnik
On 7/2/2014 2:06 PM, Clemens Ladisch wrote: Igor Tandetnik wrote: On 7/2/2014 3:04 AM, Clemens Ladisch wrote: If all else fails, one could try and simulate BEGIN IMMEDIATE by running a dummy modifying statement right after BEGIN - e.g. delete from table1 where 0; Would this be atomic? It

Re: [sqlite] Sqlite in dead lock state when deleting records from the same table from different threads

2014-07-02 Thread Igor Tandetnik
is to make the first statement a writer, so the transaction acquires write locks from the start. However, I have no reason to believe, other than your word, that BEGIN IMMEDIATE would not just work in this case. What makes you think it wouldn't? -- Igor

Re: [sqlite] Sqlite in dead lock state when deleting records from the same table from different threads

2014-07-01 Thread Igor Tandetnik
On 7/1/2014 5:20 PM, Igor Tandetnik wrote: On 7/1/2014 4:55 PM, Clemens Ladisch wrote: To prevent deadlocks, transactions that will modify the database should be started with BEGIN IMMEDIATE. (This kind of lock is not available in shared cache mode.) Are you sure? Nothing in the

Re: [sqlite] Sqlite in dead lock state when deleting records from the same table from different threads

2014-07-01 Thread Igor Tandetnik
I haven't tried it myself. If all else fails, one could try and simulate BEGIN IMMEDIATE by running a dummy modifying statement right after BEGIN - e.g. delete from table1 where 0; -- Igor Tandetnik ___ sqlite-users mailing list sqlite-

Re: [sqlite] Sqlite in dead lock state when deleting records from the same table from different threads

2014-07-01 Thread Igor Tandetnik
cult to believe. All other things equal, the same problem should manifest if DELETE statement is replaced with INSERT or UPDATE. There must be something else different about the scenarios where those operations work. -- Igor Tandetnik ___ sqlite-use

Re: [sqlite] Data visibility problem

2014-06-25 Thread Igor Tandetnik
same underlying "real" connection. The transaction on the "real" connection starts when the number of "pseudo" transactions on "pseudo" connections goes from 0 up to 1, and ends when that number goes from 1 down to 0. -- Igor Tandetnik __

Re: [sqlite] Data visibility problem

2014-06-25 Thread Igor Tandetnik
hen there's documentation on WAL mode, explaining how it is possible for a writer to co-exist with readers, via page versioning. http://www.sqlite.org/wal.html If you use both features, you kind of have to put two and two together to see how they woul

Re: [sqlite] Adding WHERE to query --> database disk image is malformed

2014-06-24 Thread Igor Tandetnik
/optoverview.html To be usable by an index a term must be of one of the following forms: ... Adding a unary + changes the term so it's no longer one of those forms. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlit

Re: [sqlite] Adding WHERE to query --> database disk image is malformed

2014-06-23 Thread Igor Tandetnik
ns to affect the area of the file where this index is stored. Try this query: SELECT * FROM itemTable WHERE +key = 'profileName' ; Note the + sign - this suppresses the use of index. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@

Re: [sqlite] Data visibility problem

2014-06-23 Thread Igor Tandetnik
rom each other as independent private connections (it's even possible to enable read-uncommitted mode, whereby one such connection can see not-yet-committed changes made by another). As any other option, shared cache brings some benefits and some limitations (if it were all

Re: [sqlite] Data visibility problem

2014-06-22 Thread Igor Tandetnik
reading at time T+2 - that becomes part of the same transaction. A may stop reading (e.g. reset its statement) at time T+3 - but B still reads the data as it existed at time T, and cannot observe any changes made at T+1. -- Igor Tandetnik ___ sql

Re: [sqlite] another challenging query

2014-06-19 Thread Igor Tandetnik
elect t2.soID from MyTable t2 where t2.plID = 851090 ); -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] problem sorting data

2014-06-18 Thread Igor Tandetnik
alues do you expect to be selected, and which one do you expect to be used to order the group? -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] lifetime of buffer referred to with SQLITE_STATIC

2014-06-13 Thread Igor Tandetnik
ossible to call sqlite3_step anymore on the finalized statement. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] PRAGMA table_info(second.table)

2014-06-05 Thread Igor Tandetnik
On 6/5/2014 2:19 AM, LacaK wrote: Then when I try PRAGMA table_info(test.tab1) , I get error: near ".": syntax error. The correct syntax is PRAGMA test.table_info(tab1) ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cg

Re: [sqlite] Help with SELECTing CASE problem

2014-05-30 Thread Igor Tandetnik
with min to select one that sorts first instead). -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Help with SELECTing CASE problem

2014-05-30 Thread Igor Tandetnik
On 5/30/2014 1:29 PM, jose isaias cabrera wrote: "Igor Tandetnik" wrote... On 5/30/2014 12:41 PM, jose isaias cabrera wrote: What should be returned is the value of vEmail of the first record that has Xtra4='y' What do you mean by "first record"? Records are pr

Re: [sqlite] Help with SELECTing CASE problem

2014-05-30 Thread Igor Tandetnik
ith the smallest ProjID among those where Xtra4='y'; if there's no such row, it produces 'noemail'. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Help with SELECTing CASE problem

2014-05-30 Thread Igor Tandetnik
On 5/30/2014 12:41 PM, jose isaias cabrera wrote: What should be returned is the value of vEmail of the first record that has Xtra4='y' What do you mean by "first record"? Records are processed in no particular order. -- Igor Tandetnik __

Re: [sqlite] Joining different databases

2014-05-29 Thread Igor Tandetnik
it myself). But you still need some SQL engine - such as MS Access - that can run queries against multiple ODBC sources. SQLite itself can't do that. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Joining different databases

2014-05-29 Thread Igor Tandetnik
On 5/29/2014 10:26 AM, David Bicking wrote: I have a somewhat large table in an sqlite database and another large table on an MS SQL Server database (on a slow network). I want to query both tables in a join. How complicated is the join? Could you show a hypothetical SQL statement you would

Re: [sqlite] Dynamic SELECT result column names

2014-05-26 Thread Igor Tandetnik
epared and the execution plan is determined. You are effectively doing " select 'A1' from TAB1; " which of course is very different from " select A1 from TAB1; " -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqli

Re: [sqlite] Is sqlite case-sensitive?

2014-05-18 Thread Igor Tandetnik
PI to validate a SQL statement, either in the context of the current connection (validate also table/column/db names), or without context (just validate syntax, e.g. that it can be parsed)? sqlite3_prepare (and its variations) for the former. -- Igor Tand

Re: [sqlite] how to write this commands?

2014-05-16 Thread Igor Tandetnik
#x27;t matter which, they all work the same when there's only one row to aggregate. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] how to write this commands?

2014-05-15 Thread Igor Tandetnik
from adl where adla1.ref=adl.ref); This says: for each row in adla1, if adl has exactly one row with the same ref value, then set adla1.pflopf to adl.pflopf taken from that one matching row. Otherwise, leave adla1 row unchanged. -- Igor Tandetnik

Re: [sqlite] transaction in one thread and other thread also trying to write data

2014-05-13 Thread Igor Tandetnik
On 5/13/2014 9:12 AM, d b wrote: My application is multithreaded. It maintains only connection per application. Database accessed by single process only. ThreadA will do database write operations(bulk) in a transaction. ThreadB will do single write operation without transaction but same conne

Re: [sqlite] Very slow when query max(col) on empty set?

2014-05-08 Thread Igor Tandetnik
ldn't help with such a query at all; it would require a full table scan. Do you have another index for this table, on (b) or (c) or (b, c) or (c, b)? -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-

Re: [sqlite] Storing amount?

2014-05-08 Thread Igor Tandetnik
qlite> insert into t(x) values ('5'); sqlite> select * from t; 5.0 The problem lies elsewhere, outside of SQLite. Check the part of your program that takes a value from the textbox and passes it along to the SQL statement - you are losing a character somewhere alon

Re: [sqlite] rowid question

2014-05-08 Thread Igor Tandetnik
out having an index (storage space) ? rowid doesn't require a separate index. In a sense, the table itself is its own index - it's stored as a b-tree with rowid as the key. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-u

Re: [sqlite] duplicate row in sqlite3 database

2014-05-08 Thread Igor Tandetnik
esult in an error. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] WITHOUT ROWID option

2014-05-07 Thread Igor Tandetnik
On 5/7/2014 9:40 AM, RSmith wrote: SELECT instr(upper(sql),'WITHOUT ROWID')>1 FROM sqlite_master WHERE type='table' AND tbl_name='YourTableName' Returns 1 for tables made without rowid, 0 for the rest. CREATE TABLE t(x text default &#x

Re: [sqlite] Very slow when query max(col) on empty set?

2014-05-06 Thread Igor Tandetnik
o equality checks. In the first case, no such record exists, so every single record ends up being looked at. In the second case, apparently a matching record is found early enough. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] Question about checking table requirements on INSERT into a table

2014-04-24 Thread Igor Tandetnik
or details, see http://www.sqlite.org/datatype3.html . If you want strict typing, you can request it with a CHECK constraint: CREATE TABLE bar2(foo INTEGER CHECK (typeof(foo)='integer') ); -- Igor Tandetnik ___ sqlite-users mailing list sql

Re: [sqlite] Trigger cascade/nesting

2014-04-23 Thread Igor Tandetnik
ble to use that same mechanism to make her own change that isn't logged. You could have a default, and a BEFORE INSERT trigger that errors out if the timestamp is wrong. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org ht

Re: [sqlite] Trigger cascade/nesting

2014-04-23 Thread Igor Tandetnik
, e.g. DEFAULT CURRENT_TIMESTAMP or DEFAULT (strftime('%Y-%m-%d %H:%M:%f','now', 'localtime')) -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] about merge rows

2014-04-17 Thread Igor Tandetnik
On 4/17/2014 9:26 PM, YAN HONG YE wrote: I want to merge all the mnote, how to do this? What do you mean "merge"? What should the table look like afterward? -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://

Re: [sqlite] field length retreval

2014-04-17 Thread Igor Tandetnik
(complete with sqlite3_column_name[16]). -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] sqlite dump makes wrong "CREATE VIEW" order

2014-04-17 Thread Igor Tandetnik
;d say it's the user's responsibility to not drop a view that is being referred to elsewhere. If there's a bug anywhere in this, I'd say it's the fact that SQLite allowed "DROP VIEW v2" statement to proceed. -- Igor Tandetnik __

Re: [sqlite] Lock before beginning SELECT statement

2014-04-16 Thread Igor Tandetnik
explicitly. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

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