[sqlite] How do I attach a database from C++?

2005-08-18 Thread Greg Stark
I'm having difficulty attaching a database from C++. Within my code, I'm using an sqlite3_prepare call: prepareResult = pSqlBundle->sqlite3_prepare (db_, "ATTACH DATABASE 'window_5.sdb' AS W5;", -1, , ); but it returns an error (i.e., prepareResult comes back as SQLITE_ERROR).

Re: [sqlite] Possible bug regarding endiannes and realstorageclass (sqlite3)

2005-08-18 Thread D. Richard Hipp
On Thu, 2005-08-18 at 23:08 +0200, Frank van Vugt wrote: > > Right. So for your ARM FP library, the code goes from > > Yep, will try that patch tomorrow morning, the soft-float cross-compiler > should be ready then as well, so we'll see if that makes any difference as > well. The code shown

Re: [sqlite] Possible bug regarding endiannes and realstorageclass (sqlite3)

2005-08-18 Thread Frank van Vugt
> Right. So for your ARM FP library, the code goes from Yep, will try that patch tomorrow morning, the soft-float cross-compiler should be ready then as well, so we'll see if that makes any difference as well. -- Best, Frank.

Re: [sqlite] modifying insert/updat data in triggers

2005-08-18 Thread Derrell . Lipman
Mark de Vries <[EMAIL PROTECTED]> writes: > But I still don't know how to do what I want to do. Perhaps I need to > explain with a litle more detail what I mean. Consider the following > table. > > create table foo ( > value TEXT, > date_create TEXT, > date_lch TEXT > ); > > Now, whenever I

Re: [sqlite] modifying insert/updat data in triggers (was: manipulating new.? in triggers)

2005-08-18 Thread D. Richard Hipp
On Thu, 2005-08-18 at 22:26 +0200, Mark de Vries wrote: > create table foo ( > value TEXT, > date_create TEXT, > date_lch TEXT > ); > > Now, whenever I insert into this table I want to set date_create to > CURRENT_TIMESTAMP. > > Whenever I update a row I want date_lch (lch=last change) to

Re: [sqlite] modifying insert/updat data in triggers

2005-08-18 Thread Puneet Kishor
Puneet Kishor wrote: I am jumping in the middle here, but... Mark de Vries wrote: On Thu, 18 Aug 2005, Kurt Welgehausen wrote: Is it possible to change the values of certain rows that are inserted into the database? ... I think everything you need is explained at

Re[2]: [sqlite] Possible bug regarding endiannes and realstorageclass (sqlite3)

2005-08-18 Thread Doug Currie
Thursday, August 18, 2005, 3:18:56 PM, Frank wrote: > I repeated the test using the value 1.2345678 in order to be > able to identify the position of each byte: > linux i386: > 1bde8342cac0f33f > 0100 > linux arm: > cac0f33f1bde8342 > 0100 > So, it indeed looks like

Re: [sqlite] modifying insert/updat data in triggers

2005-08-18 Thread Puneet Kishor
I am jumping in the middle here, but... Mark de Vries wrote: On Thu, 18 Aug 2005, Kurt Welgehausen wrote: Is it possible to change the values of certain rows that are inserted into the database? ... I think everything you need is explained at

Re: [sqlite] modifying insert/updat data in triggers (was: manipulating new.? in triggers)

2005-08-18 Thread Mark de Vries
On Thu, 18 Aug 2005, Kurt Welgehausen wrote: > > Is it possible to change the values of certain rows that > > are inserted into the database? ... > > I think everything you need is explained at > > . Yeah, I've read it. > If you don't

Re: [sqlite] Possible bug regarding endiannes and realstorageclass (sqlite3)

2005-08-18 Thread Frank van Vugt
I repeated the test using the value 1.2345678 in order to be able to identify the position of each byte: linux i386: 1bde8342cac0f33f 0100 linux arm: cac0f33f1bde8342 0100 So, it indeed looks like 32bits based middle-endian or something -- Best, Frank.

RE: [sqlite] Possible bug regarding endiannes and realstorageclass (sqlite3)

2005-08-18 Thread Thomas Briggs
I can also confirm that the original test case posted works correctly when moving the file from Linux to Sparc (Solaris) and PA-RISC (HP-UX). -Tom > -Original Message- > From: D. Richard Hipp [mailto:[EMAIL PROTECTED] > Sent: Thursday, August 18, 2005 2:21 PM > To:

Re: [sqlite] Possible bug regarding endiannes and real storageclass (sqlite3)

2005-08-18 Thread Frank van Vugt
> ARM has at least two FL formats. Yes, I'm currently rebuilding my crosscompiler with specific soft-float options, but it'll take a while. Also, it seems that apart from the endiannes of the processor, there's also 'endiannes of peripheral wiring', i.e. the way the memory is connected to the

Re[2]: [sqlite] Possible bug regarding endiannes and real storageclass (sqlite3)

2005-08-18 Thread Doug Currie
See http://lists.debian.org/debian-arm/2003/10/msg00030.html ARM has at least two FL formats. > from the ARM Architecture Reference Manual, Page C2-4: > > "The word order [for DP format] defined here for the VFP architecture > differs from that of the earlier FPA floating-point architecture. In

RE: [sqlite] Possible bug regarding endiannes and realstorageclas s (sqlite3)

2005-08-18 Thread Brandon, Nicholas
Richard, As of interest, I've modified your code below and ran on two systems: a) Sun Ultra-Enterprise SPARC (gcc) b) Windows XP AMD (VS .NET 2003) Code snippet: union utest { double r; long long i; unsigned char z[8]; }; float test_2; int main(int argc, char **argv){ union utest x;

Re: [sqlite] Possible bug regarding endiannes and real storageclass (sqlite3)

2005-08-18 Thread Frank van Vugt
Hi, > My test code is below. Please run this on your ARM and let > me know what you get. # ./test f03f 0100 It's getting smelly.. 32 bits only? -- Best, Frank.

Re: [sqlite] Possible bug regarding endiannes and real storageclass (sqlite3)

2005-08-18 Thread D. Richard Hipp
On Thu, 2005-08-18 at 14:10 -0400, D. Richard Hipp wrote: > On Thu, 2005-08-18 at 09:40 -0700, Robert Simpson wrote: > > http://www.psc.edu/general/software/packages/ieee/ieee.html > > > > The way I interpreted this site, is that the IEEE standard for floating > > point numbers was processor

Re: [sqlite] Possible bug regarding endiannes and real storageclass (sqlite3)

2005-08-18 Thread D. Richard Hipp
On Thu, 2005-08-18 at 09:40 -0700, Robert Simpson wrote: > http://www.psc.edu/general/software/packages/ieee/ieee.html > > The way I interpreted this site, is that the IEEE standard for floating > point numbers was processor agnostic and the storage of the bits went from > left to right. > I

Re: [sqlite] manipulating new.? in triggers

2005-08-18 Thread Kurt Welgehausen
> Is it possible to change the values of certain rows that > are inserted into the database? ... I think everything you need is explained at . If you don't understand how to get the current date in SQLite, look at the wiki page. Regards

RE: [sqlite] Possible bug regarding endiannes and real storagecla ss (sqlite3)

2005-08-18 Thread Brandon, Nicholas
>SQLite tries to store everything on disk as big-endian. That >means it always byte swaps on little-endian machines (basically, >ix86) and omits byte swapping for big-endian machines (which is >to say, everything other than ix86.) The byte swapping happens >for integers *and* floating-point

Re: [sqlite] Possible bug regarding endiannes and real storage class (sqlite3)

2005-08-18 Thread D. Richard Hipp
On Thu, 2005-08-18 at 12:24 -0400, D. Richard Hipp wrote: > On Thu, 2005-08-18 at 18:04 +0200, Frank van Vugt wrote: > > L.S. > > > > It looks like there's something wrong with the endiannes when using sqlite3 > > (v3.2.2) on an ARM architecture (SA1100 nanoboard) while storing floating > >

Re: [sqlite] C/C++ interpreter Ch bindings to sqlite

2005-08-18 Thread Kiel W.
> I wonder if it is possible > that sqlite will bundle the ch bindings source code together > for distribution. Peter, I don't speak for Dr. H or any of the developers/commiters, but asking Sqlite to package your software with your's seems a little backward. Their focus is on Sqlite, not your

Re: [sqlite] sqlite3_step() question

2005-08-18 Thread Kiel W.
> There's the possibility of make a function called > sqlite3_step_at_position()?! Is it not feasable to do this in your wrapper function? For instance, in the wrappers I've written an use, I return a set of "rows" and the user can manipulate them however they wish. In your application, this

Re: [sqlite] Possible bug regarding endiannes and real storageclass (sqlite3)

2005-08-18 Thread Robert Simpson
Original Message - From: "D. Richard Hipp" <[EMAIL PROTECTED]> To: Sent: Thursday, August 18, 2005 9:24 AM Subject: Re: [sqlite] Possible bug regarding endiannes and real storageclass (sqlite3) On Thu, 2005-08-18 at 18:04 +0200, Frank van Vugt wrote: L.S.

Re: [sqlite] blocking - busy_timeout vs database is locked(5)

2005-08-18 Thread Robert Simpson
- Original Message - From: "Jonathan H N Chin" <[EMAIL PROTECTED]> To: Sent: Thursday, August 18, 2005 8:00 AM Subject: [sqlite] blocking - busy_timeout vs database is locked(5) [snip] but I still occasionally get failures: DBD::SQLite::db do failed:

Re: [sqlite] Possible bug regarding endiannes and real storage class (sqlite3)

2005-08-18 Thread D. Richard Hipp
On Thu, 2005-08-18 at 18:04 +0200, Frank van Vugt wrote: > L.S. > > It looks like there's something wrong with the endiannes when using sqlite3 > (v3.2.2) on an ARM architecture (SA1100 nanoboard) while storing floating > point data. > SQLite assumes float point values are stored in the IEEE

[sqlite] manipulating new.? in triggers

2005-08-18 Thread Mark de Vries
Hi, Is it possible to change the values of certain rows that are inserted into the database? Let say I have a col that records the date the row it was entered. On insert I want to set it, and on update I want to make sure it's never altered. Also I have a col that records the date it was last

[sqlite] Possible bug regarding endiannes and real storage class (sqlite3)

2005-08-18 Thread Frank van Vugt
L.S. It looks like there's something wrong with the endiannes when using sqlite3 (v3.2.2) on an ARM architecture (SA1100 nanoboard) while storing floating point data. Databases created on i386 can basically be read and used on the ARM device and viceversa. However, data that is stored using

Re: [sqlite] blocking - busy_timeout vs database is locked(5)

2005-08-18 Thread Jonathan H N Chin
I should perhaps note that there are only around fifty accesses in any given five minute interval, so it is not as if anything is being overloaded. -jonathan -- Jonathan H N Chin, 2 dan | deputy computer | Newton Institute, Cambridge, UK <[EMAIL PROTECTED]> | systems mangler | tel/fax: +44

[sqlite] blocking - busy_timeout vs database is locked(5)

2005-08-18 Thread Jonathan H N Chin
With debian packages: sqlite3 3.2.1-1 libsqlite3-03.2.1-1 libdbd-sqlite3-perl 1.08-1 (with looks_like_number test elided) I have an sqlite3 database that is accessed by a perl cgi script. I want accesses

[sqlite] PBSDBMS, sqlite database tool

2005-08-18 Thread Edwin Knoppert
On my site http://www.hellobasic.com/ (free downloads) you can find PBSDBMS, a DBMS for sqlite v3.07 and up. Does handle the main aspects for sqlite like tables, columns, views and a few others.. Also does import and export. Blob data having nul chars is supported. An extensive querybuilder.