[sqlite] How can I change big-endian to little-endian in the database file

2007-04-03 Thread Martin Pfeifle
Dear all, in an upcoming project, it is required to store all integer values as little endian instead of big endian (don't ask why). Nevertheless, I would like to use SQLite in that project. What do we have to change in the sqlite library, if we store the integers as little endian. I came across

Re: [sqlite] How can I change big-endian to little-endian in the database file

2007-04-03 Thread drh
Martin Pfeifle <[EMAIL PROTECTED]> wrote: > Dear all, > in an upcoming project, it is required to store all integer > values as little endian instead of big endian (don't ask why). > Nevertheless, I would like to use SQLite in that project. > What do we have to change in the sqlite library, > if

Re: [sqlite] How can I change big-endian to little-endian in the database file

2007-04-03 Thread drh
Martin Pfeifle <[EMAIL PROTECTED]> wrote: > > in an upcoming project, it is required to store all > integer values as little endian instead of big endian... Does that mean you are not allowed to use TCP/IP which stores everything big-endian? ;-) -- D. Richard Hipp <[EMAIL PROTECTED]>

Re: [sqlite] How can I change big-endian to little-endian in the database file

2007-04-03 Thread Jakub Ladman
I think there is no need to change endianess. Sqlite is shadowing out this and similar low level aspects. If you need to get data from database and use it in something what needs it in other endianess, you may use something like this. int change_endianess(unsigned char *data, int length) {

[sqlite] How to reserve a specific size(for example 400k) when I create a database file?

2007-04-03 Thread Zhang Cheng-E7104C
I want to reserve a specific size for every database when it is created. Is that possible? Thanks - To unsubscribe, send email to [EMAIL PROTECTED]

Re: [sqlite] How to reserve a specific size(for example 400k) when I create a database file?

2007-04-03 Thread drh
"Zhang Cheng-E7104C" <[EMAIL PROTECTED]> wrote: > I want to reserve a specific size for every database when it is > created. > Is that possible? > This will only work if you do NOT enable auto-vacuum. To repeat: auto-vacuum must be switched off. When you create the database, create a table

[sqlite] exclusive2.test failures

2007-04-03 Thread Alexey Tourbin
Hello, With most recent sqlite3 cvs snapshot, some exclusive2 tests fail: $ ./testfixture test/exclusive2.test exclusive2-1.0... Ok exclusive2-1.1... Ok exclusive2-1.2... Ok exclusive2-1.3... Ok exclusive2-1.4... Ok exclusive2-1.5... Ok exclusive2-1.6... Ok exclusive2-1.7... Expected: [1]

Re: [sqlite] exclusive2.test failures

2007-04-03 Thread drh
Alexey Tourbin <[EMAIL PROTECTED]> wrote: > Hello, > > With most recent sqlite3 cvs snapshot, some exclusive2 tests fail: > Some tests fail *for you*. Other people report that everything is working fine, and indeed, we do not have any test failures on our Linux machines. Can you help us to

Re: [sqlite] exclusive2.test failures

2007-04-03 Thread Alexey Tourbin
On Tue, Apr 03, 2007 at 12:20:27PM +, [EMAIL PROTECTED] wrote: > Some tests fail *for you*. Other people report that everything > is working fine, and indeed, we do not have any test failures Sure. The implied question was whether the test failures are easily reproducible, and if they are,

[sqlite] create or update question

2007-04-03 Thread Eric S. Johansson
I'm trying to figure out how to do do the following: if the record exists Update record with calculation ( a = a + v) else insert record with default values It seems like the "insert or replace into" capabilities is close to what I need but I can't figure out how to update with a default

[sqlite] Re: create or update question

2007-04-03 Thread Igor Tandetnik
Eric S. Johansson <[EMAIL PROTECTED]> wrote: I'm trying to figure out how to do do the following: if the record exists Update record with calculation ( a = a + v) else insert record with default values It seems like the "insert or replace into" capabilities is close to what I need but I

Re: [sqlite] exclusive2.test failures

2007-04-03 Thread drh
Alexey Tourbin <[EMAIL PROTECTED]> wrote: > > I have a few other modifications in which my sqlite3 snapshot differs > from that of cvs, which are > 1) debian patch for lemon, > 2) backward compatibility fix for nbytes==0 in sqlite3Prepare(), > 3) O_NOATIME flag in sqlite3CrashOpenExclusive() with

Re: [sqlite] Version 3.3.14

2007-04-03 Thread Gunnar Roth
[EMAIL PROTECTED] schrieb: SQLite version 3.3.14 is now available on the SQLite website We have also added the concept of "exclusive access mode". In exclusive access mode, SQLite holds onto locks until you close the connection I should maybe made clear that this new behaviour influences

Re: [sqlite] Version 3.3.14

2007-04-03 Thread drh
Gunnar Roth <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] schrieb: > > SQLite version 3.3.14 is now available on the SQLite website > > We have also added > > the concept of "exclusive access mode". In exclusive access > > mode, SQLite holds onto locks until you close the connection > > >

[sqlite] Insertion failed because database is full.

2007-04-03 Thread Joel Cochran
Hi all, I have searched the web, the newsgroups, and the archives, but all I can find is one reference to someone having this trouble with Python and a bunch of references that list this as predefined error #13 according to http://www.sqlite.org/capi3.html. What I can't find is any help in

Re: [sqlite] exclusive2.test failures

2007-04-03 Thread Alexey Tourbin
On Tue, Apr 03, 2007 at 01:52:30PM +, [EMAIL PROTECTED] wrote: > Alexey Tourbin <[EMAIL PROTECTED]> wrote: > > > > I have a few other modifications in which my sqlite3 snapshot differs > > from that of cvs, which are > > 1) debian patch for lemon, > > 2) backward compatibility fix for

[sqlite] -O3 compile w/ SQLite 3.3.14 (current cvs) Results

2007-04-03 Thread Kon Lovett
Hi, I recall a request for -O3 optimization results w/ the current source. MacOS X 10.4.9 GCC 4.0.1 (Apple Extensions) PowerPC G4 (32-bit) Tcl 8.4 Configure: --enable-threadsafe --enable-cross-thread-connections -- enable-threads-override-locks --enable-tempstore Optimization Flags: -O3

RE: [sqlite] Difference in these indices?

2007-04-03 Thread McDermott, Andrew
Hi, > > It might make sense to create a separate standalone utility program > > (like sqlite3_analyzer) that reuses some the sqlite source > to do bulk > > inserts into a table in a database file as fast a possible with out > > having to worry about locking or journaling etc. > > That

Re: [sqlite] -O3 compile w/ SQLite 3.3.14 (current cvs) Results

2007-04-03 Thread drh
Kon Lovett <[EMAIL PROTECTED]> wrote: > Hi, > > I recall a request for -O3 optimization results w/ the current source. > > MacOS X 10.4.9 > GCC 4.0.1 (Apple Extensions) > PowerPC G4 (32-bit) > Tcl 8.4 > > Configure: --enable-threadsafe --enable-cross-thread-connections -- >

Re: [sqlite] exclusive2.test failures

2007-04-03 Thread Dan Kennedy
> exclusive2-1.7... > Expected: [1] > Got: [2] > exclusive2-1.9... > Expected: [1] > Got: [0] > exclusive2-1.10... Ok > exclusive2-1.11... Ok > exclusive2-2.1... Ok > exclusive2-2.2... Ok > exclusive2-2.3... Ok > exclusive2-2.4... Ok > exclusive2-2.5... > Expected: [5] > Got: [3] >

RE: [sqlite] Version 3.3.14

2007-04-03 Thread Noah Hart
I found it, I was using an old sqlite3.def file for the exports. Regards, Noah -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, April 02, 2007 10:00 AM To: sqlite-users@sqlite.org Subject: Re: [sqlite] Version 3.3.14 "Noah Hart" <[EMAIL PROTECTED]>

Re: [sqlite] SQL language issue, ticket #2282

2007-04-03 Thread Ken
Oracle does not allow a when clause on an instead of trigger. when new.key=old.key * ERROR at line 3: ORA-25004: WHEN clause is not allowed in INSTEAD OF triggers [EMAIL PROTECTED] wrote: Ticket #2282 against SQLite http://www.sqlite.org/cvstrac/tktview?tn=2282 complains

[sqlite] sqlite and generate dynamic html

2007-04-03 Thread Vivek Rajan
Hello SQLite Community- For a personal project, I need to dynamically create HTML pages from an on-disk SQLite database. I don't need cross-network capability, I just need the ability to query and dynamically generate HTML from an on-disk SQLite database on a localhost (stand-alone unix

Re: [sqlite] -O3 compile w/ SQLite 3.3.14 (current cvs) Results

2007-04-03 Thread Kon Lovett
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Apr 3, 2007, at 9:14 AM, [EMAIL PROTECTED] wrote: Kon Lovett <[EMAIL PROTECTED]> wrote: Hi, I recall a request for -O3 optimization results w/ the current source. MacOS X 10.4.9 GCC 4.0.1 (Apple Extensions) PowerPC G4 (32-bit) Tcl 8.4

[sqlite] Default sqlite memory management policy

2007-04-03 Thread Rich Rattanni
All: I was wondering exactly how SQLite handles freeing memory used from the heap when compiled without SQLITE_ENABLE_MEMORY_MANAGEMENT? Will absolutely no memory be freed, or is there some default memory management scheme used?

Re: [sqlite] Index creation

2007-04-03 Thread John Stanton
There is an important element to bear in mind when using mmaping to take advanrage of physical memory. The POSIX advisory file locks are not necessarily effective in that mode. Joe Wilson wrote: Sure, pre-caching is a hack - but a very effective one. It has also been suggested to use

Re: [sqlite] How can I change big-endian to little-endian in the database file

2007-04-03 Thread John Stanton
A very efficient way to re-arrange the byte ordering is to use a free union. No function calls involved or tests. Jakub Ladman wrote: I think there is no need to change endianess. Sqlite is shadowing out this and similar low level aspects. If you need to get data from database and use it in

Re: [sqlite] sqlite and generate dynamic html

2007-04-03 Thread John Stanton
What does the HTML have to do? Vivek Rajan wrote: Hello SQLite Community- For a personal project, I need to dynamically create HTML pages from an on-disk SQLite database. I don't need cross-network capability, I just need the ability to query and dynamically generate HTML from an on-disk

Re: [sqlite] sqlite and generate dynamic html

2007-04-03 Thread Cesar Rodas
PHP + SQLite... is the easiest way to develop something... On 03/04/07, John Stanton <[EMAIL PROTECTED]> wrote: What does the HTML have to do? Vivek Rajan wrote: > Hello SQLite Community- > > For a personal project, I need to dynamically create HTML pages from an > on-disk SQLite database. I

[sqlite] Re: SQL help

2007-04-03 Thread Igor Tandetnik
Clark Christensen wrote: I have a table, as described below, where I need to find out if the tech_id in question has at least some modules in a particular collection (coll_id), and they're all complete. select coalesce(min(is_complete), 0) from tech_modules where tech_id=? and coll_id=?;

Re: [sqlite] SQL language issue, ticket #2282

2007-04-03 Thread Dennis Cote
[EMAIL PROTECTED] wrote: Ticket #2282 against SQLite http://www.sqlite.org/cvstrac/tktview?tn=2282 complains that in an INSTEAD OF trigger on a view where the trigger has a WHEN clause, if the WHEN clause is false and the trigger does not fire, then the UPDATE statement that provoked the

Re: [sqlite] SQL help

2007-04-03 Thread Dennis Cote
Clark Christensen wrote: I have a table, as described below, where I need to find out if the tech_id in question has at least some modules in a particular collection (coll_id), and they're all complete. At this point, I'm working with variations on: select (select count(*) from

Re: [sqlite] Re: create or update question

2007-04-03 Thread Eric S. Johansson
Igor Tandetnik wrote: Eric S. Johansson <[EMAIL PROTECTED]> wrote: I'm trying to figure out how to do do the following: if the record exists Update record with calculation ( a = a + v) else insert record with default values It seems like the "insert or replace into" capabilities is close

[sqlite] Newbee Question

2007-04-03 Thread nshaw
I upgraded from 3.3.1.3 to 3.3.1.4. Up till now, I've been experimenting with SQLite3 via the CLP. Now, I'm trying to access a DB via a C program but I'm getting errors. Here's a small code fragment: #include #include #include "sqlite3.h" int main (int argc, char **argv) { sqlite3 *db;

Re: [sqlite] Re: create or update question

2007-04-03 Thread Mark Richards
Eric S. Johansson wrote: if the insert fails (i.e. record exists), it triggers an exception which I use to trigger an update. I get many more updates than inserts of course but I haven't figured out how to trigger an exception on update if the record doesn't exist. From the FWIW dept,

Re: [sqlite] sqlite and generate dynamic html

2007-04-03 Thread Vivek Rajan
I need to generate dynamic HTML from contents in the SQLite database. Display some text/tables and related. Upon clicking on the web-page, the web-page can generate another query and display subsequent queries as HTML on the web. On 4/3/07, John Stanton <[EMAIL PROTECTED]> wrote: What does the

Re: [sqlite] SQL help

2007-04-03 Thread Ken
sum(is_complete) is only the same as "where is_complete = 1" when there is a check constraint guaranteeing that is complete will either be a 0 or 1. Dennis Cote <[EMAIL PROTECTED]> wrote: Clark Christensen wrote: > I have a table, as described below, where I need to find out if the tech_id

Re: [sqlite] sqlite and generate dynamic html

2007-04-03 Thread Cesar Rodas
Take a look here http://www.php.net/sqlite On 03/04/07, Vivek Rajan <[EMAIL PROTECTED]> wrote: I need to generate dynamic HTML from contents in the SQLite database. Display some text/tables and related. Upon clicking on the web-page, the web-page can generate another query and display

Re: [sqlite] SQL help

2007-04-03 Thread Clark Christensen
>You could try this: > select count(*) as mcount, sum(is_complete) as mcomplete > from tech_modules > where tech_id = ? and coll_id = ?; Dennis, Yeah, that's much cleaner. Just once through the tech's module set instead of twice, and it satisfies both requirements (at least some modules,

Re: [sqlite] sqlite and generate dynamic html

2007-04-03 Thread John Stanton
You can use PHP to do that. We are completing an application server which embeds Sqlite plus other processors and both generates HTML and supports AJAX style dynamic HTML by implementing remote procedure calls delivering JSON or XML encapsulated data. It is not quite ready yet but you can

Re: [sqlite] SQL help

2007-04-03 Thread Dennis Cote
Clark Christensen wrote: Yeah, that's much cleaner. Just once through the tech's module set instead of twice, and it satisfies both requirements (at least some modules, and all complete). Thanks again! Clark, You are welcome. You should probably look at Igor's idea though. It will

Re: [sqlite] SQL help

2007-04-03 Thread Dennis Cote
Ken wrote: sum(is_complete) is only the same as "where is_complete = 1" when there is a check constraint guaranteeing that is complete will either be a 0 or 1. Yes, that is true, and you could sum(is_complete != 0) if you want to be extra careful. This uses a C like definition of true

Re: [sqlite] sqlite and generate dynamic html

2007-04-03 Thread Vivek Rajan
Thanks everyone. Appreciate your help. I am most proficient with PERL and was hoping to use PERL. PHP looks interesting. John- How do you generate AJAX style dynamic HTML? Can you provide more info? On 4/3/07, John Stanton <[EMAIL PROTECTED]> wrote: You can use PHP to do that. We are

Re: [sqlite] exclusive2.test failures

2007-04-03 Thread Alexey Tourbin
On Tue, Apr 03, 2007 at 11:03:54PM +0700, Dan Kennedy wrote: > > exclusive2-1.7... > > Expected: [1] > > Got: [2] > > exclusive2-1.9... > > Expected: [1] > > Got: [0] > > exclusive2-1.10... Ok > > exclusive2-1.11... Ok > > exclusive2-2.1... Ok > > exclusive2-2.2... Ok > >

Re: [sqlite] sqlite and generate dynamic html

2007-04-03 Thread John Stanton
Vivek Rajan wrote: Thanks everyone. Appreciate your help. I am most proficient with PERL and was hoping to use PERL. PHP looks interesting. John- How do you generate AJAX style dynamic HTML? Can you provide more info? Sure. I wrote a compiler and a virtual machine for a simple language which

[sqlite] Novice help

2007-04-03 Thread Raju Penmetsa
Hi, I am completely new to SQlite. I have a faint idea of SQL from MS Access queries. I need to develop some crosstab queries on these huge databases (~14 million records), which I am not able to, in MS Access. I downloaded all the Windows binary files of SQlite on the download page of

Re: [sqlite] sqlite and generate dynamic html

2007-04-03 Thread Clark Christensen
Vivek, You ask a very broad question. I wouldn't know where to begin with code samples. If you were to ask for some specific, "how do I do...?" questions, I'm sure you'd get some code examples. You'll need to get the DBI modules installed, and the DBD-SQLite driver module installed into

Re: [sqlite] Novice help

2007-04-03 Thread John Stanton
It will be created in your current working directory. Raju Penmetsa wrote: Hi, I am completely new to SQlite. I have a faint idea of SQL from MS Access queries. I need to develop some crosstab queries on these huge databases (~14 million records), which I am not able to, in MS Access. I

[sqlite] Re: Novice help

2007-04-03 Thread Igor Tandetnik
Raju Penmetsa wrote: I downloaded all the Windows binary files of SQlite on the download page of sqlite.org. I extracted all of them into separate folders. Now, when I open sqlite3.exe in a DOS window and type - "sqlite3 new.db", it should create a new db if there is none already existing,

Re: [sqlite] Using the Sqlite Btree Backend directly

2007-04-03 Thread Raymond Hurst
I am an extreme newbie at this and I am open to suggestions: My requirements are: Smallest footprint possible ACID requirements (transactional rollback a must) Be able to create tables with fields that have name/value pairs. Not sure what else! If a dBase derivative meets these

Re: [sqlite] Novice help

2007-04-03 Thread Clark Christensen
Once you create a table, new.db will appear on disk in the default directory. Have a look at SQLite Spy (http://www.yunqa.de/delphi/sqlitespy/) and SQLite Explorer (http://www.singular.gr/sqlite/). Both are decent Windows GUI tools for SQLite. Neither provides much of a UI for data entry, but

Re: [sqlite] sqlite and generate dynamic html

2007-04-03 Thread P Kishor
On 4/3/07, Vivek Rajan <[EMAIL PROTECTED]> wrote: Hello SQLite Community- For a personal project, I need to dynamically create HTML pages from an on-disk SQLite database. I don't need cross-network capability, I just need the ability to query and dynamically generate HTML from an on-disk SQLite