Re: [sqlite] Hints for the query planner

2013-09-10 Thread kyan
Hello Dr Hipp, First of all, I apologize for this rather off-topic suggestion knowing that you may have already implemented the syntax you describe, but there is an IMHO good reason for it, read ahead. On Tue, Sep 10, 2013 at 10:26 PM, Richard Hipp wrote: > SELECT DISTINCT

Re: [sqlite] UPDATE question

2013-09-06 Thread kyan
On Thu, Sep 5, 2013 at 9:20 PM, Peter Haworth wrote: > I have a table with the following (simplified) structure > > PKeyINTEGER PRIMARY KEY > NameTEXT > Sequence INTEGER > > The Name/Sequence pair of columns is defined as UNIQUE > > I need to insert a new row into a point between

Re: [sqlite] A few questions about SQLite Encryption Extension

2013-07-19 Thread kyan
On Fri, Jul 19, 2013 at 3:49 PM, Sqlite Dog wrote: > That's interesting. What about pas file with function declarations to > SQLite API? Should it be modified somehow? > > If you use static dll loading and linking, Instead of declaring API functions as external 'sqlite3.dll'

Re: [sqlite] A few questions about SQLite Encryption Extension

2013-07-19 Thread kyan
On Fri, Jul 19, 2013 at 10:21 AM, Sqlite Dog wrote: > > Our database manager is developed using Delphi (Pascal). Thus it is not > possible to statically link SQLite library, SQLite.dll is used. Is there > some other way to support SEE in our project? > It is possible to

Re: [sqlite] Exact content of a column in a row

2013-05-28 Thread kyan
On Tue, May 28, 2013 at 3:26 PM, kyan <alfasud...@gmail.com> wrote: > > On Tue, May 28, 2013 at 3:06 PM, Dave Wellman <dwell...@ward-analytics.com > > wrote: > >> Is there a way to extract the content of a column/row in its 'stored' >> format >> - i.

Re: [sqlite] Exact content of a column in a row

2013-05-28 Thread kyan
On Tue, May 28, 2013 at 3:06 PM, Dave Wellman wrote: > Is there a way to extract the content of a column/row in its 'stored' > format > - i.e. the actual bytes? So that it's 'fairly' easy to read! I have a > utility that will look at the hex bytes of any file, but

Re: [sqlite] Is pragma foreign_key_check fast enough to be used in normal application flow?

2013-05-24 Thread kyan
okup on the key. > > So, it still might be fast enough for what you want (though I missed the > beginning of the thread). > > -Original Message- > From: sqlite-users-boun...@sqlite.org [mailto: > sqlite-users-boun...@sqlite.org] On Behalf Of Richard Hipp > > On F

Re: [sqlite] Is pragma foreign_key_check fast enough to be used in normal application flow?

2013-05-24 Thread kyan
On Fri, May 24, 2013 at 3:56 PM, Clemens Ladisch wrote: > This is why we have transactions. > Perhaps but I would like to refrain from arguing on this at this time. Instead I would like an answer to my original question if possible. TIA.

Re: [sqlite] Is pragma foreign_key_check fast enough to be used in normal application flow?

2013-05-24 Thread kyan
On Fri, May 24, 2013 at 2:47 PM, Clemens Ladisch wrote: > Foreign key checks are not intended to prevent user errors but to > prevent programming errors. In other words, your program is responsible > for preventing the user from trying to delete some X that is still >

[sqlite] Is pragma foreign_key_check fast enough to be used in normal application flow?

2013-05-24 Thread kyan
Hello Dr. Hipp and all, Due to its implementation of foreign keys and their deferring, SQLite does not provide any useful information when a foreign key is violated; it gives a not very helpful "Foreign key constraint failed" message instead. This is a problem because an application developer

Re: [sqlite] Copying an SQLite database

2013-03-15 Thread kyan
On Thu, Mar 14, 2013 at 4:28 PM, J Trahair wrote: > There will be times when the program running the SQLite database will copy > the database file MySQLiteDatabase.db to another folder, where the copy will > be zipped (compressed). What happens if another user

Re: [sqlite] per-context resources for user-defined function

2013-03-11 Thread kyan
On Mon, Mar 11, 2013 at 12:52 PM, James K. Lowden wrote: > I need one data structure > per context. I don't see support for that in the SQLite API. Am I > expected to maintain my own global associative array? Not if you use sqlite3_aggregate_context(). See

Re: [sqlite] Is there a way to create a foreign key in existing table?

2013-03-02 Thread kyan
On Sat, Mar 2, 2013 at 6:02 PM, Simon Slavin wrote: > Nevertheless, you do now understand that there are no magic undocumented > calls in SQLite that people are using to do things like his. Which is what > your question was. OK, thanks again.

Re: [sqlite] Is there a way to create a foreign key in existing table?

2013-03-02 Thread kyan
Thank you for your response Simon. On Sat, Mar 2, 2013 at 3:51 PM, Simon Slavin wrote: > SQLite isn't at its root a DDL. It's a C API, fully documented here: > > > > That's SQLite and that's its full documentation. As designed, to add

Re: [sqlite] Is there a way to create a foreign key in existing table?

2013-03-02 Thread kyan
On Tue, Jan 1, 2013 at 8:01 PM, Peter Haworth wrote: > There are plenty of third party tools out there that will take care of > adding/removing constraints to existing tables and a whole lot of other > functions that aren't available in SQLite's DDL, while accounting for all >

Re: [sqlite] to find table exists or not

2012-12-06 Thread kyan
On Thu, Dec 6, 2012 at 6:49 PM, Staffan Tylen wrote: > SELECT CASE WHEN EXISTS (...) END > > On Thu, Dec 6, 2012 at 5:47 PM, Durga D wrote: > >> I have situation in which I want to read particular record if table exists. >> Based on that record

Re: [sqlite] SQLite converts all unicode characters into ANSI

2012-11-18 Thread kyan
On Sat, Nov 17, 2012 at 3:29 PM, ZikO wrote: > I have a slight problem with sqlite and its text encoding. I read from > documents that sqlite handles UTF-8 by using a command PRAGMA encoding = > "UTF-8"; etc. My database is to store Polish text. The database is going to > be used

Re: [sqlite] Is there a way to measure query time in sqlite at runtime?

2012-11-17 Thread kyan
On Sat, Nov 17, 2012 at 1:26 AM, 杨苏立 Yang Su Li wrote: > I want to measure the execution time of each sql statement in sqlite. Use sqlite3_profile() to register a profiler callback for a database connection that will be called for every SQL statement you execute on that

Re: [sqlite] Trigger logic with INSERT OR REPLACE

2012-11-15 Thread kyan
On Wed, Nov 14, 2012 at 6:01 PM, Simon Slavin wrote: > It's also worth knowing about > > UPDATE OR REPLACE > > which is similarly not MERGE, but has more MERGE-like behaviour. Though what > it does I had to figure out myself since the documentation on the 'UPDATE' > page

Re: [sqlite] Trigger logic with INSERT OR REPLACE

2012-11-14 Thread kyan
> No. INSERT OR REPLACE does an INSERT, possibly after doing a DELETE. It > never does an UPDATE. http://www.sqlite.org/lang_conflict.html Similarly any detail rows that are linked with foreign keys to the affected row will be handled according to the FK's ON DELETE clause. For instance if

Re: [sqlite] Data type information for derived columns

2012-10-11 Thread kyan
On Wed, Oct 10, 2012 at 8:21 PM, jkp487-sql...@yahoo.com wrote: > New to SQLite. Is there a way to get column data type information for > derived columns in a query or view? For example, if I have something like > this: > > > select Customer.LastName || Customer.FirstName

Re: [sqlite] Detecting when a table is created

2012-06-26 Thread kyan
> Is there any possibility to be notified when a table is created (when a > "CREATE TABLE XXX" is executed)? You could try installing a profile callback using sqlite3_profile() (see http://www.sqlite.org/c3ref/profile.html). Of course this callback will be called for any kind of SQL or DDL