Re: [sqlite] programmatic way of determining fragmentation?

2010-10-21 Thread Pavel Ivanov
       Select * from a table took just slightly under three hours.        Select * from a reconstructed table (insert into select from) in a new database took 57 seconds. I think it's not related to fragmentation, but to fill percentage of b-tree pages. I guess your reconstructed table is

Re: [sqlite] Collations, BLOB and index - strange output provided by EXPLAIN QUERY PLAN

2010-10-20 Thread Pavel Ivanov
It seems legitimate to use the idx_foobar because it is already sorted.. no? Yes, it is sorted. So for example you have 2 values and you need to put them in order. You know that these values exist somewhere in the index in exact order you need. How would you find the order? You'll need to scan

Re: [sqlite] Collations, BLOB and index - strange output provided by EXPLAIN QUERY PLAN

2010-10-20 Thread Pavel Ivanov
search of a value in the middle of the index. Pavel On Wed, Oct 20, 2010 at 11:10 AM, Mathieu Schroeter schroe...@epsitec.ch wrote: Le 20.10.2010 16:44, Pavel Ivanov a écrit : It seems legitimate to use the idx_foobar because it is already sorted.. no? Yes, it is sorted. So for example you

Re: [sqlite] Insert or Update (was: ON DELETE CASCADE along with ON CONFLICT REPLACE)

2010-10-19 Thread Pavel Ivanov
2. I suggest that you're better off doing the logic entirely in SQL, rather than application code, for the sake of portability, data integrity and speed. I'd say this is a very bad advice for the developer using SQLite. First of all insert or ignore and insert or replace are not portable SQL

Re: [sqlite] Scaling of Cache

2010-10-18 Thread Pavel Ivanov
In pcache1Fetch, sqlite mutexes around the cache handling, which appears to be causing significant waits/scalability issues in my application.  If I disable this mutex, the application crashes. Why do you think that this mutex causes significant waits? Anyway ... Is it possible to cache on

Re: [sqlite] Scaling of Cache

2010-10-18 Thread Pavel Ivanov
that there is zero waiting. -Jeff -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Pavel Ivanov Sent: Monday, October 18, 2010 12:03 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] Scaling of Cache

Re: [sqlite] How to optimize a multi-condition query

2010-10-15 Thread Pavel Ivanov
sqlite create table c(achr char,bchr char); sqlite create index c_chr on c(achr,bchr); sqlite explain query plan select achr,bchr from c where achr=bchr; 0|0|TABLE c Why no use of the index in this case? How do you think it should be used here? It's not that rows with the same values of

Re: [sqlite] Multiple prepared statements

2010-10-15 Thread Pavel Ivanov
Now I decide that I want a second type of insert, so I try to use a prepared statement for that as well. However it always fails. As long as the other prepared statement is hanging round I can't prepare a new one. Does this seem right or am I really soing something wrong? You are doing

Re: [sqlite] EXTERNAL:Re: How to optimize a multi-condition query

2010-10-15 Thread Pavel Ivanov
on behalf of Pavel Ivanov Sent: Fri 10/15/2010 8:27 AM To: General Discussion of SQLite Database Subject: EXTERNAL:Re: [sqlite] How to optimize a multi-condition query sqlite create table c(achr char,bchr char); sqlite create index c_chr on c(achr,bchr); sqlite explain query plan select

Re: [sqlite] Duplicate results for a given primary key/row

2010-10-15 Thread Pavel Ivanov
This is most probably a corruption where index have some rowids not present in table. If nothing else is corrupted you can just drop the index and recreate it again. Pavel On Fri, Oct 15, 2010 at 1:43 PM, Jeff Flanigan jflani...@zimbra.com wrote: Cool, that definitely tells me the db is

Re: [sqlite] multiple foreign key

2010-10-13 Thread Pavel Ivanov
Is this legal to have a foreign key that references several tables? Why not? I'd say it's a very bad database design (or extremely rare and questionable reason to do that) but there's nothing wrong in it from SQL point of view. Pavel On Wed, Oct 13, 2010 at 6:55 AM, TP

Re: [sqlite] Speed up DELETE of a lot of records

2010-10-12 Thread Pavel Ivanov
Michele, Here is another thought for you to consider. Apparently your application consistently generates some records, each record is marked with a timestamp of its creation and after some time you have to garbage-collect all records that are at least at a certain amount of time in the past. You

Re: [sqlite] Trigger Variables

2010-10-07 Thread Pavel Ivanov
I'm porting an Interbase DB to SQLIte and wondered if there is any way to store temporary values within a trigger? No. You should use (temporary) tables created outside the trigger for that. Or you can move the trigger logic into your application. Pavel On Thu, Oct 7, 2010 at 4:26 AM,

Re: [sqlite] Speed up DELETE of a lot of records

2010-10-07 Thread Pavel Ivanov
But the rows he wants to delete are those with DateTimecutoffdate.  So without an index on that column SQL can't find which rows to delete quickly ! Quickly is appropriate for one row. For several rows SQLite will sequentially scan the index and for each rowid found there it will traverse the

Re: [sqlite] Reading committed / uncommitted records

2010-10-06 Thread Pavel Ivanov
2. In between with another statement handle if I update the table, here I am updating the record which is just fetches by my cursor mentioned in step 1. You shouldn't do that. It's a bad idea in general and it leads to undefined results in SQLite specifically. - Ultimately, its fetching

Re: [sqlite] Bug? LIMIT in compound statement with UNION ALL seems to affect only the first SELECT statement if it has ORDER BY

2010-10-06 Thread Pavel Ivanov
I can't say anything about your particular issue with the LIMIT clause, maybe that's a bug. But Another solution is to use UNION instead of UNION ALL. But I can't use that, because UNION does not respect ORDER BY in sub-statements (not sure if it's a correct behavior). Do you know that SELECT

Re: [sqlite] appropriate Uses For SQLite

2010-09-30 Thread Pavel Ivanov
There's no contradiction in those citations. First talks about website with some 100K hits/day. Website means application running on some dedicated server, clients send HTTP requests to your application and application processes it working with locally stored database. Second citation is talking

Re: [sqlite] Help: Required help/guidance for the segmentation fault in sqlite3 library to proceed further...

2010-09-24 Thread Pavel Ivanov
Apparently you are calling sqlite3_free twice on the same statement pointer. Try to add assigning to NULL after freeing and checking for NULL before freeing. Pavel On Thu, Sep 23, 2010 at 10:57 AM, Borra, Kishore Babu kishorebabu.bo...@adc.com wrote: Hi, I require some help in getting the

Re: [sqlite] SQLite GUID in WHERE Clause

2010-09-23 Thread Pavel Ivanov
I know the literal GUID value shown is correct, as I copied it directly from the results pane when I do a SELECT * FROM UserRole, however, as soon as I add the WHERE clause, I get no results. Execute 'SELECT UserId, typeof(UserId) FROM UserRole' preferably from sqlite command line utility

Re: [sqlite] Performance problems and large memory size

2010-09-22 Thread Pavel Ivanov
sqlite can reach in a request? Il 21/09/2010 19.31, Pavel Ivanov ha scritto: Is Sqlite somewhere caching data? If so, how do I disable it or decrease the amount of cached data? http://www.sqlite.org/pragma.html#pragma_cache_size Pavel On Tue, Sep 21, 2010 at 1:24 PM, Richard Wähneltdeslo

Re: [sqlite] Strange cache behavior

2010-09-22 Thread Pavel Ivanov
Is it ok for cache to behave like this or some optimization is possible to fix this? For this particular case I believe you can do some optimization by making your own implementation of cache. Also I believe such strange behavior of cache is pretty much explainable. Remember that standard

Re: [sqlite] Strange cache behavior

2010-09-22 Thread Pavel Ivanov
at 7:12 PM, Pavel Ivanov paiva...@gmail.com wrote: Is it ok for cache to behave like this or some optimization is possible to fix this? For this particular case I believe you can do some optimization by making your own implementation of cache. Also I believe such strange behavior of cache

Re: [sqlite] Performance problems and large memory size

2010-09-21 Thread Pavel Ivanov
Is Sqlite somewhere caching data? If so, how do I disable it or decrease the amount of cached data? http://www.sqlite.org/pragma.html#pragma_cache_size Pavel On Tue, Sep 21, 2010 at 1:24 PM, Richard Wähnelt deslo...@web.de wrote: Hello there, I hope, someone can help me with the problem

Re: [sqlite] Syntax for Counting Rows By Multiple Groups

2010-09-21 Thread Pavel Ivanov
       sqlite select sic, sic_desc, state, count(*) from Companies group by sic; The 'group by' phrase returns one row per group, which is what I want as long as the group is a compound of industry number and state (the description makes it easier to read and is fixed in association with

Re: [sqlite] what could be the reason that natural join stops working ?

2010-09-14 Thread Pavel Ivanov
Did you by any chance introduced some unique constraint or unique index on a set of columns one of which is primary key? AFAIK, there was a problem in SQLite until some recent versions in processing of redundant unique constraints in conjunction with natural joins. But the best idea would be to

Re: [sqlite] sqlite3_bind_*() routines does not work in this case.

2010-09-08 Thread Pavel Ivanov
I intended to use sqlite3_bind_int() to bind the maximal number of employees a department can contain to the template. The C program works without error. However, the trigger does not work when I insert into the employees table. I used the latest sqlite-3.7.2. Is this a bug of SQLite? Or did

Re: [sqlite] Detecting storage class from C

2010-09-02 Thread Pavel Ivanov
My reason for doing this is, if a field is null, I still need to know what class it 'should' have been if it had been storing a value. Why do you need that? No matter what you declare field can store any type of data. And in SQLite there's no declared storage class. You are talking either about

Re: [sqlite] Trigger Questions

2010-09-02 Thread Pavel Ivanov
The correct syntax is UPDATE sites SET createTime = DATETIME('NOW'), updateTime = DATETIME('NOW')          WHERE rowid = new.rowid; So I wonder if you made a typo and actually only createTime were updated when updateTime remained unchanged. Pavel On Thu, Sep 2, 2010 at 3:11 PM, Michael Graßl

Re: [sqlite] SQLITE_NO_SYNC, PRAGMA synchronous or asynchronous io module?

2010-09-01 Thread Pavel Ivanov
I have set up a test program without QtSql and could not reproduce any of the performance degradations. So the problem has nothing to do with sqlite. Sorry for the noise. I guess Qt either ignores some of your pragmas, or resets their values to what it thinks is better. Also I'm afraid it

Re: [sqlite] upstreaming Chromium patches for file handle passing support

2010-08-31 Thread Pavel Ivanov
And we can't have the entire implementation on the WebKit/Chrome side either, because then we can't compile against vanilla SQLite (and Linux distributions don't like it). Could you explain in detail where this can't comes from and what's the problem with Richard's suggestion to copy necessary

Re: [sqlite] SQLITE_NO_SYNC, PRAGMA synchronous or asynchronous io module?

2010-08-31 Thread Pavel Ivanov
Is this intended behaviour? How does the pragma/async io module fit in, then? I believe you've got something wrong in your tests. Because with asynchronous module (if you indeed used its VFS when created your connections) no actual disk I/O happens in the same thread as insert command. With

Re: [sqlite] Parameters in views preparation

2010-08-26 Thread Pavel Ivanov
In my code, I delete the view before attempting to recreate it by executing the prepared statement.  Isn't that the time to validate whether there are semantic problems with the statement? Yes, validation happens only at the time of execution. So you are apparently doing something wrong and

Re: [sqlite] Parameters in views preparation

2010-08-26 Thread Pavel Ivanov
I'm sorry to ask this, but can you check for us whether a VIEW by that name really does exist ?  Don't forget, VIEWs get saved in the file, they're not part of the attachment. Yes it does So you are trying to create a VIEW which does already exist.  In that case, there's no mystery

Re: [sqlite] Why the deadlock?

2010-08-25 Thread Pavel Ivanov
Nikolaus, I've traced your application a bit (with SQLite 3.6.18 sources) and it looks like SQLite does some nasty thing nobody in this thread expected. For some reason while doing first delete SQLite actually commits transaction and degrades lock to SHARED. Then of course second delete cannot

Re: [sqlite] Why the deadlock?

2010-08-25 Thread Pavel Ivanov
wrote: On Aug 25, 2010, at 10:40 PM, Pavel Ivanov wrote: Nikolaus, I've traced your application a bit (with SQLite 3.6.18 sources)  and it looks like SQLite does some nasty thing nobody in this thread expected. For some reason while doing first delete SQLite actually commits transaction

Re: [sqlite] rowid column as a FOREIGN KEY

2010-08-23 Thread Pavel Ivanov
Make it your rule of thumb: don't ever use rowid, declare your own column as integer primary key and use it. It will come at no cost for you and everything else will work much better. Here is simplified example of your problem and solution: sqlite pragma foreign_keys=on; sqlite create table t (n

Re: [sqlite] rowid column as a FOREIGN KEY

2010-08-23 Thread Pavel Ivanov
I can't understand why is it a bad practice to use database-provided features? You can use it when you are selecting. And even in this case you should use caution because without explicit column declared by you SQLite can change rowids without notice. And for foreign keys it's mandatory to

Re: [sqlite] Why the deadlock?

2010-08-19 Thread Pavel Ivanov
I don't know what you mean by 'cursor'.  SQLite has commands.  You execute one command at a time.  Even a command like a SELECT that gathers lots of data gathers the data all in one go, then finishes.  SQLite does not mark its place with one command, then return to that place again with

Re: [sqlite] multiple conections for the same database

2010-08-18 Thread Pavel Ivanov
SQLite allows multiple readers, or exactly one wrier, accessing the database at the same time. You can't read and write simultaneously, you must arrange for your connections to take turns. SQLITE_BUSY error is a signal for you to back off, wait a little, then try again. See also

Re: [sqlite] multiple conections for the same database

2010-08-18 Thread Pavel Ivanov
/new data from the other thread? Michael D. Black Senior Scientist Advanced Analytics Directorate Northrop Grumman Information Systems From: sqlite-users-boun...@sqlite.org on behalf of Pavel Ivanov Sent: Wed 8/18/2010 9:15 AM To: General Discussion

Re: [sqlite] multiple conections for the same database

2010-08-18 Thread Pavel Ivanov
? Michael D. Black Senior Scientist Advanced Analytics Directorate Northrop Grumman Information Systems From: sqlite-users-boun...@sqlite.org on behalf of Pavel Ivanov Sent: Wed 8/18/2010 9:57 AM To: General Discussion of SQLite Database Subject

Re: [sqlite] Question concerning foreign keys across databases

2010-08-18 Thread Pavel Ivanov
Summary: how can I use foreign keys across database boundaries? Is it at all possible? No. It's logically incorrect action, so it's impossible. If you want consistency of your tables to be automatically checked by database engine you need to allow that engine to see those tables at all times.

Re: [sqlite] Question concerning foreign keys across databases

2010-08-18 Thread Pavel Ivanov
oli...@f-prot.com wrote: Hello Pavel, thanks for your reply. On 2010-08-18 20:39, Pavel Ivanov wrote: Summary: how can I use foreign keys across database boundaries? Is it at all possible? No. It's logically incorrect action, so it's impossible. If you want consistency of your tables

Re: [sqlite] Is there a way to inner join on named intervals?

2010-08-13 Thread Pavel Ivanov
I don't understand where do you see a problem but it looks like this join will do what you want: select * from A, B where A.name = B.name and A.left B.right and A.right B.left I could use an external program (such as python sqlite package) to enumerate all the named interval from table A and

Re: [sqlite] Is there a way to inner join on named intervals?

2010-08-13 Thread Pavel Ivanov
just (name). But cases when those indices would help are very specific, so in general your only option is index on name only. Pavel On Fri, Aug 13, 2010 at 12:48 PM, Peng Yu pengyu...@gmail.com wrote: On Fri, Aug 13, 2010 at 11:32 AM, Pavel Ivanov paiva...@gmail.com wrote: I don't understand

Re: [sqlite] Reserve database pages

2010-08-12 Thread Pavel Ivanov
I can approximately calculate, how big the new database will grow. Is there a way to tell SQLite to reserve an inital space or numer of pages instead of letting the database file grow again and again? I'm looking for a way to speed up the import. Why do you think that this kind of function

Re: [sqlite] Reserve database pages

2010-08-12 Thread Pavel Ivanov
out of pages. --Original Message-- From: Pavel Ivanov Sender: sqlite-users-boun...@sqlite.org To: General Discussion of SQLite Database ReplyTo: General Discussion of SQLite Database Subject: Re: [sqlite] Reserve database pages Sent: Aug 12, 2010 06:20 I can approximately calculate

Re: [sqlite] Reserve database pages

2010-08-12 Thread Pavel Ivanov
The same with STL vectors: initializing it with a size is faster than growing it element by element. That's pretty bad comparison. Initializing of vector with size is faster because it doesn't have to copy all elements later when it reallocates its memory. File system doesn't work that way, it

Re: [sqlite] Write-ahead logging and database locking

2010-08-11 Thread Pavel Ivanov
Also, I see in the documentation that when shared-cache mode is enabled, SQLite uses table-level locking (instead of the default file-locking). Taken all together, it suggests that you can get table-level locking *and* write-ahead logging *and* atomic multi-table commits -- all within a

Re: [sqlite] commit transaction/savepoints on program crash

2010-08-09 Thread Pavel Ivanov
Is there any way to have them committed by default? Basically I *only* want the transaction rolled back in case of an explicit rollback statement, not due to program crash/power failure, etc. Does anyone know of a way of doing this? You can avoid transaction begin/commit statements, so that

Re: [sqlite] count distinct group by

2010-07-28 Thread Pavel Ivanov
I'm not sure what do you want to return for the case like this: s1r1 r2 t1 s1r1 r2 t2 s1r1 r3 t2 But for your initial request the following query will be good: select t1.* from table_name t1, (select s, count(*) cnt

Re: [sqlite] using sqlitejdbc-v056 with ant build file

2010-07-26 Thread Pavel Ivanov
I'd still like to know what I can pass to the jdbc driver to make it know I don't expect a recordset.  I haven't found any information on this.  Since According to documentation on Ant's sql task you don't have to show it explicitly whether you expect recordset to be returned or not. So

Re: [sqlite] using sqlitejdbc-v056 with ant build file

2010-07-26 Thread Pavel Ivanov
- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Pavel Ivanov Sent: Monday, July 26, 2010 12:00 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] using sqlitejdbc-v056 with ant build file I'd still like to know what I can pass

Re: [sqlite] using sqlitejdbc-v056 with ant build file

2010-07-26 Thread Pavel Ivanov
is? Kyle Kimberley Software Engineer 919-474-6041 -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Pavel Ivanov Sent: Monday, July 26, 2010 12:38 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] using

Re: [sqlite] Re ferring to subselect multiple times

2010-07-23 Thread Pavel Ivanov
Is there a way? a) Temporary table b) Do it in your application instead of SQL - that's pretty easy. Pavel On Fri, Jul 23, 2010 at 5:17 AM, westmeadboy m...@carter.name wrote: I have a complex query which returns multiple rows of a single TEXT column. I want to filter this so that only

Re: [sqlite] UPDATEing a SELECTion in one shot

2010-07-21 Thread Pavel Ivanov
If the following can be considered as one step then do it like this: BEGIN;      UPDATE LSOpenSubProjects SET price = (SELECT sum(price) FROM table1 WHERE subProjID = 24),       udate = now WHERE subProjID = 24;      UPDATE LSOpenProjects SET price = (SELECT sum(price) FROM

Re: [sqlite] C++ struct declarations

2010-07-20 Thread Pavel Ivanov
Is there a working (with C++) sqlite3.h equivalent available somewhere, or do I need to hack on it? A lot of people on this list including me use sqlite3.h in their C++ applications and don't see any problems compiling that as is. So you should look at how you use that header and/or how you

Re: [sqlite] bug report: data race in multi-threaded execution ofsqlite3

2010-07-20 Thread Pavel Ivanov
BTW, I found that the huge number of data race warnings can easily be removed. The found races are benign--it just assign same static mutex id whenever pthreadMutexAlloc() is called. by not assigning the mutex id once it is initialized -- as in MAKE_DRD_HAPPY --, most of race warnings are

Re: [sqlite] suggestion: bitwise shift right optimization

2010-07-20 Thread Pavel Ivanov
Are there reasons not to implement optimization in the first case? Except for this is not most requested one :) I guess because this case is highly specific and it's behavior should depend on particular constants used. Put there for example Id 54 = 1000 and now we should make optimizer guess

Re: [sqlite] Unable to Open DB on Win-7 Vista (64 bitt) on UAC -ON

2010-07-20 Thread Pavel Ivanov
If your end user controls where to put the database file then after receiving error Unable to open database you should tell him to change permissions on that file to be accessible to everybody. Don't forget to tell him to change permissions on the directory where database resides too. Pavel On

Re: [sqlite] VFS Layer for to split database into several files?

2010-07-19 Thread Pavel Ivanov
I'm stuck with an environment with a 2GB file size limit. What the exact problem do you see and how do you compile SQLite? All modern compilers have macros _LARGEFILE_SOURCE or _FILE_OFFSET_BITS=64 defined by default and with that SQLite works perfectly with any files with more than 2GB in size.

Re: [sqlite] 3.7.0 foreign_keys and recursive_triggers default status

2010-07-17 Thread Pavel Ivanov
Looks like the answer to your question is negative: http://www.sqlite.org/draft/pragma.html#pragma_foreign_keys http://www.sqlite.org/draft/pragma.html#pragma_recursive_triggers Pavel On Sat, Jul 17, 2010 at 7:27 PM, Ben Danper seb...@live.com wrote: As of 3.6.23.1 the pragmas foreign_keys

Re: [sqlite] WAL: no longer able to use read-only databases?

2010-07-15 Thread Pavel Ivanov
I don't think so.  Just like the older SQLite journal system, it's important that the WAL files survive through a crash. I believe WAL file is not a problem here (despite some confusing macro name that Matthew proposed). The problem is SHM file which don't have to survive - SQLite rebuilds it

Re: [sqlite] Sqlite Insert Speed Optimization

2010-07-13 Thread Pavel Ivanov
After these 500 i take a few seconds to read more data so sqlite should have time to do any housekeeping it might need. SQLite is not a Database Server. It has no background threads. So it can't do any housekeeping until you call some sqlite3_* function. Pavel On Tue, Jul 13, 2010 at 12:33

Re: [sqlite] LIKE with BLOB

2010-07-08 Thread Pavel Ivanov
If it is possible, how would I define a prepared statement so that I can just bind the (10 byte) value into it? Is it possible to pre-process your 10 bytes and insert e.g. symbol '\' before any '\', '_' and '%' symbol? After that you can query SELECT * FROM mytable WHERE myblob LIKE ? ESCAPE

Re: [sqlite] How to determine when to VACUUM?

2010-07-07 Thread Pavel Ivanov
(I guess it well might not on an SSD disk, but on a conventional rotational disk, pager could read several pages ahead with one seek - but does it?) You mean that pager should read several pages at once even if it doesn't need them right now but it estimates that it will need them in near

Re: [sqlite] sqlite3_step returns sqlite_busy

2010-07-07 Thread Pavel Ivanov
one thread is preparing an INSERT statement (It returns SQLITE_OK), then it is executed using sqlite3_step. sqlite3_step returns an SQLITE_BUSY! Is there any possibility for this? Sure. Preparing INSERT statement doesn't acquire any write locks on the database. It's executing the INSERT

Re: [sqlite] EXTERNAL: sqlite3_step returns sqlite_busy

2010-07-07 Thread Pavel Ivanov
You men to handle the BUSY by waiting for some time and trying to execute sqlite3_step? You can call sqlite3_busy_timeout() with appropriate value after opening a connection and SQLite will do this waiting for you. Just remember that explicit transaction that began as read-only and then

Re: [sqlite] sqlite3_step returns sqlite_busy

2010-07-07 Thread Pavel Ivanov
So it means we can have mor than one valid db handle? Yes. Pavel On Wed, Jul 7, 2010 at 9:29 AM, Lloyd ll...@cdactvm.in wrote: So it means we can have mor than one valid db handle? Thanks,  Lloyd - Original Message - From: Pavel Ivanov paiva...@gmail.com To: General Discussion

Re: [sqlite] SqLite 3.7.0 amalgamation build warnings

2010-07-07 Thread Pavel Ivanov
The build warning is my main concern: warning BK4504 : file contains too many references; ignoring further references from this source Looks like this warning can be safely ignored and internet even has quite a few suggestions on its suppression. Here's what I found:

Re: [sqlite] use database in sqlite3?

2010-07-06 Thread Pavel Ivanov
Is there a command similar to 'use database' (mysql) in sqlite3 so that I can make a particular database as default? (I don't find such command, but please let me know in case if I miss anything.) Yes. It is sqlite3_open() in C API. And if you use command line utility then you should pass the

Re: [sqlite] Numbers as CHARs.

2010-07-06 Thread Pavel Ivanov
The receiving field is defined as CHAR; [snip] SQLite has no such type.  Define the fields as TEXT instead: Simon, please don't confuse poor users. SQLite will work perfectly and indistinguishably well with both CHAR and TEXT. Please read the link you gave more carefully (hint: bullet number 2

Re: [sqlite] EXTERNAL: setup sqlite in vc++

2010-07-06 Thread Pavel Ivanov
I found out that including the header file alone is not enough. I need to link the sqlite lib to my project. But how can can I get the lib? Just include sqlite3.c file into your project as a source and that's it, VC++ will take care of compiling it and linking it into your binary. Pavel On

Re: [sqlite] Numbers as CHARs.

2010-07-06 Thread Pavel Ivanov
intended functionality. With that in mind CHAR and TEXT are both right, as well as VARCHAR or VARCHAR(256). Everyone can use what he is used to. Pavel On Tue, Jul 6, 2010 at 10:09 PM, P Kishor punk.k...@gmail.com wrote: On Tue, Jul 6, 2010 at 8:45 PM, Pavel Ivanov paiva...@gmail.com wrote

Re: [sqlite] What is collate nocase for when used with create index?

2010-07-04 Thread Pavel Ivanov
If you want the equality operator to be case-insensitive then your column in the table should be declared collate nocase. And it doesn't matter whether you have index or not for this to work (execution speed can differ though). But if you don't want that but want like operator (which is

Re: [sqlite] What is collate nocase for when used with create index?

2010-07-04 Thread Pavel Ivanov
, Pavel Ivanov paiva...@gmail.com wrote: If you want the equality operator to be case-insensitive then your column in the table should be declared collate nocase. And it doesn't matter whether you have index or not for this to work (execution speed can differ though). But if you don't want

Re: [sqlite] How to select an entry that appears =n times and only show n times if it appears more than n times?

2010-07-02 Thread Pavel Ivanov
But this doesn't show anything that count more than n times. I want the type_id shows up more than n times in the database only appear n times in the result of the query. That's some exotic requirements you've got there. Is it possible to elaborate them? Probably your best solution is not in

Re: [sqlite] How to supply no values when inserting a record?

2010-07-02 Thread Pavel Ivanov
I tried the following two commands. Neither of them work. Would you please let me know what is the command to insert a record with the default value? Try this: insert into test default values; Pavel On Fri, Jul 2, 2010 at 9:40 PM, Peng Yu pengyu...@gmail.com wrote: Hi, create table test

Re: [sqlite] create table {table-name} as select.... table definition is imperfectly cloned

2010-07-01 Thread Pavel Ivanov
No, I am not asking SQLite to emulate an error in Adobe's code. Rather I am suggesting this: if SQLite is going to distinguish in any way between INT and INTEGER on primary key definitions, the CREATE TABLE X as SELECT... syntax ought not to produce a table with an INT primary key if the

Re: [sqlite] create table {table-name} as select.... table definition is imperfectly cloned

2010-07-01 Thread Pavel Ivanov
1, 2010 at 9:39 AM, Simon Slavin slav...@bigfraud.org wrote: On 1 Jul 2010, at 2:21pm, Pavel Ivanov wrote:  CREATE TABLE X as SELECT... syntax ought not to produce a table with an INT primary key if the prototype had INTEGER. The problem is not with primary keys, it's with the types

Re: [sqlite] create table {table-name} as select.... table definition is imperfectly cloned

2010-07-01 Thread Pavel Ivanov
at 10:44 AM, Simon Slavin slav...@bigfraud.org wrote: On 1 Jul 2010, at 2:49pm, Pavel Ivanov wrote: This is obviously wrong.  The SELECT command from TABLE t could never have returned any INT values (because SQLite has no INT datatype).  So why was TABLE t_copy created with an INT column

Re: [sqlite] [sqlite-dev] working with an existing (look-up) SQLite database in Eclipse

2010-07-01 Thread Pavel Ivanov
This type of questions should go to sqlite-us...@sqlite.org. Forwarding you there. Pavel On Thu, Jul 1, 2010 at 6:52 PM, c...@comcast.net wrote: I am pretty new to Android but not new to programming. I want to do something that I thought was fairly simple, but can't seem to find any

Re: [sqlite] Slow query

2010-06-30 Thread Pavel Ivanov
want so far then you were just lucky. Try to change your query like this: SELECT id, name, id2, name2, max(year) y GROUP BY id, name2 ORDER BY name2, y DESC LIMIT 0, 15 Pavel On Wed, Jun 30, 2010 at 6:21 AM, J. Rios jriosli...@gmail.com wrote: On Wed, Jun 30, 2010 at 2:40 AM, Pavel Ivanov paiva

Re: [sqlite] Slow query

2010-06-29 Thread Pavel Ivanov
SELECT id, name, id2, name2 GROUP BY id ORDER BY name2, year DESC LIMIT 0, 15 How can I make it faster? First of all your query should return nonsense in any field except id. I bet it will also return different results (for the same ids) depending on what LIMIT clause you add or don't add it

Re: [sqlite] create table {table-name} as select.... table definition is imperfectly cloned

2010-06-29 Thread Pavel Ivanov
 ...which actually surprises me, since I was under the impression  CREATE TABLE ... AS SELECT always produced NONE affinities.  Is this  a semi-recent (last year) change? It looks like the only recent change was a year ago: http://www.sqlite.org/changes.html#version_3_6_15. But according to

Re: [sqlite] create table {table-name} as select.... table definition is imperfectly cloned

2010-06-29 Thread Pavel Ivanov
I think SQLite implementations should probably adhere to a core spec but I recognize this as my bias, not dogma. Probably this is my personal opinion but why should SQLite comply with specification of Pick Multi-dimensional databases if it never claimed to be multi-dimensional? SQLite is a

Re: [sqlite] create table {table-name} as select.... table definition is imperfectly cloned

2010-06-29 Thread Pavel Ivanov
, Pavel Ivanov paiva...@gmail.com wrote: I think SQLite implementations should probably adhere to a core spec but I recognize this as my bias, not dogma. Probably this is my personal opinion but why should SQLite comply with specification of Pick Multi-dimensional databases if it never

Re: [sqlite] Slow query

2010-06-29 Thread Pavel Ivanov
the difference and the SORT is getting slow as its not using the index. I have read that sqlite only uses one Index by query. There must be a solution but I dont get it. Thanks in advance On Tue, Jun 29, 2010 at 9:49 AM, Pavel Ivanov paiva...@gmail.com wrote: SELECT id, name, id2, name2

Re: [sqlite] (python) how to define unchangeable global ID in a table?

2010-06-28 Thread Pavel Ivanov
the primary key column [id] is defined as INTEGER PRMARY KEY; so defined, SQLite will treat this column as an alias for the ROWID. There is no guarantee that ROWID will remain constant over time: its job is very simple: to be unique.  There is no be constant clause in its contract, so to Tim,

Re: [sqlite] alternative to UNIQUE CONSTRAINT

2010-06-28 Thread Pavel Ivanov
there are no NULLS in my example and I don't believe in a frontend-problem (I wouldn't interpret the SQL.LOG this way). If you don't believe that it's your frontend problem then go ahead and reproduce it in sqlite3 command line utility. If you were able to reproduce it there then it would be

Re: [sqlite] alternative to UNIQUE CONSTRAINT

2010-06-28 Thread Pavel Ivanov
you to have any UNIQUE constraint then, as Darren said, you better consider using some other driver, not a workaround for this one. I believe there are several ODBC drivers for SQLite out there. Pavel On Mon, Jun 28, 2010 at 11:00 AM, Oliver Peters oliver@web.de wrote: Pavel Ivanov paiva

Re: [sqlite] alternative to UNIQUE CONSTRAINT

2010-06-28 Thread Pavel Ivanov
this ODBC driver (probably you use it through some wrapper or something else is standing in the way). I think you should reduce your case to some few calls to ODBC and post it here if it still doesn't work. Pavel On Mon, Jun 28, 2010 at 11:24 AM, Oliver Peters oliver@web.de wrote: Pavel Ivanov

Re: [sqlite] alternative to UNIQUE CONSTRAINT

2010-06-28 Thread Pavel Ivanov
using the same frontend is reading this and will direct you where you should file a bug... Pavel On Mon, Jun 28, 2010 at 12:23 PM, Oliver Peters oliver@web.de wrote: Pavel Ivanov paiva...@... writes: [...] And as no one experienced problems like yours before then I guess we can switch

Re: [sqlite] (python) how to define unchangeable global ID in a table?

2010-06-28 Thread Pavel Ivanov
is to add another column to the table and to make it an alternate unique key. This value carries for him the specific meaning position in a string in exchange protocol between 2 systems. Regards Tim Romano Swarthmore PA On Mon, Jun 28, 2010 at 10:23 AM, Pavel Ivanov paiva...@gmail.com wrote

Re: [sqlite] UPDATE without a JOIN

2010-06-25 Thread Pavel Ivanov
update TABLE2 set z = @z where rowid in ( select t2.rowid from TABLE1_2 t12, TABLE2 t2 where t12.a = @a and t12.b = @b and t2.x = t12.x and t2.y = t12.y ) Pavel On Fri, Jun 25, 2010 at 9:04 AM, Matthew Jones matthew.jo...@hp.com wrote: I've seen various posts about who to get around the lack

Re: [sqlite] Updating specific rows in a table

2010-06-25 Thread Pavel Ivanov
Erik, I didn't quite understand what you wanted to say. Neither about RSQLite and new field (it seems that you use the same field in both tables), nor about having data in the same table. Could you please elaborate? Pavel On Thu, Jun 24, 2010 at 11:37 AM, Erik Wright eswri...@wisc.edu wrote:

Re: [sqlite] How accept sqlite3 commands from stdin

2010-06-24 Thread Pavel Ivanov
I was asking whether it is possible to use Shebang with sqlite script. If it is possible, would you please show me how to modify the following script to do so? If you don't mind one error message then you can do it like this: cat test.sql #!/usr/bin/sqlite3 -init ; create table tbl1(one

Re: [sqlite] marking transaction boundaries

2010-06-23 Thread Pavel Ivanov
The question following your suggestion is how do i maintain transaction start and stop times? I have no control of knowing when a transaction starts and ends and i said earlier, i cannot use transaction hooks. And you didn't answer my question: how will you put this transaction identifier into

Re: [sqlite] handling sqlite3_close() == SQLITE_BUSY

2010-06-23 Thread Pavel Ivanov
with fatal error }        } Pavel On Tue, Jun 22, 2010 at 6:18 PM, Sam Carleton scarle...@miltonstreet.com wrote: On Tue, Jun 22, 2010 at 10:13 AM, Pavel Ivanov paiva...@gmail.com wrote: No, I did not.  I am not storing any blobs right now, but...  Is the busy handler going to kick

Re: [sqlite] Avoiding Out Of Office Auto Reply To Group

2010-06-23 Thread Pavel Ivanov
Just an idea - not checked (I never use Out-of-Office auto-replies), but could work: if your email client is MS Outlook then probably it would be better to not use Out-of-Office Assistant, but setup new rule instead. Make this rule for every message except for those that sent to

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