Re: [sqlite] Create table error on AIX -- Unable to open database "mytest": SQL logic error or missing database

2008-04-06 Thread John Stanton
I had a problem compiling Sqlite on ealrier versions of AIX. It turned out to be a linker problem and compiling without the -g optimization solved the problem. What compiler are you using? Xlc or gcc? Chris Pierce wrote: > Hi, > > I am having problems with SQLite v3.5.7 on AIX v5.2. > > I

Re: [sqlite] What is the standard way to store dates and do operations with dates please?

2008-04-06 Thread John Stanton
Not a hack, but the traditional way to store dates and times. Sqlite functions use a magic epoch which facilitates the presentation of the date and time in the form of the major calendars. We do not use the Julian calendar these days. It was supplanted by the Gregorian in 1582. Julian

Re: [sqlite] 3.5.7 & TCL: "undefined symbol: sqlite3StrICmp"

2008-04-03 Thread John Stanton
Zbigniew Baniewski wrote: > I'm sorry to confirm the problem described at http://tinyurl.com/29wc8x > > #v+ > $ tclsh8.5 > % package require sqlite3 > couldn't load file "/usr/lib/sqlite3/libtclsqlite3.so.0": > /usr/lib/sqlite3/libtclsqlite3.so.0: undefined symbol: sqlite3StrICmp > #v-

Re: [sqlite] Clear screen in command line interface

2008-03-26 Thread John Stanton
Fred J. Stephens wrote: > Would it be possible to incorporate a clear screen command, like "clear" > in BASH? This would be handy to keep the view in the command line > interface uncluttered. > Maybe ".clear"? You have the source and it uses curses so the addition should be fairly simple. >

Re: [sqlite] BCD representation of floats

2008-03-26 Thread John Stanton
We actually added this type of capability to Sqlite (actually fixed point display format numbers), but it may be unnecessary in your case. Instead of representing integers as BCD how about using the 64 bit Sqlite integers? You may have sufficient precision. The COBOL-style COMP3 integers are

Re: [sqlite] paged query in sqlite

2008-03-25 Thread John Stanton
Do a SELECT, read 100 rows, then read another 100. Your program controls it. Shailesh Madhukar Birari wrote: > Does Sqlite support Paged query? what I mean is on doing select* it should > return me first, say 100, rows and then subsequent calls should return me > successive rows. > Is this

Re: [sqlite] performance under load

2008-03-24 Thread John Stanton
Sam Carleton wrote: > On Mon, Mar 24, 2008 at 4:11 PM, Jay A. Kreibich <[EMAIL PROTECTED]> wrote: > >> Try the math over: >> >> 24 hours * 60 minutes * 60 seconds = 86,400 seconds/day. >> >> 100,000 hits/day / 86,400 seconds/day = 1.1574 hits/sec (on average). >> >> Of course, this is on

Re: [sqlite] performance under load

2008-03-24 Thread John Stanton
My performance measurements using a modest server and a more efficient www server than Apache gives an Sqlite capability of 30-50 hits per second using simple SQL selects. Think of that as a reasonable upper limit. Jay A. Kreibich wrote: > On Mon, Mar 24, 2008 at 03:55:12PM -0400, Sam Carleton

Re: [sqlite] Command to create a database in sqlite

2008-03-24 Thread John Stanton
sqlite3_open. Mozaharul Haque wrote: > Hi, > > A silly asking. I found the command to create a table but what about to > create a database? > > The table would be stored in the sqlite_master table. > > And how do I refer (full path) to the database using application like > Basic4ppc 6.05. >

Re: [sqlite] Multiple Row Updates

2008-03-21 Thread John Stanton
Use this sequence - sqlite3_prepare_v2 while not finished sqlite3_bind_xxx sqlite3_step until SQLITE_DONE sqlite3_reset repeat sqlite3_finalize The sqlite3_reset readies the compiled statement for binding with another value. Derek Developer wrote: >

Re: [sqlite] Tables dropped (mac)

2008-03-21 Thread John Stanton
What was your filename? Janis Rough wrote: > I created some tables at the sqlite prompt using the terminal window on a > Mac. I checked with .tables and .schema and they were created and I > inserted data. I closed the terminal window and went back later. At the > sqlite prompt there were no

Re: [sqlite] Use of two columns for a key and query on first clm.

2008-03-20 Thread John Stanton
No, use ORDER BY Neville Franks wrote: > If I use two columns for a key (primary or separate index) and query > just on the first column component will I always get back the first > match in a set. For example. > > - > create table mytable ( clm1 text collate nocase, clm2 text collate

Re: [sqlite] Preventing Master Journal Files

2008-03-18 Thread John Stanton
Looks like Sqlite is not the right storage tool for your application since you don't want transactional integrity. How about something like Berkeley DB. Ken wrote: > Hello list, > > How do I prevent the creation of a journal file and a master journal file? I > need to be able to do this

Re: [sqlite] Database Table corrupt in SQLite v 3.4.0

2008-03-17 Thread John Stanton
How are you synchronizing your updates and reads? It looks like you may be missing a COMMIT. Bharath Booshan L wrote: > Ken, > > Thanks for reply, > > >>I would start with APP A to determine after processing that the data that you >>asked to be loaded is actually loaded. If it does not,

Re: [sqlite] Value between changes

2008-03-14 Thread John Stanton
Store your timestamp in the Sqlite format as a floating point number and use the built-in date functions. Bjørn T. Nøstdahl wrote: >>Can you give an example of the output? For example, do you want to >>know the difference between A0001 and A0002 or between to records with >>the same code? > >

Re: [sqlite] Rowid After Sorting

2008-03-14 Thread John Stanton
The rowid is the b-tree key for the row. You cannot change it. Mahalakshmi.m wrote: > Hi, > > I am working in 3.3.6 and my table looks like. > > > > Id - Integer Primary Key > > Name- Text > > > > Id Name > > 1 zzz > > 2

Re: [sqlite] SQLite and (high) concurrency

2008-03-11 Thread John Stanton
It looks as if you are not syncing correctly. Do you check for SQLITE_BUSY? If you are using transactions are you certain that you COMMIT? Are you using mutexes for synchronization or using the Sqlite BUSY checks? Tore Austraatt wrote: > Thanks, but I'm afraid this don't add up. > I have

Re: [sqlite] Can't get concat operator to work

2008-03-10 Thread John Stanton
The problem appears to be in your function. Post the code for it. [EMAIL PROTECTED] wrote: > > I'm trying to get the concat operator to work with my user-defined > function. This works fine: > > SELECT UPPER(FirstName) || ' ' || UPPER(LastName) FROM Employees > > But this doesn't

Re: [sqlite] Does an sqlite3_get_table() results set get updated.

2008-03-10 Thread John Stanton
Neville Franks wrote: > Hi John, > > Tuesday, March 11, 2008, 10:18:30 AM, you wrote: > > JS> Neville Franks wrote: > >>>Tuesday, March 11, 2008, 8:48:05 AM, you wrote: >>> >>>JAK> On Tue, Mar 11, 2008 at 08:37:27AM +1100, Neville Franks scratched on >>>the wall: >>> >>> >If I use

Re: [sqlite] Does an sqlite3_get_table() results set get updated.

2008-03-10 Thread John Stanton
Neville Franks wrote: > Tuesday, March 11, 2008, 8:48:05 AM, you wrote: > > JAK> On Tue, Mar 11, 2008 at 08:37:27AM +1100, Neville Franks scratched on > the wall: > >>>If I use sqlite3_get_table() and update/insert/delete one of the tables >>>in the original query, does the results set get

Re: [sqlite] SQLite and (high) concurrency

2008-03-10 Thread John Stanton
If your synchronization logic is sound Sqlite will not ignore inserts. Tore Austraatt wrote: > I find sqlite3 as the perfect choice for our embedded application - if it > hasn't been for the > issues concering concurrency. > My questions are; > 1. is the "default behaviour" from sqlite3 to

Re: [sqlite] group_concat for binary?

2008-03-09 Thread John Stanton
Why do you think a BLOB stores text more efficiently? Do you compress it? He Shiming wrote: > Hi, > > I would like to know if there is some workaround to use group_concat on > binary columns. > > For performance consideration, I need to query two tables and accomplish > data retrieval in a

Re: [sqlite] Beginners bad luck

2008-03-09 Thread John Stanton
./pdoTutorial.sqlite3'); > > }catch( PDOException $exception ){ > > die($exception->getMessage()); > > } > > > but got the following error message: > > Fatal error: Class 'PDO' not found in /home/zbfckla/public_html/Ocx.php on > line 14 > > > >

Re: [sqlite] Beginners bad luck

2008-03-09 Thread John Stanton
db and add a > table. But when downloaded from the server to my pc couldn't get hold of it. > I have a command-line program for accessing and modifying SQLite3 databases > which seems not to recognise it. How do I get one for sqlite2? > Thanks a lot > > - Original Message -

Re: [sqlite] Beginners bad luck

2008-03-09 Thread John Stanton
PHP has Sqlite V2 embedded. Use PDO to get Sqlite3. P Kishor wrote: > On 3/9/08, Aharon (Rony) Shapira <[EMAIL PROTECTED]> wrote: > >>Sorry. When I set $db and use $db the message I get is: >> >> Warning: sqlite_open() [function.sqlite-open]: file is encrypted or is not a >> database in

Re: [sqlite] [C] Linker Error

2008-03-08 Thread John Stanton
Looks like you need to include the shared library archive into your LIB list. Severin Müller wrote: > Hi folks > > I tried to include sqlite3 in my current C Project. > > I downloaded the precompiled library sqlite-3.5.6.so and put it in my project. > Then, i downloaded the sqlite source and

Re: [sqlite] Odd problem with select on large table

2008-03-07 Thread John Stanton
For SQL it needs to be 'key5000' not "key3000". James Kimble wrote: > On the command line: > > / > sqlite3 test.db `select name from PerfTest1 where name = "key5000"' > > does work. I know this because if I query for "key500" I get back that > row. It's not blanks either because if I > do: >

Re: [sqlite] Odd problem with select on large table

2008-03-07 Thread John Stanton
An SQL literal uses single quotes [EMAIL PROTECTED] wrote: > I created a 40 column table with 10,000 rows as a test database > for a reader and a writer process to bang on (performance proof). > > The table is as so: > > sqlite3 test.db 'create table PerfTest1 (name varchar(20), value1 int, >

Re: [sqlite] Newbie question re using SQLite in basic client/serversituation

2008-03-07 Thread John Stanton
Sqlite is an embedded database, not a server. If you want to use it for multiple clinets you really need to add a server which embeds Sqlite. When you do that it works well and will handle many remote clients. If you have multiple users on one machine you can use the inbuilt Sqlite

Re: [sqlite] How To concatenate two fields in one

2008-02-29 Thread John Stanton
Use the standard SQL || operator for concatenate. The + is not SQL and specific to SQl Server. Alessio Forconi wrote: > Hello everyone, > > This is my first message. > > I have a table called Students: > > IDStudent char(10) PRIMARY KEY, NOT NULL > Name char (30) NOT NULL > Surname char(30)

Re: [sqlite] DATETIME data type

2008-02-28 Thread John Stanton
Try using the Sqlite date functions. Yong Zhao wrote: > It seems that sqlite3 does not support DATETIME data type. > > If I have the following data in table t1, how do I select people who is > older than certain date? > > create table t1(dob text, name text); > insert into t1('11/12/1930',

Re: [sqlite] Prepare Statement

2008-02-28 Thread John Stanton
You misunderstand binding. You use it like this - sql - "SELECT name FROM customers WHERE cust_id = ?"; this_cust_id - "CUST1275"; sqlite3_prepare_v2(...); sqlite3)bind_text(..., 1, this_cust_id, ...); You bind a value to the data represented by the ?. Then you reuse the

Re: [sqlite] Question on Blobs

2008-02-28 Thread John Stanton
Just get a pointer to the data in the file and the number of bytes and use the sqlite API call to transfer it into the DB. You can get the pointer by either reading the file into local memory or by mmap'ing it. Also look at the API calls which let you process a blob in chunks. A BLOB is

Re: [sqlite] Question on Blobs

2008-02-28 Thread John Stanton
Rather than doing malloc you can mmap the file and then copy it into the blob. Peter A. Friend wrote: > On Feb 27, 2008, at 4:48 PM, Mike McGonagle wrote: > >> Hello all, >> I was hoping that someone might share some tips on working with >> Blobs? I >> would like to be able to store some

Re: [sqlite] IF...THEN constructs

2008-02-28 Thread John Stanton
Sqlite does not have a built in procedural language like PL/SQL. For certain applications we just added Javascript to cover that requirement. It was straightforward using Spidermonkey and had the advantage of being the same language used by the AJAX applications backended by Sqlite so

Re: [sqlite] Problem to compile 3.5.6.

2008-02-26 Thread John Stanton
Looks like you have compiled Sqlite to use readline but don't have the link library. David Michal wrote: > Hello, > > I have problem to compile it on Slackware 11 x86_64 > > > > gcc -g -O2 -I. -I../sqlite-3.5.6/src -DNDEBUG -DSQLITE_THREADSAFE=1 > -DSQLITE_THREAD_OVERRIDE_LOCK=-1

Re: [sqlite] How long time to index this table

2008-02-24 Thread John Stanton
I think that you have hit a situation where the sort and index build algorithm in Sqlite is a problem and gets limited by disk head seeking. Others know more about this situation but I don't think there is much you can do to improve the speed. Lars Aronsson wrote: > I have a database table with

Re: [sqlite] Reducing size of timestamps

2008-02-22 Thread John Stanton
Use the Sqlite method, a floating point number. Inbuilt functions support that technique. Rich Rattanni wrote: > All: > > I was wondering if there was any way to reduce the 'cost' of storing a > timestamp on entries in a SQLite database. I performed a hexdump of > the file and it showed me

Re: [sqlite] Optimization Question - multithread prepare ?

2008-02-20 Thread John Stanton
Mark Gilbert wrote: >> > - We don't currently prepare SQL statements in advance, would this >>> technique benefit from somehow preparing statements *before* that >>> thread gets the lock on the database ? Can we have multiple threads >>> using the SAME database connection preparing SQL

Re: [sqlite] which is faster, PHP or SQLite?

2008-02-18 Thread John Stanton
Sqlite uses cacheing. I would suggest not storing large amounts of data in PHP arrays. It is buffer shadowing. Ideally with Sqlite you would use a cursor (the sqlite3_step logic) and pick up rows as you need them from the Sqlite cache. Digging a string of holes and filling them in is a

Re: [sqlite] locking problem

2008-02-15 Thread John Stanton
Do you have posix-locks enabled with your glusterfs? If you have use regular Sqlite locking logic and hope that the locks work properly. Lanyi Zoltan wrote: > Hello! > > I have shared disc system with glusterfs. > When i read or write on this disc system then i get error: database is locked >

Re: [sqlite] Updatable views

2008-02-11 Thread John Stanton
[EMAIL PROTECTED] wrote: > John Stanton <[EMAIL PROTECTED]> wrote: >> That ia a nice idea. To have a pragma which specied the dialect. There >> could be "strict" or "ansi" and "mysql", "oracle", "sqlserver" etc etc. >

Re: [sqlite] Updatable views

2008-02-11 Thread John Stanton
That ia a nice idea. To have a pragma which specied the dialect. There could be "strict" or "ansi" and "mysql", "oracle", "sqlserver" etc etc. It would give tighter control over hard to track annoying minor syntax errors. Dennis Cote wrote: > BareFeet wrote: >> No, I have no MS legacy or

Re: [sqlite] INSERTing records in two tables?

2008-02-09 Thread John Stanton
last_row_id is not a function. It is a predefined value. Gilles wrote: > On Sat, 9 Feb 2008 08:41:56 -0500, "Igor Tandetnik" > <[EMAIL PROTECTED]> wrote: >> INSERT INTO phones (tel,id_customers) VALUES ('1234567',last_row_id()); > > Thanks, but I'm getting an error (FWIW, I'm using 3.5.4): > >

Re: [sqlite] How to select Strict Affinity or No Affinity modes?Attention: DRH

2008-02-08 Thread John Stanton
I found that it was a fairly simple change to Sqlite to stop it changing formats and causing grief. Out of the box it merges nicely with scripting environments like Javascript, Python and TCL but can be a pain in other places. Fortunately the changes needed where format changes are

Re: [sqlite] Version 3.2.2

2008-02-06 Thread John Stanton
Literals in SQL use single quotes. Walt wrote: > I have a table 'listings' with fields 'listnum', 'price' and 'buyer' etc. > > executing the following sql > > UPDATE listings SET buyer = "Price" WHERE listnum = 12345 > > results in the 'buyer' field being set to the contents of the 'price'

Re: [sqlite] Mailing List Changes

2008-02-05 Thread John Stanton
[EMAIL PROTECTED] wrote: > Doug Currie <[EMAIL PROTECTED]> wrote: >>> Please set the list so default reply is to the list. >> http://www.unicom.com/pw/reply-to-harmful.html >> > > One finds various screeds such as the one Doug references > above. And on the configuration screen for GNU mailman,

Re: [sqlite] Cache for SQLite

2008-01-24 Thread John Stanton
by exploiting cacheing. On Jan 24, 2008 9:38 PM, John Stanton <[EMAIL PROTECTED]> wrote: Using Apache is the problem. The connections are not persistent so caching is destroyed. It sounds like you are using CGI, and that makes it more so. Somevariant like fastcgi (?) might give you what yo

Re: [sqlite] Cache for SQLite

2008-01-24 Thread John Stanton
Using Apache is the problem. The connections are not persistent so caching is destroyed. It sounds like you are using CGI, and that makes it more so. Somevariant like fastcgi (?) might give you what you look for. Clark Christensen wrote: I don't think you're going to get the kind of

Re: [sqlite] Query problem

2008-01-23 Thread John Stanton
[EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: This appears to be slightly different than normal *nix globbing since SQLite uses '^' rather than '!' for the set inversion (if my reading of the source is correct). GLOB is suppose to exactly mimic Unix, except that SQLite does not break

Re: [sqlite] Program is crahed on sqlite3_bind_int

2008-01-21 Thread John Stanton
Did you change something on the machine. Is it Windows or Linux? Joanne Pham wrote: Thanks!! So how to fix this problem.. -JP - Original Message From: John Stanton <[EMAIL PROTECTED]> To: sqlite-users@sqlite.org Sent: Monday, January 21, 2008 3:11:52 PM Subject: Re: [

Re: [sqlite] How to create a database in run-time

2008-01-21 Thread John Stanton
Luis Esteban Fajardo Bravo wrote: Hi! we've using SQLite on our software since about a month ago, and still i have some questions about how does sqlite works at all. I have the following sourcecode to check if a database is already created, if yes then just open, if not, open it and create

Re: [sqlite] Program is crahed on sqlite3_bind_int

2008-01-21 Thread John Stanton
It is accessing a mutex. Looks like you have something wrong with a shared library or DLL. Joanne Pham wrote: Hi All, The exactly error message below: sqlite3_bind_int64 (pStmt=0x40058a28, i=1, iValue=10) at ./src/vdbeapi.c:897 897 ./src/vdbeapi.c: No such file or directory. in

Re: [sqlite] SQLite character comparisons

2008-01-20 Thread John Stanton
I would suggest that Sqlite is correct having regard to its universal variable length feature and single TEXT type. Compatibility would be achieved by not storing redundant trailing spaces if a string field is required. More efficient storage would be a bonus. Fowler, Jeff wrote: Hello

Re: [sqlite] Quick question about multithread and SQLITE_BUSY/SQLITE_LOCKED in 3.5.4

2008-01-20 Thread John Stanton
SELECT is read only. Think of an Sqlite lock as a lock on the journal file. The critical action of an Sqlite insert or update is to transfer the contents of the journal file to disk and verify that the write to disk has completed (the ACID feature). Apart from that it is read only.

Re: [sqlite] Quick question about multithread and SQLITE_BUSY/SQLITE_LOCKED in 3.5.4

2008-01-19 Thread John Stanton
Using read and write locks around your statements gives you protection and lets you compile without thread safe so that Sqlite does not use internal mutexes as much for synchronization saving you considerable overhead as well as avoiding the logic necessary to handle BUSYs from Sqlite and

Re: [sqlite] sqlite3 performace

2008-01-18 Thread John Stanton
John Stanton wrote: Philip Nick wrote: I tracked down the problem. I was linking an old version of sqlite3 (3.0.8). That was the old version we used. I apparently doesn't cache between calls. My code now performs IO very similar to the CLI. Each subsequent query once the db is open does

Re: [sqlite] sqlite3 performace

2008-01-18 Thread John Stanton
Philip Nick wrote: I tracked down the problem. I was linking an old version of sqlite3 (3.0.8). That was the old version we used. I apparently doesn't cache between calls. My code now performs IO very similar to the CLI. Each subsequent query once the db is open does not require re-reading the

Re: [sqlite] Can't understand out of memory error

2008-01-17 Thread John Stanton
Nemanja Čorlija wrote: On Jan 17, 2008 12:00 PM, Roger Binns <[EMAIL PROTECTED]> wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Nemanja Čorlija wrote: My problem is that I am running out of memory when trying to load 1.6GB sqlite3 db from disk to :memmory: db on a computer with 4GB of

Re: [sqlite] sqlite3 performace

2008-01-17 Thread John Stanton
Areyou doing an sqlite3_finalize and checking to see that you actually close the DB? Philip Nick wrote: Thanks for replying, I have tried moving the Open/Close outside the mutex no change. As for using our own mutex, we started with early versions of sqlite and had to come up with our own

Re: [sqlite] How do I get back command history in v3.5.4?

2008-01-16 Thread John Stanton
You might be having a library location problem between /usr/local/lib and where Ubuntu puts libraries, usr/lib. Fred J. Stephens wrote: On 1/16/08, John Stanton <[EMAIL PROTECTED]> wrote: Do you have readline installed on your Linux machine? If not download the package, configure and i

Re: [sqlite] How do I get back command history in v3.5.4?

2008-01-15 Thread John Stanton
Do you have readline installed on your Linux machine? If not download the package, configure and install. Then compile Sqlite with readline. Fred J. Stephens wrote: Just replaced SQLite v 3.42 on Kubuntu 7.10 with the new v3.45 binary downloaded from sqlite.org. it works fine, but now I

Re: [sqlite] Next Version of SQLite

2008-01-15 Thread John Stanton
[EMAIL PROTECTED] wrote: Joe Wilson <[EMAIL PROTECTED]> wrote: --- "D. Richard Hipp" <[EMAIL PROTECTED]> wrote: Sorry for the confusion. No problem. For what it's worth, I am also curious as to the final form of the VM opcode transformation. The number of opcodes generated by the various

Re: [sqlite] Using sqlite3 from multiple threads

2008-01-11 Thread John Stanton
I find it much simpler to put a mutex around the accesses (or make them a critical section). That serializes the access and avoids busy waits, retries etc. It will prevent a certain amount of read concurrency. but that may be insignificant. If you use pthreads and have plenty of reads for

Re: [sqlite] sqlite3_open16 used in Qt4

2008-01-10 Thread John Stanton
Sqlite will create a database if it does not find one. You really need to add a test for the existence of the file, such as an "access". Petr Vanek wrote: hello sqlite gang, I'd like to consult here some possible bug in Qt4 SQL library. I'm fixing one bug in my Qt4 based application and I

Re: [sqlite] "always-trim" - feature suggestion

2008-01-09 Thread John Stanton
Some of the correspondents seem to have lost track of the meaning of "Open Source". They have the source code and can build their own version which trims, slashes or even burns. They certainly do not have to inflict their particular needs or preferences on the whole user community. I am

Re: [sqlite] For Better Performance

2008-01-08 Thread John Stanton
Your disk is slow (large latency). Speeding that up to 7,500 or 15,000 RPM will help. Sreedhar.a wrote: Hi, I am using sqlite for meta data storage of audio files. I am storing the sqlite database in hard disk. The sector size of FAT file system is 512 bytes. Hard disk rpm is 4200 Page

Re: [sqlite] Trying to use SQLite3 with PHP5....

2008-01-04 Thread John Stanton
each year. :-) [EMAIL PROTECTED] wrote: John Stanton <[EMAIL PROTECTED]> wrote: You need to make a small change in the make file to get rid of the wretched tclsh and link sqlite3 from the library. Just use an earlier makefile as a template. The problem with the TCL dependency was re

Re: [sqlite] Trying to use SQLite3 with PHP5....

2008-01-04 Thread John Stanton
You need to make a small change in the make file to get rid of the wretched tclsh and link sqlite3 from the library. Just use an earlier makefile as a template. Philip Butler wrote: Hi all, I am revisiting this topic again - I have tried a LONG time ago and gave up I am wanting to

Re: [sqlite] Date Problems

2008-01-03 Thread John Stanton
Look at the Sqlite date functions. File date.c describes them. You may find that a custom function gives you exactly what you want. [EMAIL PROTECTED] wrote: Hi Kees Many thanks for your quick reply, but it doesn't give me the date i want. 2006/03/31 - 1 month should be 2006/02/28 whereas

Re: [sqlite] C API: Manifest type SQLITE_INTEGER: Is it 32- or 64-bit?

2008-01-03 Thread John Stanton
An integer is always 64 bits. Jerry Krinock wrote: I need to read an sqlite database generated by others. So I wrote an outer loop which steps through the rows of a table using sqlite3_step, and an inner loop which steps through the columns. The inner loop finds the type using

Re: [sqlite] Commit fails due to "database is locked" in active transaction

2008-01-03 Thread John Stanton
In a threaded environment the simple and effective solution is to synchronize your transactions with a mutex. You lose a little possible concurrency but if you do not need it you simplify the logic no end and have a more robust application. Using pthreads you can improve a little by using

Re: [sqlite] Date Problems

2008-01-02 Thread John Stanton
Rich Shepard wrote: On Thu, 3 Jan 2008, [EMAIL PROTECTED] wrote: The bottom line is that "one month ago" or "one month from now" is a fuzzy concept since months vary in length. This is a very interesting thread since so many business applications are highly dependent on dates, yet most

Re: [sqlite] Fastest way to check if new row or update existing one?

2007-12-31 Thread John Stanton
Did you try using INSERT OR REPLACE? Hugo Ferreira wrote: > Hmmm... Would it be possible to make a trigger on a table such that if any > update fails, it does an insert? > If so, then one would only need to issue updates. > > On Dec 26, 2007 11:35 AM, Kees Nuyt <[EMAIL PROTECTED]> wrote: > >>

Re: [sqlite] disable transaction support

2007-12-25 Thread John Stanton
The fastest performance you will get is with synchronous off. That will relax the ACID requirement on the COMMIT but it can be unsafe if you get a crash during the commit. Mohd Radzi Ibrahim wrote: Hi Rasanth, I'm not an expert in SQLite. Not sure what kind of performance gain you want to

Re: [sqlite] Fetch all result set to memory

2007-12-21 Thread John Stanton
Whichever way you do it Sqlite fetches the rows one by one. Ofir Neuman wrote: Hi, I'm using SQLite in a multithread application and I would like to fetch every select statement into the memory. I can't use sqlite3_get_table since it doesn't support Unicode as far as I know. Is there a

Re: [sqlite] SQLite for NAS storage - DVR like application

2007-12-19 Thread John Stanton
Trilok Soni wrote: Hi John, On Dec 18, 2007 11:53 PM, John Stanton <[EMAIL PROTECTED]> wrote: Sqlite depends upon POSIX file locks. It is no better or no worse than the POSIX lock implementation on your platform. Thanx for the reply. My platform is based on Linux running o

Re: [sqlite] sample code in C++ to get the data from sqlite database loop thru the record set

2007-12-18 Thread John Stanton
Here is a code fragment in C. You add the C++. Joanne Pham wrote: Hi All, If you have the sample code in C++ to run the command "Select column1, column2 from tablea" from C++ code and able to loop thru the record set to get each rows please share with me. Thanks in Advance, Joanne

Re: [sqlite] sqlite in a daemon

2007-12-18 Thread John Stanton
We do it. It works well. We use a thread for each connection and HTTP protocol. The DB connection stays open. It performs an XMLHttpRequest transaction in 20-40mS, depending on the SQL complexity. Jean-Christophe Roux wrote: Hello, I am considering writing a daemon that would keep the

Re: [sqlite] Re: :Using sqlite3_progress_handler for GUI application

2007-12-18 Thread John Stanton
Zbigniew Baniewski wrote: On Tue, Dec 18, 2007 at 02:10:02PM -0600, John Stanton wrote: It won't be ignored. If you have an index ordered in the sequence specified by the ORDER BY Sqlite will use that order instead of having to assemble the result set and sort it. To say it precisely

Re: [sqlite] Re: :Using sqlite3_progress_handler for GUI application

2007-12-18 Thread John Stanton
Zbigniew Baniewski wrote: One more thing: suppose, I created an index for the column "name". Should I then take care to avoid ending the clauses with "ORDER BY name" - or just it doesn't matter, and it'll be automatically ignored? It won't be ignored. If you have an index ordered in the

Re: [sqlite]:Using sqlite3_progress_handler for GUI application

2007-12-18 Thread John Stanton
If you store the last key and have an index on that key you will get each 100 at the same speed by getting the first 100 greater than your highest last key. Sreedhar.a wrote: Hi, Say,I am having 4 entries in the table ALBUM. "CREATE TABLE ALBUM (AlbumtId INTEGER PRIMARY KEY NOT

Re: [sqlite] SQLite for NAS storage - DVR like application

2007-12-18 Thread John Stanton
Sqlite depends upon POSIX file locks. It is no better or no worse than the POSIX lock implementation on your platform. We use Sqlite in a multi-user environment without dependency oin the POSIX locks by embedding it in a server using HTTP when it is on a remote machine. We get the small

Re: [sqlite] create table with datatype = DATE. SHould use as DATETIME or INTEGER.

2007-12-17 Thread John Stanton
code that work for C++ in this case. Sorry for the question. Thanks, JP - Original Message From: John Stanton <[EMAIL PROTECTED]> To: sqlite-users@sqlite.org Sent: Monday, December 17, 2007 12:59:00 PM Subject: Re: [sqlite] create table with datatype = DATE. SHould use as DA

Re: [sqlite] create table with datatype = DATE. SHould use as DATETIME or INTEGER.

2007-12-17 Thread John Stanton
AL instead of DATETIME. Thanks, Joanne - Original Message ---- From: John Stanton <[EMAIL PROTECTED]> To: sqlite-users@sqlite.org Sent: Monday, December 17, 2007 10:00:11 AM Subject: Re: [sqlite] create table with datatype = DATE. SHould use as DATETIME or INTEGER. If you declared yo

Re: [sqlite] create table with datatype = DATE. SHould use as DATETIME or INTEGER.

2007-12-17 Thread John Stanton
If you declared your date and time (timestamp) column DATETIME it will be floating point and will store date and time in 8 bytes. Use the FP bind function. If you make it a REAL instead of DATETIME your code will be clearer. Joanne Pham wrote: Hi All, I have two question regarding DATETIME

Re: [sqlite] Re: Improving performance of SQLite. Anyone heard of DeviceSQL?

2007-12-15 Thread John Stanton
l 'decent marketing" is measured by a simple objective test - did it sell? Even if you sell a dud and manage to avoid breach of contract litigation you cannot avoid the bad publicity and rumors of "that dog don't hunt". A. Pagaltzis wrote: * John Stanton <[EMAIL PROTECTED]> [2007

Re: [sqlite] SQLite and Columnar Databases

2007-12-15 Thread John Stanton
[EMAIL PROTECTED] wrote: Joe Wilson <[EMAIL PROTECTED]> wrote: --- [EMAIL PROTECTED] wrote: Joe Wilson <[EMAIL PROTECTED]> wrote: The reason why I asked is that I haven't had much luck with sqlite3 performance for databases larger than the size of RAM on my machine regardless of PRAGMA

Re: [sqlite] Improving performance of SQLite. Anyone heard of DeviceSQL?

2007-12-15 Thread John Stanton
This also is an anecdote from some time back. As we were signing a fairly significant software contract with a large organization their manager told us "You guys know nothing about marketing. Your presentation was unprofessional, no glossy brochures, no audio visuals and we would not have

Re: [sqlite] DeviceSQL

2007-12-14 Thread John Stanton
Samuel R. Neff wrote: -Original Message- From: John Stanton [mailto:[EMAIL PROTECTED] Sent: Friday, December 14, 2007 3:55 PM To: sqlite-users@sqlite.org Subject: Re: [sqlite] DeviceSQL ... is it not directly comparable to DeviceSQL unless the external compiler handles not only SQL

Re: [sqlite] create table with datatype = DATE - STORE as DATETIME or INTEGER.

2007-12-14 Thread John Stanton
d I create the column in DATETIME or the INTEGER to store the time. DATETIME has the value of GMT time. So I store this value as INTEGER then I need to convert datetime format but it will be use less space if I use the INTEGER. Please give me an advice. Thanks Joanne - Original Message ---- From: Jo

Re: [sqlite] DeviceSQL

2007-12-14 Thread John Stanton
We did that with our products which used byte code. Byte code compiled on earlier versions would run on later ones, but new code with the extra opcodes would not run on old interpreters. It protected customers who had lost their source code or were afraid to recompile after an upgrade

Re: [sqlite] DeviceSQL

2007-12-14 Thread John Stanton
ed product and that such a product has the potential of being less memory hungry than DeviceSQL simply by virtue of the higher information density of the VDBE target code compared to native machine instructions. Dennis Cote wrote: John Stanton wrote: DeviceSQL is not suitable for general purpose SQL

Re: [sqlite] DeviceSQL

2007-12-13 Thread John Stanton
Testing only finds bugs, it does not guarantee accuracy. Careful design however can establish accuracy, and to verify that methodology requires examination of the source code. James Steward wrote: steveweick wrote: Do you need to read the code to verify reliability as your next few

Re: [sqlite] DeviceSQL

2007-12-13 Thread John Stanton
I unfortunately missed the Encirq webinar thanks to a project commitment but have taken the time to download the Encirq demo and try to make good the loss. It has some user examples in source code which give an idea of how it functions, but the information on the product is sparse so it was

Re: [sqlite] create table with datatype = DATE

2007-12-13 Thread John Stanton
The type DATE is a declared type, not an actual type and has no effect u nless your code specifically picks it out as a declared type. To do what you want use a trigger on insert and update the date field with datetime('now'); Joanne Pham wrote: Hi All, I create the table as : create

Re: [sqlite] Improving performance of SQLite. Anyone heard of DeviceSQL?

2007-12-13 Thread John Stanton
[EMAIL PROTECTED] wrote: Ion Silvestru <[EMAIL PROTECTED]> wrote: SW: Richard, We have written to you directly before to ask you to stop the FUD and incorrect statements, and you have chosen to continue. I suggest you not waste everyone's time by circulating deliberately misleading

Re: [sqlite] Occasional Database is Locked Error

2007-12-12 Thread John Stanton
Your application needs to handle the synchronization logic since there is no DB server to do it for you. When you get a busy check you can pause for a short time and relaunch the query. Mark Riehl wrote: I'm running SQLite 3.4.1 under Linux. I have a C++ application that inserts records

Re: [sqlite] DeviceSQL

2007-12-12 Thread John Stanton
[EMAIL PROTECTED] wrote: John Stanton <[EMAIL PROTECTED]> wrote: I received an email promoting a DeviceSQL web presentation. It specifically targets Sqlite and promises 5X performance. If you view their web presentation and/or try out Encirq's products, I would be very interested t

[sqlite] DeviceSQL

2007-12-12 Thread John Stanton
I received an email promoting a DeviceSQL web presentation. It specifically targets Sqlite and promises 5X performance. For those interested - DeviceSQL vs. SQLite: Which Gets You the Most Efficient Embedded Database? DATE: Thursday, December 13th, 2007 TIME: Noon

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