Re: [sqlite] OT: how best to convert sqlite3_int64 to and from string in a cross platform fashion?

2009-05-03 Thread Martin Engelschalk
Hi, This is what i do, works for me. No OSX hovever, sorry. #ifdef _WIN32 #define INT64 __int64 #else #define INT64 long long #endif // From INT64 to String INT64 iOther; char mBuffer[64]; #ifdef _WIN32 sprintf(mBuffer, "%I64d", iOther); #else sprintf(mBuffer, "%lld", iOther); #endi

Re: [sqlite] OT: how best to convert sqlite3_int64 to and from string in a cross platform fashion?

2009-05-03 Thread Martin Engelschalk
Sorry, i forgot: my INT64 is the same as sqlite_int64 Martin Engelschalk wrote: > Hi, > > This is what i do, works for me. No OSX hovever, sorry. > > #ifdef _WIN32 > #define INT64 __int64 > #else > #define INT64 long long > #endif > > // From INT64 to String &g

Re: [sqlite] how can we solve IF EXIST in SQLite

2009-06-02 Thread Martin Engelschalk
Hi, what language is this? it certainly is not SQL or a "query". I suspect that you can not use "insert or replace" (see http://www.sqlite.org/lang_insert.html), because you look first for a record with prod_batch_code=1000, and if you do not find it you insert one with prod_batch_code = 1003.

Re: [sqlite] how can we solve IF EXIST in SQLite

2009-06-02 Thread Martin Engelschalk
corde i jus want to update the first row coz > its also having the same product id i jus want set the quantity = 10+15 and > the date new date that is 30-05-2009 > and suppose if i insert row with different product_id it should be inserted > as it is.. > > Martin Engelschalk wr

Re: [sqlite] Why row is not found?

2009-06-05 Thread Martin Engelschalk
Hi, attachments do not make it through the list. There is no row with the value 'admin' in the field 'lo_name' in your table. Did you check that there are no blank spaces or other invisible characters? Martin Marco Bambini wrote: > Anyone can please explain me why this query: > SELECT * FROM l

Re: [sqlite] Why row is not found?

2009-06-05 Thread Martin Engelschalk
ters. > > Please note that the following query returns the exact row: > SELECT * FROM lo_user WHERE CAST(lo_name AS TEXT)='admin'; > but I really don't have an explanation... > > -- > Marco Bambini > http://www.sqlabs.com > http://www.creolabs.com/payshield

Re: [sqlite] Why row is not found?

2009-06-05 Thread Martin Engelschalk
ype... > but what is strange is that the same db and the same query worked fine > with sqlite 3.4.2 and the behavior changed with sqlite 3.6.x > > -- > Marco Bambini > http://www.sqlabs.com > http://www.creolabs.com/payshield/ > > > > > > > On Jun 5

Re: [sqlite] synchronizing sqlite local data base to a remote data base

2009-06-08 Thread Martin Engelschalk
Hi, What Simon is right. When solving a similar problem in the past I created special tables in both databases which i filled from triggers on the data tables. These tables contained the changed data which i then could reproduce on the other database using a special deamon process. However, my

Re: [sqlite] Order by term not in result set

2009-06-09 Thread Martin Engelschalk
Hi, the column name in the order by - clause "name" has to match one of the columns of the select statement, because it is a union. Your columns are "id", "url" ad "selected", none of which is "name". Obviously, your table does contain a column named "name", but because of the union this can no

Re: [sqlite] Tips to access SQLite with multiple clients?

2009-06-21 Thread Martin Engelschalk
Hi Gilles, first, you write of a "SQL server", but you probably know that sqlite is not a server. You can have multiple applications access a sqlite database file without problems if these applications are reading the database and not writing. If the applications also have to write, then - read

Re: [sqlite] How to find the version of the database.

2009-06-26 Thread Martin Engelschalk
Hi, a database file does not have a version. You can access it with different versions of the library. AFAIK there is no way to determine what version of the library created it or which version wrote to it last. Martin Kalyani Phadke wrote: > Is there any way to find the version of SQlite3 dat

Re: [sqlite] Updating a database by email

2009-07-11 Thread Martin Engelschalk
Hi, sqlite as such has nothing to do with eMail. My Thought: I would write an application that queries a mailbox (via POP3, for example, there are many possible ways) every n seconds, analyses the mails it reads and performs the appropriate actions on the sqlite database. This could be a backg

Re: [sqlite] [Duplicates] How to keep only one row?

2009-08-17 Thread Martin Engelschalk
Hi, If you are looking for a delete - command, then you have to decide which of the duplicate rows you want to keep. Are they all the same even in the other fields? Perhaps you want to do something like delete from members where exists (select rowid from members m2 where m2.name = members .na

Re: [sqlite] Table aliases

2009-10-09 Thread Martin Engelschalk
Hi, yes, creating a table will duplicate your data. However, a view will not: create view CurrentLanguage as select * from SomeLanguage; see http://www.sqlite.org/lang_createview.html Martin Shaun Seckman (Firaxis) wrote: > Happy Friday everyone! > > I've got several tables ea

Re: [sqlite] Question about the update of tuples in sqlite-views

2009-10-20 Thread Martin Engelschalk
Hi, a view does not need to be updated. Think of a view as a stored select statement. Martin Koston, Thorsten (ICT) wrote: > Hello, > > i have a question about the update machanism for tuples in different > views: > > For example from a table we have three different views. > How will be the vi

Re: [sqlite] Maximum length of the field name

2009-11-15 Thread Martin Engelschalk
Hi, AFAIK, there is no limit. At least, browsing http://www.sqlite.org/limits.html, I found none. The maximum length of an SQL statement, 100 by default, limits the column names you can use, because you have to issue a "create table" - statement. Martin Ev wrote: > What's the maximum leng

Re: [sqlite] Fine-grainy error report needed

2009-11-16 Thread Martin Engelschalk
Hi, First, the index of the bind variable (second parameter to sqlite3_bind_, your 'i') must begin with 1, and not 0, see http://www.sqlite.org/capi3ref.html#sqlite3_bind_blob Sqlite does not use strong typing, which means that you can put any data into any column. However INTERGER PRIMARY

[sqlite] Sorting and Descending Index

2008-03-19 Thread Martin Engelschalk
Hello All, I have to select data from a large table (several million records) in descending order and created an index for that purpose. However, sqlite seems not to use this index for selecting the data. In the documentation of the "create index" - statement, i found the following sentence:

Re: [sqlite] Sqlite catalog - datebase with pictures

2008-03-29 Thread Martin Engelschalk
Hello Lukasz, to insert a picture (or any binary data for that matter), you can read the data from the file and use sqlite3_bind_blob to insert (or update) it. When selecting it from the database, use sqlite_column_blob to retrieve the data and sqlite3_column_bytes to get the length. An alterna

Re: [sqlite] Any way to disable journaling & rollback?

2008-04-10 Thread Martin Engelschalk
Hi all, i have the same requirements. I don't need transactions at all and do not care if my databases become corrupt. However, i follow the versions of sqlite and do not want to change the code. Perhaps it is an idea to add something like "paragma disable_transactions" some time in the future?

Re: [sqlite] Any way to disable journaling & rollback?

2008-04-11 Thread Martin Engelschalk
Hello Donald, I don't think so: The journal files are not synchronized on SYNCHRONOUS = OFF, but they are still written, so transactions are still possible. Martin Griggs, Donald wrote: > Regarding: " removing the call of FlushFileBuffers for each transaction > made my application run 20 times

Re: [sqlite] Listing duplicate entries

2008-04-28 Thread Martin Engelschalk
Hi, let the table have two columns, "a" and "b". Then select a, count(b) from yourtable group by a having count(b) > 1 returns 'fred' and 'roger'. Martin flakpit wrote: > Is there a way of querying the database to list all duplicate entries from a > column in the same table? > > Something like

Re: [sqlite] Listing duplicate entries

2008-04-28 Thread Martin Engelschalk
x27;, 'Miller'); select * from mytable where b in ( select b from mytable group by b having count(b) > 1 ) Igor Tandetnik wrote: > Martin Engelschalk > <[EMAIL PROTECTED]> wrote: > >> Hi, >> >> let the table have two columns, "a" and "b&

Re: [sqlite] requesting for the clarification about sqlite

2008-08-23 Thread Martin Engelschalk
Hi, 1) Make sure you transfer the database file in binary mode 2) Make sure your webserver or application has write permission to the *directory* the database file is in Martin sankar raman wrote: > hi, > > this is shankar ,i am using sqlite in my website ,i am facing a problem > that is i a

Re: [sqlite] Urgent: sqlite3_step and SQLITE_DONE ?

2008-09-07 Thread Martin Engelschalk
Hello Lothar, sorry, i did not read your questions fully. No, after you get SQLITE_DONE, you do not have any data in your result set. After issuing sqlite_reset, you can not read any data, the statement Use the statement like this: - sqlite3_prepare the statement. - Use sqlite3_bind_xxx to set y

Re: [sqlite] Urgent: sqlite3_step and SQLITE_DONE ?

2008-09-07 Thread Martin Engelschalk
Hello Lothar, you should indeed get SQLITE_ROW. Can it be that your select statement has a where - clause that does not fir your data? Perhaps you want to post your statements here, beginning with create table. Martin Lothar Behrens wrote: > Hi, > > I am struggling with the following situation:

Re: [sqlite] Urgent: sqlite3_step and SQLITE_DONE ?

2008-09-07 Thread Martin Engelschalk
Thanks > > Lothar > > PS. If nothing helps, I'll try to setup a test case for this with > plain sqlite commands, as they appear in my program flow. > > Am 07.09.2008 um 14:17 schrieb Martin Engelschalk: > > >> Hello Lothar, >> >> sorry, i did n

Re: [sqlite] Checking column constraints

2008-10-31 Thread Martin Engelschalk
Hello Mauricio, i do not understand your question. Perhaps you will want to rephrase it. The table "sqlite_master" can tell you how the tables were created. See http://www.sqlite.org/sqlite.html or http://www.sqlite.org/faq.html, and search for "sqlite_master". Martin Mauricio wrote: > Hi, > >

Re: [sqlite] Valgrind complains about sqlite

2008-11-03 Thread Martin Engelschalk
Hello Daniel, i know this specific output "Syscall param write(buf) points to uninitialised byte(s)" from my programs. It appears outside sqlite, too. It is not a problem. Martin Daniel Hellsson wrote: > I have sqlite3 3.6.4 and the program I've written gets in trouble with > valgrind. > > >

Re: [sqlite] bug? like-search with german umlaut is case-sensitive, should not be

2008-11-14 Thread Martin Engelschalk
Hello Thomas, I have the same problem. There is no readily available function for converting utf-8 characters outside 7-bit-Ascii from lower to upper, so sqlite does not use one. To achieve this, you have to write your own function and/or incorporate something like ICU into your project. I stil

Re: [sqlite] bug? like-search with german umlaut is case-sensitive, should not be

2008-11-14 Thread Martin Engelschalk
Hi all, the ICU project is a very powerful tool to handle codepages, and also supports regular expressions (using a class named "RegexMatcher", see http://icu-project.org/apiref/icu4c/classRegexMatcher.html). So, it should be relatively easy to replace the like() - function in sqlite (see http:

Re: [sqlite] Function Name

2008-11-25 Thread Martin Engelschalk
Hi, see http://www.sqlite.org/lang_attach.html. You will have to call sqlite3_exec(, "attach database as ", 0, 0, 0) Martin Satish wrote: > HI! > >What is the c/c++ API function given by SQLite to attach a database to > another database or tell me how to get access the tables in the other

Re: [sqlite] Arranging of ids in Sqlite3

2008-11-26 Thread Martin Engelschalk
Hi, after a delete from history where id = 15 you could do a update history set id = id - 1 where id > 15 However, it is not a good idea to change a primary key, especially if there are other data in other tables depending on it. Martin Nikhil Kansal wrote: > Hi, > > I am using id as a integer

Re: [sqlite] newie question

2008-12-08 Thread Martin Engelschalk
Hi, this is a normal select statement, you can retrieve the result in the same way as for 'select foo from bar' - Statement. The tecnical way depends on the interface you use. If you need a name of the result field, you can use 'SELECT COUNT(*) as MyField FROM atable'; the result field is the n

Re: [sqlite] convert sql for sqlite 2.8.17

2008-12-08 Thread Martin Engelschalk
Hi, I don't know what your problem is, exactly. However, I suspect that you have to alias the second "fruits" as well: select f.type, f.variety, f.price from fruits f where f.rowid in (select f1.rowid from fruits f1 where f1.type = f.type order by f2.price desc limit 1) order by f.type asc,

Re: [sqlite] convert sql for sqlite 2.8.17

2008-12-08 Thread Martin Engelschalk
t makes to me. Perhaps Hariyanto Handoko would like to post what the statement is supposed to achieve. Martin Ribeiro, Glauber wrote: > This should return only one record, right? So you shouldn't need the > second order by ("order by f.type asc, f.price desc"). > >

Re: [sqlite] sqlite3_create_function callback problem

2008-12-17 Thread Martin Engelschalk
Hi, i suspect that you problem is the class MyClass. Try to define your function "ScorePosition" as a C-function outside of a class. Martin Guillaume Schub wrote: > Hi everyone, > > I have spent nearly one day on this already with no success. I am > currently trying to create some custom functi

Re: [sqlite] Delete Trigger on INSERT OR REPLACE?

2009-01-02 Thread Martin Engelschalk
Hello Tobi, See http://www.sqlite.org/lang_conflict.html, near the bottom: "When this conflict resolution strategy deletes rows in order to satisfy a constraint, it does not invoke delete triggers on those rows. This behavior might change in a future release." I would be interested if an UPDAT

Re: [sqlite] Delete Trigger on INSERT OR REPLACE?

2009-01-02 Thread Martin Engelschalk
t or replace into ch(fname, red, green, blue, dsize) > values('xxx', 0, 0, 0, 0); > sqlite> select chId from blobdata where chId = 1; > 1 > > The entry is still here. > > Tobias > > > Martin Engelschalk schrieb: > >> Hello Tobi, >> &g

Re: [sqlite] Collation not used

2009-01-09 Thread Martin Engelschalk
Hello Igor, in the beginning this was an attempt to circumvent the missing DESC Indices prior to Version 3.3.0. However, it all grew and now i do all kinds of things using collations. I admit that i could achieve most of them in a different way, but i would have to change my application. The pr

Re: [sqlite] Collation not used

2009-01-09 Thread Martin Engelschalk
Igor Tandetnik wrote: > Martin Engelschalk > wrote: > >> The problem appeared when my users eliminated leading blanks from the >> data. >> > > I'm not sure I understand. What does this have to do with collating > numbers? Are you saying

Re: [sqlite] segmentation violation in fulltest on Mac OS X

2009-01-19 Thread Martin Engelschalk
Hello, Threads: use them, but don't abuse them Threads don't kill programs, programmers do ;-) Martin D. Richard Hipp wrote: > On Jan 19, 2009, at 3:50 AM, Jens Miltner wrote: > > >> Hello, >> >> I just upgraded to sqlite 3.6.10 and keep getting a segmentation >> violation when running the fu

Re: [sqlite] Group by week

2009-02-04 Thread Martin Engelschalk
Hi, perhaps you want to look at http://www.sqlite.org/cvstrac/wiki?p=DateAndTimeFunctions or perhaps you would want to post a little more information about your problem Martin Moshe Sharon wrote: > Hi > > How can I select group by week > > moshe > _

Re: [sqlite] number of columns in a table

2009-02-18 Thread Martin Engelschalk
Hi, see http://www.sqlite.org/capi3ref.html#sqlite3_column_count. Do this: sqlite3_stmt *pStmnt; sqlite3_prepare(YourDbHandle, "select * from YourTable limit 1", -1, &pStmnt, 0); int NumberOfColumns = sqlite3_column_count(pStmnt); sqlite3_finalize(pStmnt) Martin baxy77bax wrote: > hi, > > my

Re: [sqlite] running sqlite with gcc C

2009-02-25 Thread Martin Engelschalk
Hello Michael, download the source code, compile it with your compiler and link it to your program. See http://www.sqlite.org/download.html. Its easiest to use the amalgamation: sqlite-amalgamation-3_6_11.zip There is indeed no installation

Re: [sqlite] running sqlite with gcc C, continuation.....

2009-02-25 Thread Martin Engelschalk
Hi, you have to compile sqlite3.c, using something like gcc -c sqlite3.c making an object file, and then linking it to your own program. Your call combines compiler and linker using only your own source file. Also, it should not be necessary to define sqlite3_open and sqlite3_close (or any ot

Re: [sqlite] Is this possible?

2009-03-01 Thread Martin Engelschalk
Hi Mike, you can't use attachments in this mailing list. Best post your data model, some data and the desired result. Martin Mike Yenco wrote: > Is there a way that SQLite can return all matching items to a search > string in Table B, but return a group name from Table A before each > set of m

Re: [sqlite] Is this possible?

2009-03-01 Thread Martin Engelschalk
Hi Mike, sorry, i don't fully get it. However, a single SQL statement can not return data rows of different structure as you indicated in your example. Especially, I am confused about "blank". It seems to come from Table A, same as "Group *". Do you want to put "Group *" as a sort of headline,

Re: [sqlite] Is this possible?

2009-03-01 Thread Martin Engelschalk
app". There is no need to display the > "Vegetable" container as there were no contents found for that one. > > My first inclination was to go with a repeat loop... take the number > of lines in Table A and loop through each one doing a search of > contents f

Re: [sqlite] INSERTing OR REPLACEing Together or one at a time

2009-03-02 Thread Martin Engelschalk
Hi, it seems to me that between LSOpenProjects and LSOpenSubProjects you have a 1:n relationship, and also between LSOpenSubProjects and LSOpenJobs. Also, it seems that you want to copy data from an attached database "c" to the main database. So, if you want to preserve this relationship in your

Re: [sqlite] Random Syntax changed in 3.6.11?

2009-03-02 Thread Martin Engelschalk
Hi, in http://www.sqlite.org/lang_corefunc.html the random() function is documented as taking no arguments, So, use SELECT word FROM dict ORDER BY RANDOM() LIMIT 1; I tried an older version of sqlite (can't say which, but 3.*), and could call random() with 0, 1, 2, 3 and 4 parameters. I would b

Re: [sqlite] INSERTing OR REPLACEing Together or one at a time

2009-03-02 Thread Martin Engelschalk
help. > > josé > > - Original Message - > From: "Martin Engelschalk" > To: "General Discussion of SQLite Database" > Sent: Monday, March 02, 2009 1:14 PM > Subject: Re: [sqlite] INSERTing OR REPLACEing Together or one at a time > > > >> H

Re: [sqlite] set a Trigger on select

2009-03-05 Thread Martin Engelschalk
Hi, you are right, afaik triggers on select are not supported. I would define a function, read the data i need from the hardware inside the function and return it. See http://www.sqlite.org/capi3ref.html#sqlite3_create_function select MyField, GetHardwareSerialNumber() from MyTable Martin Sp

Re: [sqlite] insert in C

2009-03-11 Thread Martin Engelschalk
Hi, use sqlite3_prepare and sqlite3_bind. See http://www.sqlite.org/capi3ref.html#sqlite3_prepare and sqlite3_bind_text under http://www.sqlite.org/capi3ref.html#sqlite3_bind_blob const char* szTail=0; sqlite3_stmt* pVM; int nRet = sqlite3_prepare(mpDB, "insert into table1 values(?)",

Re: [sqlite] SELECT queries and NULL value parameters

2009-03-11 Thread Martin Engelschalk
Hi, yes, this is expected. Note that you use the = - operator in WHERE maybenullcolumn = @value and NULL = NULL evaluates to false. This is SQL standard. Martin diego.d...@bentley.com wrote: > Hello, > > In my usage of SQLite, I found a behavior that might be considered a > bug, but I would lik

Re: [sqlite] SELECT queries and NULL value parameters

2009-03-11 Thread Martin Engelschalk
OM foo WHERE a = ''; > 1 > sqlite> SELECT Count(*) FROM foo WHERE a = NULL; > 0 > sqlite> SELECT Count(*) FROM foo WHERE a IS NULL; > 1 > sqlite> SELECT Count(*) FROM foo WHERE a IS NULL OR a = ''; > 2 > sqlite> > > >> Tom &

Re: [sqlite] SQLITE : Constraint question

2009-03-11 Thread Martin Engelschalk
Hi, sqlite does not enforce datatypes. In this, sqlites works differently from other database engines. See http://www.sqlite.org/different.html and search for "*Manifest typing" The key sentence is *"SQLite thus allows the user to store any value of any datatype into any column regardless of th

Re: [sqlite] Sqlite3_open Wrapper Issue

2009-03-12 Thread Martin Engelschalk
Hi, sqlite3_open takes a Pointer-Pointer as 2nd argument: int sqlite3_open( const char *filename, /* Database filename (UTF-8) */ sqlite3 **ppDb /* OUT: SQLite db handle */ ); This is what your compiler tries to tell you: safecalls.c:152: warning: passing argument 2 of ‘sqlite3_o

Re: [sqlite] Sqlite versus mySQL in PHP

2009-03-27 Thread Martin Engelschalk
Hi, wrap your inserts in a transaction. Place $q = sqlite_query("begin"); before your loop, and $q = sqlite_query("commit"); after your loop of inserts. Martin Anton Rifco wrote: > Hi guys, > > I would like to ask a question about sqlite in php. I don't know if I am > sending this message to t

Re: [sqlite] Selecting records by INDEXED key

2009-03-31 Thread Martin Engelschalk
Hi, your select statement does not include a "where" or "order by" - clause for which the index can be used, which is the cause of the error. If you want to select "the records by their index sequence", you should use Select * From "APPLE" ORDER BY "MySurname"; The index will then be used auto

Re: [sqlite] what is the default for the commit when the connection is opened.

2009-04-08 Thread Martin Engelschalk
Hi, sqlite does not know an "auto commit". If you do not call "begin transaction", then every insert/update/delete statement is wrapped in its own transaction. This is like "auto commit" If you do call "begin transaction", you start a transaction which you have to finish with "commit" or "rollba

Re: [sqlite] Appending Text to a Column

2009-04-14 Thread Martin Engelschalk
Hi, use the || - Operator to concatenate text. + adds to numbers. update tblEntry set Tags = Tags || ' new text' where RowID = 13 martin centipede moto wrote: > I am trying to append text to a field within my database - sothat if a user > has stored 'search, tools' into the Tags column of tblE

Re: [sqlite] Escaping strings to be used in queries in C/C++

2009-12-16 Thread Martin Engelschalk
Hi, The function "sqlite3_mprintf" is what you look for. see http://www.sqlite.org/capi3ref.html#sqlite3_mprintf Also, you might want to use bind variables instead of putting literals into your SQL text. see http://www.sqlite.org/capi3ref.html#sqlite3_bind_blob Martin Kurt D. Knudsen wrote: >

Re: [sqlite] Escaping strings to be used in queries in C/C++

2009-12-16 Thread Martin Engelschalk
> I think that the sqlite3_mprintf() should suffice, however. And thanks > again for the help. > > Kurt > > -Original Message- > From: sqlite-users-boun...@sqlite.org > [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Martin Engelschalk > Sent: Wednesday, Decemb

Re: [sqlite] size control of sqlite database

2010-01-14 Thread Martin Engelschalk
Hi Roger, yes, thank you, i did not see this. Martin Roger Binns wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Martin.Engelschalk wrote: > >> However, i could not find a way to determine when the empty pages are >> used up and the file will start to grow again without checking

Re: [sqlite] Sqlite3 Optimization Question

2010-01-22 Thread Martin Engelschalk
Hi, perhaps you could drop the primary key. The query you mentioned, SELECT count(*) FROM table WHERE column = '%q' does not utilize it, and if you do execute queries which do, do not update the db, and have no other tables, then the primary key serves no function. Martin Michael Thomason wrot

Re: [sqlite] Newbie problem using special column name

2010-01-25 Thread Martin Engelschalk
Hi, try enclosing your column name with double quotes " create table test("column-1" varchar(255)) However, i strongly advise not to use this character, because it is the minus-operator in sql. You will have to make sure that you enclose the column name every time you (or somone other) uses

Re: [sqlite] SQLite - IIS, PHP and java

2010-02-10 Thread Martin Engelschalk
Hi, the important question is: What about updates to the database? Will there be concurrent updates, or will the db be read only? Will some processes read an others write? What amount of traffic do you expect on the site? See http://www.sqlite.org/faq.html#q5 Martin alexis_ wrote: > Hi there

Re: [sqlite] SQLite - IIS, PHP and java

2010-02-10 Thread Martin Engelschalk
equential write?) > > As for Traffic: > Java could do 1 or 2 write's once a day. > PHP will be doing 2000 - 4000 reads a day. Mostly in the morning around > 08:30 and afternoon 17:00 > > Cheers > Alexis > > > Martin Engelschalk wrote: > >> Hi, >> &g

Re: [sqlite] Error: no such table on .import

2010-02-12 Thread Martin Engelschalk
Hi, because of the semicolon following the table name in your .import - command. Remove it. Martin Phil Hibbs wrote: > I'm doing this in SQLite: > > sqlite> .separator tabs > sqlite> create table head >...> ( id varchar(10) >...> , tplnr varchar(20) >...> , plnal varchar(2) >...

[sqlite] Problem with DATABASE_LOCKED

2010-03-15 Thread Martin Engelschalk
Dear Sqlite users, we experience a problem at a customer site, where the very first statement the program executes on a newly created database failes with a "database locked" error. The statement that failes is "PRAGMA synchronous = OFF". The reason seems to be that the customer inists on plac

Re: [sqlite] Problem with DATABASE_LOCKED

2010-03-15 Thread Martin Engelschalk
Hello Igor, yes, sorry, i forgot to mention that, i do have write access. The database file itself gets created. Martin Am 15.03.2010 20:02, schrieb Igor Tandetnik: > Martin Engelschalk > wrote: > >> we experience a problem at a customer site, where the very first &

Re: [sqlite] how to install sqlite3 in windows+python2.5

2010-06-09 Thread Martin Engelschalk
http://www.sqlite.org/sqlitedll-3_6_23_1.zip Am 10.06.2010 08:05, schrieb zeal: > Hi, > > i could not find the sqlite3.dll from http://www.sqlite.org/download.html > or would you please paste the linkage here? > thanks and best wish for you > > > ---

Re: [sqlite] Fwd: A DLL for my WinXP

2010-06-21 Thread Martin Engelschalk
Here: http://www.sqlite.org/sqlitedll-3_6_23_1.zip Am 21.06.2010 12:56, schrieb Arbol One: > Helloo! is any body there??!! > nock nock ... Is this group dead??!! > > Where can I find the DLL file for my winxp? > TIA > > > > Original Message > Subject: A DLL for my WinXP

Re: [sqlite] Fwd: A DLL for my WinXP

2010-06-21 Thread Martin Engelschalk
You also can search Google "sqlite dll download" and follow the first hit ... Am 21.06.2010 12:56, schrieb Arbol One: > Helloo! is any body there??!! > nock nock ... Is this group dead??!! > > Where can I find the DLL file for my winxp? > TIA > > > > Original Message > Subje

Re: [sqlite] concat 2 const chars ?

2010-07-09 Thread Martin Engelschalk
Hi, i think you are asking a C question, and not an sql question. Is your example C code? If this is the case, you should read up on C basics. Feel free to contact me directly (also in German) Martin Am 09.07.2010 21:06, schrieb rollerueckwaerts: > Hello, > I try to get an sql query string from

Re: [sqlite] Coping with database growth/fragmentation

2010-07-23 Thread Martin Engelschalk
Hello Taras, List, I have been fighting the same problems described here for a long time, and have no real elegant solution. So, the proposed solution of the OP below would be ideal for me too. The proposed pragma could also define a number of pages to be allocated at once instead of a number

Re: [sqlite] How can i install SQLite

2010-08-01 Thread Martin Engelschalk
Hi, sqlite needs not and cannot be installed. It is an emedded system which you link to your application. See http://www.sqlite.org/serverless.html Martin Am 01.08.2010 08:58, schrieb MKiran: > Please help me on SQLite install > > ___ > sqlite-users

Re: [sqlite] Can we get a pragma for SQLITE_FCNTL_CHUNKS_SIZE?

2010-08-19 Thread Martin Engelschalk
Am 19.08.2010 23:56, schrieb Simon Slavin: > On 19 Aug 2010, at 9:27pm, Taras Glek wrote: > >> I really appreciate that sqlite got this feature to reduce >> fragmentation, but why not expose this as a pragma? > Do you have figures which suggest that reducing fragmentation leads to any > improvem

Re: [sqlite] Can we get a pragma for SQLITE_FCNTL_CHUNKS_SIZE?

2010-08-20 Thread Martin Engelschalk
Am 20.08.2010 13:38, schrieb Max Vlasov: >> In my case (which is certainly not typical), a (several GB) large >> database is built up in several batches, one table at a time, while in >> parallel many intermediate files on the disk are created. This resulted >> in a very fragmented database file.

Re: [sqlite] SQLite System Time

2010-09-19 Thread Martin Engelschalk
Hi, what are you selecting exactly? Do you use a sqlite date / time function? Have you read http://www.sqlite.org/lang_datefunc.html? Martin Am 19.09.2010 00:41, schrieb Ady Puiu: > Hello and sorry if post my question here but I'm not sure where to ask... > > From where does SQLite gets the c

Re: [sqlite] COUNT very slow

2010-09-24 Thread Martin Engelschalk
Hello Michele, sqlite does not remember the number of records in a table. Therefore, counting them requires to scan the full table, which explains the slow perfornamce. This topic has been discussed previously in this list. See http://www.mail-archive.com/sqlite-users@sqlite.org/msg10279.htm

Re: [sqlite] COUNT very slow

2010-09-24 Thread Martin Engelschalk
TRIGGER No, but in this case an index on DateTime will help (except when most of the records are older than yesterday). Also, you could keep track of the number of records for each day with a table containing DateTime and RecordCount. > Il 24/09/2010 10.29, Martin Engelschalk ha scritto: >

Re: [sqlite] sqlite3 question

2010-10-30 Thread Martin Engelschalk
Hello Lizhe, in order for the members in this list to help you, please provide more details. First, the most probable cause for this error is that the database file is in fact corrupted in some way or is not a sqlite database file. What step/steps leads to corruption? What sqlite function returns

[sqlite] Slowdown when switching from Version 3.2.5 to 3.7.4

2010-12-16 Thread Martin Engelschalk
Hello List, i tried switching from Version 3.2.5 to 3.7.4 to make use of the new features. I create a new database file and load 1.000.000 records into a single table. Without changing anything in my own code (which reads from a file and does additional processing before inserting the records

Re: [sqlite] Slowdown when switching from Version 3.2.5 to 3.7.4

2010-12-16 Thread Martin Engelschalk
010 at 4:01 AM, Martin Engelschalk< > engelsch...@codeswift.com> wrote: > >> Hello List, >> >> i tried switching from Version 3.2.5 to 3.7.4 to make use of the new >> features. >> >> I create a new database file and load 1.000.000 records into a sing

Re: [sqlite] UTF-8

2010-12-16 Thread Martin Engelschalk
Hello Ming, sqlite does nothing to transform data between codepages, and it assumes that data you insert is passed in UTF8. However, sqlite will acept any data and store it. If the firefox plugin does not show you data correctly, then you problably did not pass correct UTF8 to sqlite. Can you c

Re: [sqlite] Slowdown when switching from Version 3.2.5 to 3.7.4

2010-12-17 Thread Martin Engelschalk
Hi, it was my own fault. Sorry for the noise. 3.7.4 is a lot faster. Martin Am 17.12.2010 09:30, schrieb Wiktor Adamski: > There is a lot more synchronization in 3.7.4. If you disable it new > version may be faster. > ___ > sqlite-users mailing list >

Re: [sqlite] 64 bit sqlite 3

2010-12-17 Thread Martin Engelschalk
Hi, we compiled the amalgamation with VC++ 2010 64 bit and had no problems whatsoever. Martin Am 17.12.2010 10:36, schrieb giuseppe500: > There is a version of SQLite 3 for 64-bit systems? > or, you can simply compile the source of sqlite3 at 64-bit with c++ 2008? > thanks. > __

[sqlite] Cant get PRAGMA temp_store = MEMORY to work

2011-02-02 Thread Martin Engelschalk
Hi list, I have a problem getting PRAGMA temp_store = MEMORY to work. I do a select joining two tables with an order by for which no index esists. This selects all the data in my database, 1 million records. The database size is 196 MB. When using version 3.2.5 (the amalgamation, no special pra

Re: [sqlite] Query help

2011-02-02 Thread Martin Engelschalk
Hello Marco, As far as i can see, the union is necessary. However, the second select in the union can be rewritten as a join: SELECT 'ID', id FROM MKObjects WHERE type='PANEL' AND platform='IPHONE' UNION SELECT prop_key, prop_value FROM MKProperties JOIN MKObjects on MKProperties.

Re: [sqlite] Cant get PRAGMA temp_store = MEMORY to work

2011-02-02 Thread Martin Engelschalk
Hi, i have something to add: SQLITE_DEFAULT_TEMP_CACHE_SIZE is not used anywhere in the sqlite.c file of the amalgamationand the comment above seems to be incomplete. Is this intended? Martin Am 02.02.2011 13:38, schrieb Martin Engelschalk: > Hi list, > > I have a problem getti

Re: [sqlite] Confused

2011-05-06 Thread Martin Engelschalk
Hello Arjabh, the autoindex is created for the rowid, because you did not define a column with type "integer primary key". See here: http://www.sqlite.org/lang_createtable.html#rowid SQLite can only use an index for where - clause in your statements if the columns in the where clause are the s

Re: [sqlite] Confused

2011-05-06 Thread Martin Engelschalk
now the queries are > running pretty fast (completes in ms :D ). > > Is this a good approach ? > Creating indexes affects the insert/update/delete query, isnt it? > > Thanks and Regards, > Arjabh > On Fri, May 6, 2011 at 2:06 PM, Martin Engelschalk< > engelsch...@codeswi

Re: [sqlite] Three questions

2011-05-11 Thread Martin Engelschalk
Hello, This question does not arise with SQLite, because parallel transaction are not supported, as Igor and Pavel pointed out. However, consider this: If you have a unique constraint on a table like in your example, when should the database enforce it? To use your example and add a second col

Re: [sqlite] Better way to get records by IDs

2011-05-20 Thread Martin Engelschalk
Hi, you want this: select * from Jobs where rec in (1, 2) Martin Am 20.05.2011 15:00, schrieb jose isaias cabrera: > Greetings. > > I would like to get a bunch of records of IDs that I already know. For > example, this table called Jobs, > rec,...,data,... > 1,...,aaa,... > 2,...,zzz,... > ...

Re: [sqlite] Better way to get records by IDs

2011-05-20 Thread Martin Engelschalk
Hi, to order, you have to use "order by". In that case, however, it gets complicated. SELECT * FROM Jobs WHERE rec IN (87, 33, 27,2, 1) order by case rec when 87 then 1 when 33 then 2 when 37 then 3 when 2 then 4 when 1

[sqlite] SQLite under NT 4

2005-04-28 Thread Martin Engelschalk
Hi, i find that sqlite is very much slower unter WinNT 4.0 than under Win2000 or XP. Does anyone know any special settings (Compiler or at runtime) for NT? Thanks, Martin

Re: [sqlite] Data tipe

2005-05-09 Thread Martin Engelschalk
Sombra schrieb: There is any Datatypes for Data (year, moth,day ) in version 2.8.16 of SQLite? Thanks SB No, there isn't. you can save a time_t or even a COleDateTime::m_dt in the database. Yours Martin

[sqlite] database table is locked

2005-05-12 Thread Martin Engelschalk
Hello, i open cursor on a table and retrieve rows from it. For every row i decide whether to update it. However, when executing the update I get the error "database table is locked". My application is the only one working on the table. Is it illegal to update a table while selecting from it or am

  1   2   >