RE: [sqlite] backup open database

2005-04-30 Thread Damian Slee
hi,
i had have a look, i may be able to use this.  this will be in an embedded 
hardware application, so i don't have a command line, only what i code in. 

i was hoping to do a binary copy of the db from a ram file system to flash 
memory for permanent storage.  flash is really slow, so a copy would be a lot 
quicker than a series of .dump Inserts.  which really requires sqlite running 
on a flash file system as well.  a copy is really all i want, but knowing when 
everything is commited, or locking out other threads without them having to 
close the db.

thanks,

damian

 




From: Mrs. Brisby [mailto:[EMAIL PROTECTED]
Sent: Sun 1/05/2005 1:07 AM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] backup open database



Why is it inappropriate to use:

sqlite originaldb ".dump" | sqlite backupdb


On Sun, 2005-05-01 at 00:28 +0800, Damian Slee wrote:
> hi all,
> i want to make a copy of a sqlite3 database file while it is open.  is there 
> anyway that i can tell programatically that any caches/journals are flushed 
> out? or is there any way to get and exclusive lock i guess, before making a 
> backup copy?
>
> my proposed application would have quite a few threads which may have the 
> same sqlite db open for read or write (rarer), but i dont want to shut down 
> the application to definitely know it is safe to copy.
>
>
> thanks,
>
> damian






[sqlite] Tricky SQL Statement

2005-04-30 Thread Murray Moffatt
I wonder if someone could please help me with a tricky SQL statement that  
I'm trying to create in SQLite.

I have four tables: Charts, Colours, MaterialTypes, Materials.
There is a one-to-many relationship between the Charts and Colours (i.e.  
each Chart can have 0 or more Colours).  There is a one-to-many  
relationship between the MaterialTypes and Materials (i.e. each  
MaterialType can have 0 or more Materials).  There is a one-to-one  
relationship between the Colours and Materials (each Colour record will  
have one Material record).

The fields in the tables look like this:
Charts:
ChartNum INTEGER PRIMARY KEY
Title VARCHAR (60)
Colours:
ChartNum INTEGER NOT NULL
MaterialType VARCHAR (10) NOT NULL
MaterialCode VARCHAR (10) NOT NULL
Quantity NUMERIC DEFAULT 0
MaterialTypes:
Code VARCHAR (10) NOT NULL
Description VARCHAR (50) NOT NULL
Materials:
MaterialType VARCHAR (10) NOT NULL
MaterialCode VARCHAR (10) NOT NULL
Description VARCHAR (50)
Quantity INTEGER DEFAULT 0
Each Colour has a Quantity field to record how many of each colour is  
required.  And the Materials also has a Quantity field to record how many  
of each material I have on hand.

So, for example, to make a particular chart I have to look at all of the  
colours that the chart uses and see how many of each colour I need.  Then  
I need to look at the materials to see if I have enough of those colours  
on hand.  An example:

Chart number 1 requires the following colours:
MaterialType = Acrylic   MaterialCode = Blue   Quantity = 1
MaterialType = Acrylic   MaterialCode = RedQuantity = 2
MaterialType = EnamelMaterialCode = Blue   Quantity = 1
If I look up the colours in the Materials table I might find the following:
MaterialType = Acrylic   MaterialCode = Blue   Quantity = 5
MaterialType = Acrylic   MaterialCode = RedQuantity = 1
MaterialType = EnamelMaterialCode = Blue   Quantity = 25
With this example I can't make Chart 1 because I don't have enough Acrylic  
Red (I need at lease 2 and there's only 1 on hand).  But I've got more  
than enough of the other colours.

What I need is an SQL statement that will give me the ChartNum's of all  
the Charts that I can make with my current stock of Materials.  I suspect  
I'm going to need some sort of inner join that can compare the two  
Quantity fields and only include the ChartNum for those records where the  
Materials.Quantity is >= Colours.Quantity for all Colours for a particular  
Chart.  Is that possible?


Re: Re: [sqlite] Have SQLite and it's wrappers a possibility to use inmemory tables ? QID129 (KMM126091V41895L0KM)

2005-04-30 Thread PayPal Customer Service 1
Thank you for contacting PayPal. I am not sure what your email to us is
referring to. Please be more specific or supply a case number.

Please let me know if you need further assistance.

Sincerely,
Stephanie
PayPal Resolutions Department
PayPal, an eBay Company



Original Message Follows:

take a look at "attach" in the docs
On 4/28/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Hi !
>
> I need to create a program in Delphi/Windows. I think that SQLite is
> best for it.
> But:
> I need inmemory tables with "infile tables".
>
> This app. is get many datas from another DB. But because these datas are
> not fitted in memory, I need SQLite to put them into local file/local DB.
> But I want to use some datas in memory - with same functions like SQLite
> base functions (so I don't want to write them to file, I want to use
> them as in memory).
>
> So: is SQLite supports the inmemory tables, and inmemory SQL commands ?
>
> Please help me:
> ft
>
> Ps:
>  Ok, I can use Delphi records, Delphi datasets to store inmemory datas.
> But they are not joinable with infile tables... :-(
>
>
--
Cory Nelson
http://www.int64.org




[sqlite] SqliteExplorer and ISO8601 dates

2005-04-30 Thread Brad Schick
Is it possible to get SqliteExplorer to parse textual dates in the
ISO8601 format of:

-MM-dd HH-mm-ss

I believe this is the format that sqlite uses itself for
CURRENT_TIMESTAMP, et. al.

I'm running SqliteExplorer 1.3 on WinXP with "Use Datatypes" and
"Dates as Text" enabled and it only seems to parse dates slash
seperators like 2005/04/27. Of course I can work around this by
disabling datatypes, but I like the extra error checking provided by
datatypes.

Thanks,
-Brad


Re: [sqlite] Patch suggestion for sqlite3.h

2005-04-30 Thread Václav Haisman
Easier for whom?
I want my C++ code to be as close to standard as possible and -ansi
-pedantic helps me a lot. I do not see any reason why should SQLite
force me not to use those switches when there is easy way to fix the
problem.

VH

> On Sat, 2005-04-30 at 13:51 +0200, VÃclav Haisman wrote:
> > Hi, for me to be able to use SQLite3 with C++ sources that use -ansi
> > -pedantic with GCC I need following tiny patch:
> > 
> 
> Wouldn't it be easier to *not* compile with -ansi -pedantic?
> -- 
> D. Richard Hipp <[EMAIL PROTECTED]>


Re: [sqlite] backup open database

2005-04-30 Thread Mrs. Brisby
Why is it inappropriate to use:

sqlite originaldb ".dump" | sqlite backupdb


On Sun, 2005-05-01 at 00:28 +0800, Damian Slee wrote:
> hi all,
> i want to make a copy of a sqlite3 database file while it is open.  is there 
> anyway that i can tell programatically that any caches/journals are flushed 
> out? or is there any way to get and exclusive lock i guess, before making a 
> backup copy?
>  
> my proposed application would have quite a few threads which may have the 
> same sqlite db open for read or write (rarer), but i dont want to shut down 
> the application to definitely know it is safe to copy.
>  
> 
> thanks,
>  
> damian



[sqlite] backup open database

2005-04-30 Thread Damian Slee
hi all,
i want to make a copy of a sqlite3 database file while it is open.  is there 
anyway that i can tell programatically that any caches/journals are flushed 
out? or is there any way to get and exclusive lock i guess, before making a 
backup copy?
 
my proposed application would have quite a few threads which may have the same 
sqlite db open for read or write (rarer), but i dont want to shut down the 
application to definitely know it is safe to copy.
 
 
thanks,
 
damian


Re: [sqlite] SQLite on Tiger.

2005-04-30 Thread Will Leshner
On 4/29/05, Bill Bumgarner <[EMAIL PROTECTED]> wrote:

> Tiger ships with SQLite 3.1.3 + a couple of tweaks.   Specifically,
> the SQLite3 on Tiger supports locking on network filesystems,
> including AFP and Samba.

Woohoo!


Re: [sqlite] Patch suggestion for sqlite3.h

2005-04-30 Thread D. Richard Hipp
On Sat, 2005-04-30 at 13:51 +0200, VÃclav Haisman wrote:
> Hi, for me to be able to use SQLite3 with C++ sources that use -ansi
> -pedantic with GCC I need following tiny patch:
> 

Wouldn't it be easier to *not* compile with -ansi -pedantic?
-- 
D. Richard Hipp <[EMAIL PROTECTED]>



Re: [sqlite] Problems with TCL-Tests

2005-04-30 Thread D. Richard Hipp
On Sat, 2005-04-30 at 09:50 +0200, Michael Link wrote:
> Error: syntax error in expression "int(pow(2,$i))": extra tokens at end 
> of expression
> 
> Am I missing something here, perhaps a mathematical extension for TCL ?
> 

What you type above is a valid Tcl expression.  It is part of
the core library and has been for time out of mind.  I do not
have any ideas about what could be going wrong.
-- 
D. Richard Hipp <[EMAIL PROTECTED]>



Re: [sqlite] OT: General SQL Question

2005-04-30 Thread Patrick Dunnigan
The it would be something like


select A.item1,A.item2, B.col1, B.col2, C.supplier_name
from audititems A, audits B, suppliers C
where A.parentauditid = B.parentauditid
and B.supplierid = C.supplierid
and < rest of where clause >

- Original Message - 
From: "Dan Keeley" <[EMAIL PROTECTED]>
To: 
Sent: Saturday, April 30, 2005 7:36 AM
Subject: Re: [sqlite] OT: General SQL Question


well audititems has a field parentauditid which links into audits.  Audits
has a supplierid field which is the key on suppliers..

From: "Patrick Dunnigan" <[EMAIL PROTECTED]>
Reply-To: sqlite-users@sqlite.org
To: 
Subject: Re: [sqlite] OT: General SQL Question
Date: Sat, 30 Apr 2005 07:16:55 -0400

It is possible depending on the make up of the tables.

post the table structures and index / keys and I'll help


- Original Message -
From: "Dan Keeley" <[EMAIL PROTECTED]>
To: 
Sent: Saturday, April 30, 2005 6:38 AM
Subject: [sqlite] OT: General SQL Question


Hi, I know this isnt related to SQLite, however i dont really know where
else to ask.

I have 3 tables - Supplier, Audits and Audititems.

At the moment, i select and join audits and Audititems and it works great.
However i need fields from the supplier chain, so i effectively need to do a
3 way join.

Is this possible?

Thanks!
Dan






[sqlite] Patch suggestion for sqlite3.h

2005-04-30 Thread Václav Haisman
Hi, for me to be able to use SQLite3 with C++ sources that use -ansi
-pedantic with GCC I need following tiny patch:

--- sqlite/sqlite3.h
+++ sqlite/sqlite3.h
@@ -81,9 +81,12 @@
 #if defined(_MSC_VER) || defined(__BORLANDC__)
   typedef __int64 sqlite_int64;
   typedef unsigned __int64 sqlite_uint64;
+#elif defined(__GNUC__)
+  __extension__ typedef long long int sqlite_int64;
+  __extension__ typedef unsigned long long int sqlite_uint64;
 #else
   typedef long long int sqlite_int64;



VH




Re: [sqlite] OT: General SQL Question

2005-04-30 Thread Dan Keeley
well audititems has a field parentauditid which links into audits.  Audits 
has a supplierid field which is the key on suppliers..

From: "Patrick Dunnigan" <[EMAIL PROTECTED]>
Reply-To: sqlite-users@sqlite.org
To: 
Subject: Re: [sqlite] OT: General SQL Question
Date: Sat, 30 Apr 2005 07:16:55 -0400
It is possible depending on the make up of the tables.
post the table structures and index / keys and I'll help
- Original Message -
From: "Dan Keeley" <[EMAIL PROTECTED]>
To: 
Sent: Saturday, April 30, 2005 6:38 AM
Subject: [sqlite] OT: General SQL Question
Hi, I know this isnt related to SQLite, however i dont really know where
else to ask.
I have 3 tables - Supplier, Audits and Audititems.
At the moment, i select and join audits and Audititems and it works great.
However i need fields from the supplier chain, so i effectively need to do a
3 way join.
Is this possible?
Thanks!
Dan



Re: [sqlite] OT: General SQL Question

2005-04-30 Thread Patrick Dunnigan
It is possible depending on the make up of the tables.

post the table structures and index / keys and I'll help


- Original Message - 
From: "Dan Keeley" <[EMAIL PROTECTED]>
To: 
Sent: Saturday, April 30, 2005 6:38 AM
Subject: [sqlite] OT: General SQL Question


Hi, I know this isnt related to SQLite, however i dont really know where
else to ask.

I have 3 tables - Supplier, Audits and Audititems.

At the moment, i select and join audits and Audititems and it works great.
However i need fields from the supplier chain, so i effectively need to do a
3 way join.

Is this possible?

Thanks!
Dan







[sqlite] OT: General SQL Question

2005-04-30 Thread Dan Keeley
Hi, I know this isnt related to SQLite, however i dont really know where 
else to ask.

I have 3 tables - Supplier, Audits and Audititems.
At the moment, i select and join audits and Audititems and it works great.  
However i need fields from the supplier chain, so i effectively need to do a 
3 way join.

Is this possible?
Thanks!
Dan



[sqlite] Problems with TCL-Tests

2005-04-30 Thread Michael Link
Hello,
I'm actually into porting SQLite 3 to QNX 6.3. Everything works fine, I 
also managed to build a TCL-Interpreter and run the SQLite-Tests. Most 
of them run without problems, but sometimes during execution (for 
example "where.test") I get the following error which causes succeeding 
tests to fail because the test data wasn't initialized.

Error: syntax error in expression "int(pow(2,$i))": extra tokens at end 
of expression

Am I missing something here, perhaps a mathematical extension for TCL ?
Best regards,
Michael