Re: [sqlite] Encryption

2010-07-24 Thread Timothy A. Sawyer
I would think that you can take any third party encryption routine and use it 
to encrypt the entire database.

I would be remiss if I didn't ask how you would store and retrieve the 
encryption key, what algorithm you plan to use... All rhetorical questions of 
course. 
--Original Message--
From: Mark Schonewille
Sender: sqlite-users-boun...@sqlite.org
To: General Discussion of SQLite Database
ReplyTo: General Discussion of SQLite Database
Subject: [sqlite] Encryption
Sent: Jul 24, 2010 05:55

Hello,

I creates a project with Runtime Revolution. I am using an add-on  
(called an external) that comes with RR. I don't have the source for  
the external and can't recompile it to include an encryption library.  
Does anyone know about a way to encrypt an SQLite database without  
having to re-compile the source?

--
Best regards,

Mark Schonewille

Economy-x-Talk Consulting and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer
KvK: 50277553

Download the Installer Maker plugin for Runtime Revolution at http://qurl.tk/ce

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


** Sent from my mobile device with the tiny keys **
Timothy A. Sawyer, CISSP
Managing Director
MBD Consulting, LLC
55 Madison Av., Suite 400 
Morristown, NJ 07960
Phone: (973) 285-3261 | Fax: (973) 538-0503
Web: http://www.mybowlingdiary.com
Email: tsaw...@mybowlingdiary.com
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Encryption

2010-07-24 Thread Mark Schonewille
Hello,

I creates a project with Runtime Revolution. I am using an add-on  
(called an external) that comes with RR. I don't have the source for  
the external and can't recompile it to include an encryption library.  
Does anyone know about a way to encrypt an SQLite database without  
having to re-compile the source?

--
Best regards,

Mark Schonewille

Economy-x-Talk Consulting and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer
KvK: 50277553

Download the Installer Maker plugin for Runtime Revolution at http://qurl.tk/ce

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] [PHP5-FPM] Sqlite3 or pdo_sqlite?

2010-07-24 Thread Gilles Ganault
On Sat, 24 Jul 2010 18:50:05 +0200, Kees Nuyt
 wrote:
>There's also pdo_sqlite_external which uses the sqlite3.dll
>the user provides, so you can use the latest and greatest
>sqlite version without having to wait for incorporation in
>PHP or PDO itself.

Thanks guys for the input. I'll check when sqlite_busy_timeout() is
added to the SQLite3 in PHP5, and use PDO if it doesn't come out soon
enough.

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] PRAGMA database_list: insert into table?

2010-07-24 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 07/24/2010 05:38 AM, ve3meo wrote:
> I am a humble user of the command line implementation and of various SQLite 
> managers and not an application developer so I cannot do it in code.

You are coding!  The command line tool is merely a thin wrapper around the
library and the managers are a gui equivalent.

I'd encourage you to try one of the scripting languages out there.  They
provide an easy way of adding a little more control flow around the SQL,
variables, better interoperability with files etc.  These languages are easy
to learn and use.

My personal preference is Python, but you won't go far wrong with Lua, Tcl,
Perl, PHP, Basic etc.  See a long list of languages that have SQLite
available at:

  http://www.sqlite.org/cvstrac/wiki?p=SqliteWrappers

>> Depending on what the information is you are obtaining, it may be possible
>> to get it via direct queries on sqlite_master.
>
> Thanks, I'll investigate further.

How about telling us what you are trying to achieve (not how you are trying
to achieve it :-)

Roger

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkxLHKMACgkQmOOfHg372QTLRgCgu0hgNSamhf3TnpZXQGYrZw5Q
V7IAnjKqukZ3ZqDEuFvFwIn8ir4CHzBa
=kg4J
-END PGP SIGNATURE-
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] [PHP5-FPM] Sqlite3 or pdo_sqlite?

2010-07-24 Thread Kees Nuyt
On Sat, 24 Jul 2010 09:18:57 -0400, "J. King"
 wrote:


> PDO_sqlite3 also does have the advantage of being available by default  
> since PHP 5.0.0, whereas sqlite3 is only available by default since PHP  
> 5.3.0.  I'm aware of no other advantages to using PDO, and from what I've  
> read it's on the slow side.

There's also pdo_sqlite_external which uses the sqlite3.dll
the user provides, so you can use the latest and greatest
sqlite version without having to wait for incorporation in
PHP or PDO itself.

Possible limitation: I was told pdo_sqlite_external is only
available for MS Windows.
-- 
  (  Kees Nuyt
  )
c[_]
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] PRAGMA database_list: insert into table?

2010-07-24 Thread Kees Nuyt
On Sat, 24 Jul 2010 08:38:31 -0400, "ve3meo"
 wrote:

>"Roger Binns"  wrote in 
>message news:4c4a5bd5.5010...@rogerbinns.com...
>> -BEGIN PGP SIGNED MESSAGE-
>> Hash: SHA1
>>
>> On 07/23/2010 07:47 PM, ve3meo wrote:
>>> Is it possible to store the results of a PRAGMA statement, especially 
>>> PRAGMA
>>> database_list in a SQLite temporary table using only SQLite commands?
>>
>> No.  Is there any particular reason your code can't copy them internally?
>> Remember that SQLite is a library - it lives inside your application - and
>> is not some remote unchangeable component.
>
>I am a humble user of the command line implementation and of various SQLite 
>managers and not an application developer so I cannot do it in code.
>
>> Depending on what the information is you are obtaining, it may be possible
>> to get it via direct queries on sqlite_master.
>
>Thanks, I'll investigate further.


A humble example:

k...@ozon ~/sql $ cat ve3meo.ksh
#!/usr/bin/ksh
#
## demo shell / sql mixture
#
SQLITE=$(which sqlite3)
printf "SELECT sqlite_version() AS version;\n.schema\n" \
| ${SQLITE} $1
for t in $(printf ".tables\n" \
| ${SQLITE} $1)
do
printf "table %s:\n" $t
printf ".headers on\nPRAGMA table_info(%s);\n" $t \
| ${SQLITE} $1
done

k...@ozon ~/sql $ ./ve3meo.ksh unusedids.db3
3.6.23.1
CREATE TABLE integers (
id INTEGER PRIMARY KEY AUTOINCREMENT
);
CREATE TABLE test (
id INTEGER PRIMARY KEY NOT NULL,
tx TEXT
);
table integers:
cid|name|type|notnull|dflt_value|pk
0|id|INTEGER|0||1
table test:
cid|name|type|notnull|dflt_value|pk
0|id|INTEGER|1||1
1|tx|TEXT|0||0
k...@ozon ~/sql $ 
-- 
  (  Kees Nuyt
  )
c[_]
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] PRAGMA database_list: insert into table?

2010-07-24 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 07/24/2010 04:42 AM, Tim Romano wrote:
> Quite a few users of SQLite these days are not wrapping
> the SQLite libraries in their own client app but are communicating with the
> database via a bridge as if it were a remote server engine.

Yes, but the SQLite library is still local within the process in that case.
 There is no reason why you can't talk to the library simultaneously via
ADO.net as well as via the SQLite API directly.  (If you are using pragmas
then you are already having SQLite specific code.)

> Your opposition to my request several months ago for a raw reverse
> function was colored in this way. You did not acknowledge at the time that a
> raw-reversed  (and hence possibly malformed) sequence of unicode codepoints
>  could give middleware the hiccups, and insisted that it this reversal be
> done "in the application".

SQLite doesn't have a reverse function as shipped, and so is not the one
creating invalid data.  I'll happily acknowledge that malformed Unicode is a
bad thing under all circumstances.

The license of SQLite allows you to do anything you want with it.  (The
trademark prevents you calling the result 'SQLite'.)  You can add, change,
delete etc anything.  You can redistribute the changes or keep them secret.
 You can charge for them.

What many of these requests amount to is wanting someone else to make a
change (typically the SQLite developers) and for the change to be
distributed as part of SQLite.  The bar for that is *considerably* higher
and you would need to demonstrate the value to the majority of the user base
and why the extensive existing mechanisms (extensions, the SQLite API etc)
are not sufficient.

The "opposition" is pointing out that bar, and suggesting alternate
approaches.  (Note I am not a core developer nor do I speak for them but
have been around long enough to observe what they usually do.)

Roger
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkxK/2kACgkQmOOfHg372QSyrgCfaMDkggv6PObyADTR+Cfdz68E
b3YAnj/ihpG0DVet4Y/5Z/RlSDs9QuWR
=K1/M
-END PGP SIGNATURE-
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] [PHP5-FPM] Sqlite3 or pdo_sqlite?

2010-07-24 Thread Alan Chandler
On 24/07/10 15:41, Alan Chandler wrote:
> On 24/07/10 14:18, J. King wrote:
>
>> PDO_sqlite3 also does have the advantage of being available by default
>> since PHP 5.0.0, whereas sqlite3 is only available by default since PHP
>> 5.3.0.  I'm aware of no other advantages to using PDO, and from what I've
>> read it's on the slow side.
>>
>
> Right now its the only php library that calls (or enables a call) to
> sqlite_busy_timeout.
>
> There is a patch which will make it into php 5.3.3 when it is released
> "very shortly" that does provide for that call.
>
> This makes the sqlite3 pretty bad for applications (such as the typical
> web site) where there might be some locking issues.
>
>
I meant that right now PDO:: is the only library that enables the call. 
  Sqlite3 will get it shortly

-- 
Alan Chandler
http://www.chandlerfamily.org.uk

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] [PHP5-FPM] Sqlite3 or pdo_sqlite?

2010-07-24 Thread Alan Chandler
On 24/07/10 14:18, J. King wrote:

> PDO_sqlite3 also does have the advantage of being available by default
> since PHP 5.0.0, whereas sqlite3 is only available by default since PHP
> 5.3.0.  I'm aware of no other advantages to using PDO, and from what I've
> read it's on the slow side.
>

Right now its the only php library that calls (or enables a call) to 
sqlite_busy_timeout.

There is a patch which will make it into php 5.3.3 when it is released 
"very shortly" that does provide for that call.

This makes the sqlite3 pretty bad for applications (such as the typical 
web site) where there might be some locking issues.


-- 
Alan Chandler
http://www.chandlerfamily.org.uk

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Encryption

2010-07-24 Thread Mark Schonewille
Hello,

I created a project with Runtime Revolution. I am using an add-on  
(called an external) that comes with RR. I don't have the source for  
the external and can't recompile it to include an encryption library.  
Does anyone know about a way to encrypt an SQLite database without  
having to re-compile the source?

--
Best regards,

Mark Schonewille

Economy-x-Talk Consulting and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer
KvK: 50277553

Download the Installer Maker plugin for Runtime Revolution at http://qurl.tk/ce

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] [PHP5-FPM] Sqlite3 or pdo_sqlite?

2010-07-24 Thread J. King
On Sat, 24 Jul 2010 08:33:21 -0400, Simon Slavin   
wrote:

>
> On 24 Jul 2010, at 9:56am, Gilles Ganault wrote:
>
>> So from the above, it looks like this binary supports access to
>> MySQL(i) and SQLite2/3, in both procedural and (PDO) object-oriented
>> modes.
>>
>> If that's correct, and provided the application doesn't need to be
>> DB-agnostic... why should I choose PDO instead of the procedural
>> functions to SQLite3?
>
> The main advantage of the PDO is that the calls for each SQL engine are  
> identical.  In other words, you can write your code as if you're going  
> to use SQLite, then one day find you have to move to MySQL, and you'll  
> only have to change one line of code -- the one that says which engine  
> you want it to use.  If you're in a profession where you have to use  
> many SQL engines this can save you from having to learn the different  
> rules and foibles of each one.

This is mostly fantasy, as SQL engines have widely diverging language  
dialects; the API is a relatively small component of interoperability  
pain.  Still, it is a concern, and certainly a slight advantage to PDO.

PDO_sqlite3 also does have the advantage of being available by default  
since PHP 5.0.0, whereas sqlite3 is only available by default since PHP  
5.3.0.  I'm aware of no other advantages to using PDO, and from what I've  
read it's on the slow side.

-- 
J. King
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] PRAGMA database_list: insert into table?

2010-07-24 Thread ve3meo
"Roger Binns"  wrote in 
message news:4c4a5bd5.5010...@rogerbinns.com...
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> On 07/23/2010 07:47 PM, ve3meo wrote:
>> Is it possible to store the results of a PRAGMA statement, especially 
>> PRAGMA
>> database_list in a SQLite temporary table using only SQLite commands?
>
> No.  Is there any particular reason your code can't copy them internally?
> Remember that SQLite is a library - it lives inside your application - and
> is not some remote unchangeable component.

I am a humble user of the command line implementation and of various SQLite 
managers and not an application developer so I cannot do it in code.

> Depending on what the information is you are obtaining, it may be possible
> to get it via direct queries on sqlite_master.

Thanks, I'll investigate further.

>
> Roger
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> 



___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] [PHP5-FPM] Sqlite3 or pdo_sqlite?

2010-07-24 Thread Simon Slavin

On 24 Jul 2010, at 9:56am, Gilles Ganault wrote:

> So from the above, it looks like this binary supports access to
> MySQL(i) and SQLite2/3, in both procedural and (PDO) object-oriented
> modes.
> 
> If that's correct, and provided the application doesn't need to be
> DB-agnostic... why should I choose PDO instead of the procedural
> functions to SQLite3?

The main advantage of the PDO is that the calls for each SQL engine are 
identical.  In other words, you can write your code as if you're going to use 
SQLite, then one day find you have to move to MySQL, and you'll only have to 
change one line of code -- the one that says which engine you want it to use.  
If you're in a profession where you have to use many SQL engines this can save 
you from having to learn the different rules and foibles of each one.

Simon.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] PRAGMA database_list: insert into table?

2010-07-24 Thread Sam Carleton
Tim,

I, like you, am using SQLite as the DB to a web server.  But I have to agree
with Roger.  I do so from the prospective that web client cannot make native
calls to SQLite.  Thus the web server is the client.  Further more I would
say that in all web server based solutions, the web server is the DB client.

With fully integrated solutions like ASP.Net and MS SQL Server, a lot of the
connection stuff is automatically handled by the vender (Microsoft) so that
application developers like you and me don't have to mess with it.  But when
we move to the world of open source, we have to deal with some plumbing.
Not high on my list of things I like to do, but it has to be done:(

Sam

On Sat, Jul 24, 2010 at 7:42 AM, Tim Romano  wrote:

> Roger,
> It would be more accurate to say that SQL is a library which *can* live
> inside an application.  Whether it actually does live inside it will depend
> on how one is using SQLite.  When it is used as a "back-end" reached via
> middleware, such as the ADO.NET driver,  SQLite does not live inside the
> client application.  Quite a few users of SQLite these days are not
> wrapping
> the SQLite libraries in their own client app but are communicating with the
> database via a bridge as if it were a remote server engine.
>
> The reason I bring this up is that  your replies are sometimes colored by
>  the assumption that one is using SQLite in library-mode, which may not be
> the case. Your opposition to my request several months ago for a raw
> reverse
> function was colored in this way. You did not acknowledge at the time that
> a
> raw-reversed  (and hence possibly malformed) sequence of unicode codepoints
>  could give middleware the hiccups, and insisted that it this reversal be
> done "in the application".
>
> Regards
> Tim Romano
> Swarthmore PA
>
>
>
> On Fri, Jul 23, 2010 at 11:19 PM, Roger Binns 
> wrote:
>
> > -BEGIN PGP SIGNED MESSAGE-
> >
> > Remember that SQLite is a library - it lives inside your application -
> and
> > is not some remote unchangeable component.
> >
> >
> >
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] PRAGMA database_list: insert into table?

2010-07-24 Thread Tim Romano
Roger,
It would be more accurate to say that SQL is a library which *can* live
inside an application.  Whether it actually does live inside it will depend
on how one is using SQLite.  When it is used as a "back-end" reached via
middleware, such as the ADO.NET driver,  SQLite does not live inside the
client application.  Quite a few users of SQLite these days are not wrapping
the SQLite libraries in their own client app but are communicating with the
database via a bridge as if it were a remote server engine.

The reason I bring this up is that  your replies are sometimes colored by
 the assumption that one is using SQLite in library-mode, which may not be
the case. Your opposition to my request several months ago for a raw reverse
function was colored in this way. You did not acknowledge at the time that a
raw-reversed  (and hence possibly malformed) sequence of unicode codepoints
 could give middleware the hiccups, and insisted that it this reversal be
done "in the application".

Regards
Tim Romano
Swarthmore PA



On Fri, Jul 23, 2010 at 11:19 PM, Roger Binns  wrote:

> -BEGIN PGP SIGNED MESSAGE-
>
> Remember that SQLite is a library - it lives inside your application - and
> is not some remote unchangeable component.
>
>
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] poor insert performance with 3.7/Windows

2010-07-24 Thread GB
  Hi all,

I had to recognise that our data-transforming (read: heavily inserting) 
procedures had a massive drop in performance with 3.7. Some 
investigation showed that this is related to "pager_write_pagelist" 
where a hint to an estimated target filesize is given to the filesystem, 
which on Windows translates to a winTruncate. This in turn causes a 
low-level-flush of file metadata and performance drops to nil. Is the 
setting of the file size really needed here or can we safely drop it? 
Dropping it seems to work for ourselves,

Regards,
Gerd
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Help with complex UPDATE question

2010-07-24 Thread Black, Michael (IS)
I can think of several answers to your last question;
 
#1 Your mileage may vary
#2 Take the easiest way for you and see it works well.
#3 Since SQL wasn't designed for vector math do it in your program -- probably 
MUCH clearer to anybody (including yourself) in the future.  It shouldn't take 
more than about 30 minutes to code this up.  I was tempted to do it myself just 
for the exercise...
 
 
Michael D. Black
Senior Scientist
Advanced Analytics Directorate
Northrop Grumman Information Systems
 



From: sqlite-users-boun...@sqlite.org on behalf of peterwinson1
Sent: Fri 7/23/2010 9:37 PM
To: sqlite-users@sqlite.org
Subject: EXTERNAL:Re: [sqlite] Help with complex UPDATE question




Jim, I see what you mean.  Would it be faster then if I read the from the
table, do the math in a program, and then insert the values back into the
table?  Or would it faster to amend the table as you suggest and use SQL
UPDATE? I wonder.




Jim Morris-4 wrote:
>
> AYou must add additional data to the rows so you can refer to them
> unambiguously.
>
> table1 (KEY, COL1, ord)
>
> 0, 1,1
> 0, 2,2
> 1, 3,1
> 1, 4,2
> 2, 5,1
> 2, 6,2
> 3, 7,1
> 3, 8,2
>
>
> On 7/23/2010 12:16 PM, peterwinson1 wrote:
>> Jim you maybe correct that I don't have enough data to unambiguously
>> identify
>> the rows.  But just in case I was not very clear the first time.
>>
>> What I want to do is take the COL1 values of the first 2 rows [1, 2] and
>> subtract them from the COL1 values, two rows at a time.  so [1, 2] - [1,
>> 2],
>> then [3, 4] - [1, 2], then [5, 6] - [1, 2], and finally [7, 8] - [1, 2].
>> The question is can I do this just using SQL?
>>
>>
>>
>>
>> Jim Morris-4 wrote:
>>   
>>> What you are trying to do is unclear to me.  It seems that table1
>>> doesn't have enough data to unambiguously identify the rows.
>>>
>>> On 7/23/2010 8:03 AM, peterwinson1 wrote:
>>> 
 Thanks Eric and Alan for your help.  I tried to apply your code to my
 problem
 and it works to a limited extent because the problem is more
 complicated
 than the example I gave in the post.  I tries to simplify my exact
 problem
 but that didn't work out.  So here is the problem that I trying to
 solve.

 table1 (KEY, COL1)

 0, 1
 0, 2
 1, 3
 1, 4
 2, 5
 2, 6
 3, 7
 3, 8

 table2 (KEY, X, Y)

 0, 0, 0
 1, 0, 1
 2, 1, 0
 3, 1, 1

 What I would like to do is, like before, subtract COL1 from COL1 where
 table1.KEY = 0 and WHERE table1.KEY is IN (SELECT table2 WHERE X=0).
 But
 I
 want to do a vector subtraction instead of a scalar subtraction.

 So far I have

 UPDATE table1 set COL1 = COL1 - (SELECT COL1 WHERE table1.KEY = 0)
 WHERE
 table1.KEY IN (SELECT table2 WHERE X=0)

 The result I would like to get is

 table1

 0, 0 //(1 - 1)
 0, 0 //(2 - 2)
 1, 2 //(3 - 1)
 1, 2 //(4 - 2)
 2, 5
 2, 6
 3, 7
 3, 8

 Instead I get

 0, 0 //(1 - 1)
 0, 1 //(2 - 1)
 1, 2 //(3 - 1)
 1, 3 //(4 - 1)
 2, 5
 2, 6
 3, 7
 3, 8

 Is this possible in SQL?


 peterwinson1 wrote:

   
> Hello,
>
> I have a some what complex question about UPDATE.  I have the
> following
> table
>
> table1 (KEY, COL1)
>
> 0, 1
> 1, 2
> 2, 3
> 3, 4
>
> What I would like to do is to UPDATE COL1 by subtracting the COL1
> value
> where KEY = 0 from the COL1 value of the current row so that the
> result
> would be.
>
> 0, 0
> 1, 1
> 2, 2
> 3, 3
>
> Can this be done in SQL?  It does not have to be one UPDATE/SELECT
> statement.
>
> Thank you
> pw
>
>
>
>
> 

   
>>> ___
>>> sqlite-users mailing list
>>> sqlite-users@sqlite.org
>>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>>>
>>>
>>> 
>>   
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
>

--
View this message in context: 
http://old.nabble.com/Help-with-complex-UPDATE-question-tp29239594p29252817.html
Sent from the SQLite mailing list archive at Nabble.com.

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Version compatibility

2010-07-24 Thread Kees Nuyt
On Fri, 23 Jul 2010 10:25:13 +0100, Andy Chambers
 wrote:

>Hi,
>
>I've been reading about version compatibility between different
>versions of sqlite at the
>link below:
>
>http://www.sqlite.org/formatchng.html
>
>It states the expected behaviour for old and new with a different
>first number, and a different second number, but not a different
>third number.  
>I presume this means that a different third number means
>old and new are completely compatible but is there
>anything I can show to my QA person that states this?

The second paragraph on that page implies that, although it
is terse. The philosophy behind the numbering scheme is that
the second number is incremented and the third set to zero
whenever the format changes.

Also, there are no other file format changes than listed in
the table. Note that every one of them goes to a x.y.0
version, except 3.3.6 to 3.3.7, but that is four years ago
and should not influence todays decisions. 
The list looks long, but please note the last two do not
change the on-disk format, but just the OS interface layer.
So, there are hardly any changes at all, and conversion from
one to the other is really easy.

That should convince him/her.
-- 
  (  Kees Nuyt
  )
c[_]
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Version compatibility

2010-07-24 Thread Gunnar Roth
http://www.sqlite.org/onefile.html


Am 23.07.2010 um 11:25 schrieb Andy Chambers:

> Hi,
> 
> I've been reading about version compatibility between different
> versions of sqlite at the
> link below:
> 
> http://www.sqlite.org/formatchng.html
> 
> It states the expected behaviour for old and new with a different
> first number, and a
> different second number, but not a different third number.  I presume
> this means that
> a different third number means old and new are completely compatible
> but is there
> anything I can show to my QA person that states this?
> 
> Cheers,
> Andy
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] [PHP5-FPM] Sqlite3 or pdo_sqlite?

2010-07-24 Thread Gilles Ganault
Hello

I'm using the pre-compiled PHP5-FPM/FastCGI (www.php-fpm.org) which
seem to contain the following DB connectors:

PDO drivers mysql, sqlite, sqlite2
pdo_mysql 5.1.48
pdo_sqlite 3.6.22

SQLite 2.8.17
sqlite3 3.6.22

So from the above, it looks like this binary supports access to
MySQL(i) and SQLite2/3, in both procedural and (PDO) object-oriented
modes.

If that's correct, and provided the application doesn't need to be
DB-agnostic... why should I choose PDO instead of the procedural
functions to SQLite3?

Thank you.

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users