RE: [sqlite] Calculate years and months difference with Julian Date?

2006-12-17 Thread RB Smissaert
> If you have two dates A and B, you can ask the question:

>   Is A more than one month after B like this:

> SELECT julianday(A,'+1 month')>B ...


Thanks; that looks exactly what I need.

RBS


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: 18 December 2006 01:52
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] Calculate years and months difference with Julian
Date?

"RB Smissaert" <[EMAIL PROTECTED]> wrote:
> Is it possible with Julian dates in 2 fields to calculate the months
and/or
> years difference between those 2 dates?
> 
> I know I can subtract the 2 dates and divide by 30 (or 30.42) or 365 and
> take it from there, but I would like it a bit more precise, so for
example:
> Is 2 March 2006 more than one month after 1 February 2006?
> If calculated with a simple division the answer would be no, but I would
> like it to be yes.
> 
> Had a look at the date/time functions on the WIKI site, but couldn't see
it.
> 

If you have two dates A and B, you can ask the question:

Is A more than one month after B like this:

SELECT julianday(A,'+1 month')>B ...

If you really need to know the number of months difference between
A and B, then perhaps something like this:

SELECT (strftime('%m',A)+12*strftime('%Y',A)) -
   (strftime('%m',B)+12*strftime('%Y',B)) ...

Caution:  Both of the above are off the top of my head and are
untested.  But perhaps they will give you some ideas.
--
D. Richard Hipp  <[EMAIL PROTECTED]>



-
To unsubscribe, send email to [EMAIL PROTECTED]

-




-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] SQL error: near "READ_ONLY": syntax error

2006-12-17 Thread Marten Feldtmann
LuYanJun schrieb:
> Hi guy:
> what does the follow meaning?
> sqlite> BEGIN READ_ONLY;
> SQL error: near "READ_ONLY": syntax error
READ_ONLY is not a valid option for this command.

BEGIN [DEFERRED | EXCLUSIVE | IMMEDIATE]

Marten

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] SQL error: near "READ_ONLY": syntax error

2006-12-17 Thread LuYanJun
Hi guy:
what does the follow meaning?
sqlite> BEGIN READ_ONLY;
SQL error: near "READ_ONLY": syntax error

Re: [sqlite] building sqlite on windows in Unicode

2006-12-17 Thread Joe Wilson
Many large open source projects have committers for specific platforms, 
or particular sections of the code. I would think that Windows support
and autoconfigury would be good candidates for delegation.
One guy can't do it all.

--- Brodie Thiesfield <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote:
> > Your contributions are greatly appreciated.  Please do not let
> > anything I say or do discourage you from contributing again to
> > either SQLite or other open source projects.  User contributions
> > are very important to open source projects like SQLite and I want
> > to encourage them.  But you also need to understand that there is
> > no guarantee that a patch will be accepted.  With SQLite in
> > particular, with me in the drivers seat, it is very very difficult
> > to get a patch accepted into the core.  It has been done, but it
> > does not happen very often.  Usually, if I implement a suggested
> > feature at all, I merely use the patch as a guideline to implement 
> > my own changes.  Do not let this discourage you.  Your patch has
> > been recorded in the bug tracking system, and I have studied it
> > closely.  It will be likely used as a reference someday.  Just 
> > not today.
> 
> Having these comments added to the bug system would be useful to start
> with. You have your reasons for ignoring the bug, but with no movement
> at all it is frustrating to have to continually patch the source just to
> get it to build on Windows. Especially when it is so simple to get it to
> work.


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Calculate years and months difference with Julian Date?

2006-12-17 Thread drh
"RB Smissaert" <[EMAIL PROTECTED]> wrote:
> Is it possible with Julian dates in 2 fields to calculate the months and/or
> years difference between those 2 dates?
> 
> I know I can subtract the 2 dates and divide by 30 (or 30.42) or 365 and
> take it from there, but I would like it a bit more precise, so for example:
> Is 2 March 2006 more than one month after 1 February 2006?
> If calculated with a simple division the answer would be no, but I would
> like it to be yes.
> 
> Had a look at the date/time functions on the WIKI site, but couldn't see it.
> 

If you have two dates A and B, you can ask the question:

Is A more than one month after B like this:

SELECT julianday(A,'+1 month')>B ...

If you really need to know the number of months difference between
A and B, then perhaps something like this:

SELECT (strftime('%m',A)+12*strftime('%Y',A)) -
   (strftime('%m',B)+12*strftime('%Y',B)) ...

Caution:  Both of the above are off the top of my head and are
untested.  But perhaps they will give you some ideas.
--
D. Richard Hipp  <[EMAIL PROTECTED]>


-
To unsubscribe, send email to [EMAIL PROTECTED]
-



RE: [sqlite] Calculate years and months difference with Julian Date?

2006-12-17 Thread RB Smissaert
Interesting and thanks for the tip, but I don't think you can do that in
VBA. Maybe it is possible in VB6. Will have a look at it.

RBS

-Original Message-
From: claudio benghi [mailto:[EMAIL PROTECTED] 
Sent: 18 December 2006 00:40
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] Calculate years and months difference with Julian
Date?

On 12/18/06, RB Smissaert <[EMAIL PROTECTED]> wrote:
> Yes, and it is nice to know that this is an option.
> I am using a VB wrapper though and not using the SQLite dll.
> Will figure something out.
>
> RBS

In VB.net I once solved this implementing an user function using the
ADO.net provider.
You can read more at
http://sqlite.phxsoftware.com/forums/post/2402.aspx
Hope it helps

Claudio


-
To unsubscribe, send email to [EMAIL PROTECTED]

-




-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Calculate years and months difference with Julian Date?

2006-12-17 Thread claudio benghi

On 12/18/06, RB Smissaert <[EMAIL PROTECTED]> wrote:

Yes, and it is nice to know that this is an option.
I am using a VB wrapper though and not using the SQLite dll.
Will figure something out.

RBS


In VB.net I once solved this implementing an user function using the
ADO.net provider.
You can read more at
http://sqlite.phxsoftware.com/forums/post/2402.aspx
Hope it helps

Claudio

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



RE: [sqlite] Calculate years and months difference with Julian Date?

2006-12-17 Thread RB Smissaert
Yes, and it is nice to know that this is an option.
I am using a VB wrapper though and not using the SQLite dll.
Will figure something out.

RBS

-Original Message-
From: John Stanton [mailto:[EMAIL PROTECTED] 
Sent: 17 December 2006 23:05
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] Calculate years and months difference with Julian
Date?

I answered your question.  It is possible and showed you how to do it. 
The rest is up to you.

RB Smissaert wrote:
> I am not into C and I want to stay clear from compiling SQLite.
> Or do I misunderstand this?
> 
> RBS
> 
> -Original Message-
> From: John Stanton [mailto:[EMAIL PROTECTED] 
> Sent: 17 December 2006 20:38
> To: sqlite-users@sqlite.org
> Subject: Re: [sqlite] Calculate years and months difference with Julian
> Date?
> 
> Have a look at Sqlite date code.  I just lifted its data structures and 
> used its functions to build user functions to give month etc.  The 
> algorithms are accurate and they are easy to use.  I found setting up 
> user functions to do those calculations made the SQL simpler.
> 
> The functions are in a file called date.c.  Here is one function which 
> we added to Sqlite to get the month number as an example -
> 
> *!!!TSI addition.*/
> /*-- monthFunc -
> Return the month number.  Added by TSI.*/
> static void monthFunc(sqlite3_context *context, int argc,
>sqlite3_value **argv){
> 
>DateTime x;
> 
>if (isDate(argc, argv, &x) == 0){
>  computeYMD(&x);
>  sqlite3_result_int(context, x.M);
>}  /*if*/
> }/*monthFunc*/
> /*!!!End TSI addition.*/
> 
> RB Smissaert wrote:
> 
>>Is it possible with Julian dates in 2 fields to calculate the months
> 
> and/or
> 
>>years difference between those 2 dates?
>>
>>I know I can subtract the 2 dates and divide by 30 (or 30.42) or 365 and
>>take it from there, but I would like it a bit more precise, so for
> 
> example:
> 
>>Is 2 March 2006 more than one month after 1 February 2006?
>>If calculated with a simple division the answer would be no, but I would
>>like it to be yes.
>>
>>Had a look at the date/time functions on the WIKI site, but couldn't see
> 
> it.
> 
>>RBS
>>
>>
>>
>>
>>
> 
>

> -
> 
>>To unsubscribe, send email to [EMAIL PROTECTED]
>>
> 
>

> -
> 
> 
> 
>

> -
> To unsubscribe, send email to [EMAIL PROTECTED]
>

> -
> 
> 
> 
> 
>

-
> To unsubscribe, send email to [EMAIL PROTECTED]
>

-
> 



-
To unsubscribe, send email to [EMAIL PROTECTED]

-




-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Calculate years and months difference with Julian Date?

2006-12-17 Thread John Stanton
I answered your question.  It is possible and showed you how to do it. 
The rest is up to you.


RB Smissaert wrote:

I am not into C and I want to stay clear from compiling SQLite.
Or do I misunderstand this?

RBS

-Original Message-
From: John Stanton [mailto:[EMAIL PROTECTED] 
Sent: 17 December 2006 20:38

To: sqlite-users@sqlite.org
Subject: Re: [sqlite] Calculate years and months difference with Julian
Date?

Have a look at Sqlite date code.  I just lifted its data structures and 
used its functions to build user functions to give month etc.  The 
algorithms are accurate and they are easy to use.  I found setting up 
user functions to do those calculations made the SQL simpler.


The functions are in a file called date.c.  Here is one function which 
we added to Sqlite to get the month number as an example -


*!!!TSI addition.*/
/*-- monthFunc -
Return the month number.  Added by TSI.*/
static void monthFunc(sqlite3_context *context, int argc,
   sqlite3_value **argv){

   DateTime x;

   if (isDate(argc, argv, &x) == 0){
 computeYMD(&x);
 sqlite3_result_int(context, x.M);
   }  /*if*/
}/*monthFunc*/
/*!!!End TSI addition.*/

RB Smissaert wrote:


Is it possible with Julian dates in 2 fields to calculate the months


and/or


years difference between those 2 dates?

I know I can subtract the 2 dates and divide by 30 (or 30.42) or 365 and
take it from there, but I would like it a bit more precise, so for


example:


Is 2 March 2006 more than one month after 1 February 2006?
If calculated with a simple division the answer would be no, but I would
like it to be yes.

Had a look at the date/time functions on the WIKI site, but couldn't see


it.


RBS








-


To unsubscribe, send email to [EMAIL PROTECTED]




-




-
To unsubscribe, send email to [EMAIL PROTECTED]

-




-
To unsubscribe, send email to [EMAIL PROTECTED]
-




-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] building sqlite on windows in Unicode

2006-12-17 Thread Brodie Thiesfield

Robert Simpson wrote:

I wrote the original patch to loadext.c with the intent of making it as
minimally obtrusive as possible to the existing code structure.  I know
firsthand how much DRH hates changing his codebase :)

[snip]
> FWIW, that patch I wrote is currently in production code in the 
ADO.NET 2.0

> provider and in use by Windows CE users since October.

I don't doubt that your patch fixes your specific problem, however it 
has 2 main problems for me:
1) it doesn't address the larger problem of building the library in 
UNICODE mode in general (of which Windows CE is just one client)
2) you've assumed that the char* strings are in CP_ACP whereas I 
understand that all char* are UTF-8.


That said I can easily write a patch that doesn't touch the OS 
abstraction code, it just seems crazy to hack missing OS abstraction 
functions into files all around the codebase just in order to avoid 
adding them to the existing OS abstraction layer.


Regards,
Brodie


-Original Message-
From: Brodie Thiesfield [mailto:[EMAIL PROTECTED]
Sent: Sunday, December 17, 2006 10:10 AM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] building sqlite on windows in Unicode

[EMAIL PROTECTED] wrote:

Brodie Thiesfield <[EMAIL PROTECTED]> wrote:

Done. Is there anything else that is necessary to contribute code

and

patches to sqlite?

For ticket #2023, the first patch seems unlikely to work right
since it changes the character encoding for LoadLibrary() but
leaves it unchanged for FreeLibrary().  That seems wrong to me,
but not having any access to WinCE (and having zero desire to
ever get access) I have no way of testing it.

I didn't write the first patch. It should just be ignored as my patch
is
more comprehensive.

The only function that has a different version for UNICODE vs MBCS is
LoadLibrary (i.e. both LoadLibraryA and LoadLibraryW). This can be seen
from the documentation. The T in LPCTSTR in the LoadLibrary definition
signifies that there is both A and W versions. GetProcAddress takes
only
a LPCSTR which is always char*. FreeLibrary takes only the handle to
the
library that LoadLibrary created.

These functions are pretty much the same as dlopen/dlsym/dlclose, with
the exception that LoadLibrary needs to be specially handled.

MSDN documentation:
LoadLibrary http://snipurl.com/loadlibrary
GetProcAddress http://snipurl.com/getprocaddress
FreeLibrary http://snipurl.com/freelibrary


The second patch extends the OS interface in ways that will break
legacy implementations.  A significant part of my income derives
from people and companies who pay me to not do that.

If those implementations are not be broken by the current
implementation
of loadext.c then surely these changes won't break them either. The
whole idea of have the OS interface is that it abstracts the OS away in
a single location. Hacking OS abstraction into other parts of the
codebase (e.g. the current loadext.c) is not the correct thing to do.
In
any case, since all of those people/companies are either supported by
the current method of dlopen/sym/close as is currently used in
loadext.c, or they aren't using 3.3.7+


I could perhaps fix up either patch to do the right thing, but
then I would have no way of testing the results, since I do not
have access to WinCE.

You do not need access to WinCE. It also breaks the build on Windows
when defining _UNICODE. I'm sure that you an set the _UNICODE define
(removing _MBCS) on your cross-compiler (if that is what you are
using).
If you can you elaborate more on the requirements for changes to the OS
layer then I can adapt my patch to fit your requirements.


The above are some of the reasons that there has been so little
movement on ticket #2023.

Your contributions are greatly appreciated.  Please do not let
anything I say or do discourage you from contributing again to
either SQLite or other open source projects.  User contributions
are very important to open source projects like SQLite and I want
to encourage them.  But you also need to understand that there is
no guarantee that a patch will be accepted.  With SQLite in
particular, with me in the drivers seat, it is very very difficult
to get a patch accepted into the core.  It has been done, but it
does not happen very often.  Usually, if I implement a suggested
feature at all, I merely use the patch as a guideline to implement
my own changes.  Do not let this discourage you.  Your patch has
been recorded in the bug tracking system, and I have studied it
closely.  It will be likely used as a reference someday.  Just
not today.

Having these comments added to the bug system would be useful to start
with. You have your reasons for ignoring the bug, but with no movement
at all it is frustrating to have to continually patch the source just
to
get it to build on Windows. Especially when it is so simple to get it
to
work.

Regards,
Brodie

---
--
To unsubscribe, send email to [EMAI

RE: [sqlite] building sqlite on windows in Unicode

2006-12-17 Thread Robert Simpson
I wrote the original patch to loadext.c with the intent of making it as
minimally obtrusive as possible to the existing code structure.  I know
firsthand how much DRH hates changing his codebase :)

As Brodie stated, FreeLibrary() takes a type HANDLE, which is returned from
a call to LoadLibrary() -- so the only time the string needs referencing is
at the original LoadLibrary() call.

FWIW, that patch I wrote is currently in production code in the ADO.NET 2.0
provider and in use by Windows CE users since October.

Robert


> -Original Message-
> From: Brodie Thiesfield [mailto:[EMAIL PROTECTED]
> Sent: Sunday, December 17, 2006 10:10 AM
> To: sqlite-users@sqlite.org
> Subject: Re: [sqlite] building sqlite on windows in Unicode
> 
> [EMAIL PROTECTED] wrote:
> > Brodie Thiesfield <[EMAIL PROTECTED]> wrote:
> >> Done. Is there anything else that is necessary to contribute code
> and
> >> patches to sqlite?
> >
> > For ticket #2023, the first patch seems unlikely to work right
> > since it changes the character encoding for LoadLibrary() but
> > leaves it unchanged for FreeLibrary().  That seems wrong to me,
> > but not having any access to WinCE (and having zero desire to
> > ever get access) I have no way of testing it.
> 
> I didn't write the first patch. It should just be ignored as my patch
> is
> more comprehensive.
> 
> The only function that has a different version for UNICODE vs MBCS is
> LoadLibrary (i.e. both LoadLibraryA and LoadLibraryW). This can be seen
> from the documentation. The T in LPCTSTR in the LoadLibrary definition
> signifies that there is both A and W versions. GetProcAddress takes
> only
> a LPCSTR which is always char*. FreeLibrary takes only the handle to
> the
> library that LoadLibrary created.
> 
> These functions are pretty much the same as dlopen/dlsym/dlclose, with
> the exception that LoadLibrary needs to be specially handled.
> 
> MSDN documentation:
> LoadLibrary http://snipurl.com/loadlibrary
> GetProcAddress http://snipurl.com/getprocaddress
> FreeLibrary http://snipurl.com/freelibrary
> 
> > The second patch extends the OS interface in ways that will break
> > legacy implementations.  A significant part of my income derives
> > from people and companies who pay me to not do that.
> 
> If those implementations are not be broken by the current
> implementation
> of loadext.c then surely these changes won't break them either. The
> whole idea of have the OS interface is that it abstracts the OS away in
> a single location. Hacking OS abstraction into other parts of the
> codebase (e.g. the current loadext.c) is not the correct thing to do.
> In
> any case, since all of those people/companies are either supported by
> the current method of dlopen/sym/close as is currently used in
> loadext.c, or they aren't using 3.3.7+
> 
> > I could perhaps fix up either patch to do the right thing, but
> > then I would have no way of testing the results, since I do not
> > have access to WinCE.
> 
> You do not need access to WinCE. It also breaks the build on Windows
> when defining _UNICODE. I'm sure that you an set the _UNICODE define
> (removing _MBCS) on your cross-compiler (if that is what you are
> using).
> If you can you elaborate more on the requirements for changes to the OS
> layer then I can adapt my patch to fit your requirements.
> 
> > The above are some of the reasons that there has been so little
> > movement on ticket #2023.
> >
> > Your contributions are greatly appreciated.  Please do not let
> > anything I say or do discourage you from contributing again to
> > either SQLite or other open source projects.  User contributions
> > are very important to open source projects like SQLite and I want
> > to encourage them.  But you also need to understand that there is
> > no guarantee that a patch will be accepted.  With SQLite in
> > particular, with me in the drivers seat, it is very very difficult
> > to get a patch accepted into the core.  It has been done, but it
> > does not happen very often.  Usually, if I implement a suggested
> > feature at all, I merely use the patch as a guideline to implement
> > my own changes.  Do not let this discourage you.  Your patch has
> > been recorded in the bug tracking system, and I have studied it
> > closely.  It will be likely used as a reference someday.  Just
> > not today.
> 
> Having these comments added to the bug system would be useful to start
> with. You have your reasons for ignoring the bug, but with no movement
> at all it is frustrating to have to continually patch the source just
> to
> get it to build on Windows. Especially when it is so simple to get it
> to
> work.
> 
> Regards,
> Brodie
> 
> ---
> --
> To unsubscribe, send email to [EMAIL PROTECTED]
> ---
> --



-
To unsubscribe, send e

RE: [sqlite] Calculate years and months difference with Julian Date?

2006-12-17 Thread RB Smissaert
I am not into C and I want to stay clear from compiling SQLite.
Or do I misunderstand this?

RBS

-Original Message-
From: John Stanton [mailto:[EMAIL PROTECTED] 
Sent: 17 December 2006 20:38
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] Calculate years and months difference with Julian
Date?

Have a look at Sqlite date code.  I just lifted its data structures and 
used its functions to build user functions to give month etc.  The 
algorithms are accurate and they are easy to use.  I found setting up 
user functions to do those calculations made the SQL simpler.

The functions are in a file called date.c.  Here is one function which 
we added to Sqlite to get the month number as an example -

*!!!TSI addition.*/
/*-- monthFunc -
Return the month number.  Added by TSI.*/
static void monthFunc(sqlite3_context *context, int argc,
   sqlite3_value **argv){

   DateTime x;

   if (isDate(argc, argv, &x) == 0){
 computeYMD(&x);
 sqlite3_result_int(context, x.M);
   }  /*if*/
}/*monthFunc*/
/*!!!End TSI addition.*/

RB Smissaert wrote:
> Is it possible with Julian dates in 2 fields to calculate the months
and/or
> years difference between those 2 dates?
> 
> I know I can subtract the 2 dates and divide by 30 (or 30.42) or 365 and
> take it from there, but I would like it a bit more precise, so for
example:
> Is 2 March 2006 more than one month after 1 February 2006?
> If calculated with a simple division the answer would be no, but I would
> like it to be yes.
> 
> Had a look at the date/time functions on the WIKI site, but couldn't see
it.
> 
> RBS
> 
> 
> 
> 
>

-
> To unsubscribe, send email to [EMAIL PROTECTED]
>

-
> 



-
To unsubscribe, send email to [EMAIL PROTECTED]

-




-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Is sqlite the right db for me?

2006-12-17 Thread Roger Binns

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Steve Davis wrote:
| My consideration has been that although setting up a server and mySQL is
| trivial for me, it might not be for someone else who isn't a geek.
But that
| will have to be resolved in the installation process.

There are pre-built packages such as
http://www.apachefriends.org/en/xampp-windows.html that you could use
(although xampp has way too much stuff in it).

An alternative mechanism I would suggest is to make a virtual machine
using VMWare and then people can use it via the free VMWare Player.
That way it is a simple black box and you don't have to worry about
other stuff on the machine hurting your software.

Roger
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFFhavRmOOfHg372QQRAqhTAJ97ymQBHtAL288ehGdZbvgvmwGnjQCguK8T
E0ggnGaE/T8dzcGoat6w7IE=
=OhcK
-END PGP SIGNATURE-

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Calculate years and months difference with Julian Date?

2006-12-17 Thread John Stanton
Have a look at Sqlite date code.  I just lifted its data structures and 
used its functions to build user functions to give month etc.  The 
algorithms are accurate and they are easy to use.  I found setting up 
user functions to do those calculations made the SQL simpler.


The functions are in a file called date.c.  Here is one function which 
we added to Sqlite to get the month number as an example -


*!!!TSI addition.*/
/*-- monthFunc -
Return the month number.  Added by TSI.*/
static void monthFunc(sqlite3_context *context, int argc,
  sqlite3_value **argv){

  DateTime x;

  if (isDate(argc, argv, &x) == 0){
computeYMD(&x);
sqlite3_result_int(context, x.M);
  }  /*if*/
}/*monthFunc*/
/*!!!End TSI addition.*/

RB Smissaert wrote:

Is it possible with Julian dates in 2 fields to calculate the months and/or
years difference between those 2 dates?

I know I can subtract the 2 dates and divide by 30 (or 30.42) or 365 and
take it from there, but I would like it a bit more precise, so for example:
Is 2 March 2006 more than one month after 1 February 2006?
If calculated with a simple division the answer would be no, but I would
like it to be yes.

Had a look at the date/time functions on the WIKI site, but couldn't see it.

RBS




-
To unsubscribe, send email to [EMAIL PROTECTED]
-




-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Is sqlite the right db for me?

2006-12-17 Thread Peter Cunderlik

On 12/17/06, Steve Davis <[EMAIL PROTECTED]> wrote:


Some time ago I  wrote a member and incident management application
for my volunteer bushfire  brigade  in PHP/mySQL.  It works quite well
but is browser based which  limits it a bit.


I think you can't go wrong with SQLite. If you don't need multiuser
access in a networked environment, you'll find SQLite extremely easy
to use, with all useful features working just right. All this without
the hassle with installing/deploying DB engines like mySQL.

As for Python, I find it very easy to use, clean and efficient. I use
it for prototyping my projects and I think that even if you decide not
to use Python, you'll be able to use your ideas when
programming/prototyping in Python.

You wrote you want a standalone application, but maybe one day you'll
wish to bring your app to a WWW server and by using mod_python you'll
be able to reuse the logic from your standalone app. You'll be able to
switch platform anytime and benefit from using free software
(including OS).

Alternative to Python could be Java, though in the beginning you might
find it frustrating to do GUI with Swing and maybe something like SWT
would be more usable in your case.

Peter

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] Calculate years and months difference with Julian Date?

2006-12-17 Thread RB Smissaert
Is it possible with Julian dates in 2 fields to calculate the months and/or
years difference between those 2 dates?

I know I can subtract the 2 dates and divide by 30 (or 30.42) or 365 and
take it from there, but I would like it a bit more precise, so for example:
Is 2 March 2006 more than one month after 1 February 2006?
If calculated with a simple division the answer would be no, but I would
like it to be yes.

Had a look at the date/time functions on the WIKI site, but couldn't see it.

RBS




-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Is sqlite the right db for me?

2006-12-17 Thread jose simas

I have a reasonably large application written in VB6 that uses SQLite.
It is possibly the simplest solution for you as you already know
VBScript. It is also very easy to install on most computers (with
Windows, I mean). Another option would be VB.NET or C# if you
distribute the app usind CDs.

A web application will mean a lot more setup and deployment problems
than a simple executable and I guess that fire brigades don't have an
IT department to sort out XP firewalls and the like.

Jose Simas
http://www.gepsoft.com/

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] building sqlite on windows in Unicode

2006-12-17 Thread Brodie Thiesfield
[EMAIL PROTECTED] wrote:
> Brodie Thiesfield <[EMAIL PROTECTED]> wrote:
>> Done. Is there anything else that is necessary to contribute code and 
>> patches to sqlite? 
> 
> For ticket #2023, the first patch seems unlikely to work right
> since it changes the character encoding for LoadLibrary() but
> leaves it unchanged for FreeLibrary().  That seems wrong to me,
> but not having any access to WinCE (and having zero desire to
> ever get access) I have no way of testing it.

I didn't write the first patch. It should just be ignored as my patch is
more comprehensive.

The only function that has a different version for UNICODE vs MBCS is
LoadLibrary (i.e. both LoadLibraryA and LoadLibraryW). This can be seen
from the documentation. The T in LPCTSTR in the LoadLibrary definition
signifies that there is both A and W versions. GetProcAddress takes only
a LPCSTR which is always char*. FreeLibrary takes only the handle to the
library that LoadLibrary created.

These functions are pretty much the same as dlopen/dlsym/dlclose, with
the exception that LoadLibrary needs to be specially handled.

MSDN documentation:
LoadLibrary http://snipurl.com/loadlibrary
GetProcAddress http://snipurl.com/getprocaddress
FreeLibrary http://snipurl.com/freelibrary

> The second patch extends the OS interface in ways that will break
> legacy implementations.  A significant part of my income derives
> from people and companies who pay me to not do that.

If those implementations are not be broken by the current implementation
of loadext.c then surely these changes won't break them either. The
whole idea of have the OS interface is that it abstracts the OS away in
a single location. Hacking OS abstraction into other parts of the
codebase (e.g. the current loadext.c) is not the correct thing to do. In
any case, since all of those people/companies are either supported by
the current method of dlopen/sym/close as is currently used in
loadext.c, or they aren't using 3.3.7+

> I could perhaps fix up either patch to do the right thing, but
> then I would have no way of testing the results, since I do not
> have access to WinCE.

You do not need access to WinCE. It also breaks the build on Windows
when defining _UNICODE. I'm sure that you an set the _UNICODE define
(removing _MBCS) on your cross-compiler (if that is what you are using).
If you can you elaborate more on the requirements for changes to the OS
layer then I can adapt my patch to fit your requirements.

> The above are some of the reasons that there has been so little 
> movement on ticket #2023.
> 
> Your contributions are greatly appreciated.  Please do not let
> anything I say or do discourage you from contributing again to
> either SQLite or other open source projects.  User contributions
> are very important to open source projects like SQLite and I want
> to encourage them.  But you also need to understand that there is
> no guarantee that a patch will be accepted.  With SQLite in
> particular, with me in the drivers seat, it is very very difficult
> to get a patch accepted into the core.  It has been done, but it
> does not happen very often.  Usually, if I implement a suggested
> feature at all, I merely use the patch as a guideline to implement 
> my own changes.  Do not let this discourage you.  Your patch has
> been recorded in the bug tracking system, and I have studied it
> closely.  It will be likely used as a reference someday.  Just 
> not today.

Having these comments added to the bug system would be useful to start
with. You have your reasons for ignoring the bug, but with no movement
at all it is frustrating to have to continually patch the source just to
get it to build on Windows. Especially when it is so simple to get it to
work.

Regards,
Brodie

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Is sqlite the right db for me?

2006-12-17 Thread John Stanton
I can imagine that before long all firefighters will have internet 
connected equipment.  A handheld device with broadband access and GPS is 
an obvious move forward, both for safety, for rapid deployment of 
resources and for access to maps and logistics.


To design what you are doing now for the future would seem to be less 
wasteful of time and effort than to step back into old methods.


To be able to run your system via a cell phone could be very useful and 
avoid the need for distributed computers.


Steve Davis wrote:

Roger,

I genuinely appreciate your comments.

My consideration has been that although setting up a server and mySQL is
trivial for me, it might not be for someone else who isn't a geek.  But that
will have to be resolved in the installation process.

Thanks again. 



All the best 


Steve Davis

Steve Davis - too much time on his hands


-Original Message-
From: Roger Binns [mailto:[EMAIL PROTECTED] 
Sent: Sunday, 17 December 2006 5:39 PM

To: sqlite-users@sqlite.org
Subject: Re: [sqlite] Is sqlite the right db for me?

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Steve Davis wrote:
| Does that change your opinion?

Not in the slightest.  You can run the web server and browser on the same
machine as you have presumably already been doing.  (Unless you have been
using the word browser to mean something other than a web browser).

| It is not a web-based app, rather browser based.

Browser apps are web based.  Note that I never said the web server has to
run on a different machine.  However you do have that capability should you
need it in the future.  With a standard application, you can only make it
remotely available either by some heavyweight solution such as VNC/RDP or by
rewriting it.

| Many brigades do not have net access at their stations, they might 
| only have someone there once a fortnight, so it isn't viable.  Also 
| this app might also be used on a notebook at a remote location...where 
| there is often no mobile phone coverage.


The point is that networking is becoming more ubiquitous.  It might take
months or years, but eventually there will be more connections.  So you can
have a single standalone machine in the station running the app (both server
and browser).  But when it becomes network accessible in two years time,
someone on the road with a cellphone will be able to access the data.  Heck
if you have two machines in the station, the second one will be able to
access the web app on the first trivially.

| In fact, my mistake too...it is written in ASP/VBScript/MSaccess 
| because that is the language I knew at the time.  That's why it is 
| browser

based. I
| have since moved on (ahead?) and use PHP/mySQL.

A browser is a good environment to target.  The display easily resizes,
users can simply change things such as font sizes, printing is free, help is
easy to integrate and CSS can make it beautiful without too much effort.

The various web toolkits mentioned in the presentation I linked to make the
web app be significantly less effort.  One of the test apps written was a
time tracker.  For some of the toolkits, that was accomplished in
9 (yes nine) lines of code.

| The choice was to embellish it (a bit) to incorporate some DHTML or
rewrite
| it from scratch so it is not browser dependent which to me seems like 
| part of the evolutionary process.


Standard applications are a pain.  They are significantly harder and more
effort to write.  (Wait till you learn about layout management or have to
deal with people using different default font sizes).  There are a few more
things you can do in a standard app that you can't in a web app such as raw
access to hardware, or very complex user interaction.

Roger
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFFhPQfmOOfHg372QQRAu4SAJ4iIWUY/Q+i1T13W/ajreegoXM0dwCgwOTg
LQsAKL4pxcT0r/kVPMBBxyM=
=/JOw
-END PGP SIGNATURE-


-
To unsubscribe, send email to [EMAIL PROTECTED]

-



-
To unsubscribe, send email to [EMAIL PROTECTED]
-




-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Is sqlite the right db for me?

2006-12-17 Thread Derrell . Lipman
"Steve Davis" <[EMAIL PROTECTED]> writes:

> It is not a web-based app, rather browser based.  Many brigades do not have
> net access at their stations, they might only have someone there once a
> fortnight, so it isn't viable.  Also this app might also be used on a
> notebook at a remote location...where there is often no mobile phone
> coverage.
>
> In fact, my mistake too...it is written in ASP/VBScript/MSaccess because
> that is the language I knew at the time.  That's why it is browser based. I
> have since moved on (ahead?) and use PHP/mySQL.

One of the up-and-coming technologies is having javascript applications that
communication via "remote procedure calls" to a server.  You've probably heard
of AJAX which is a method of communicating the information between the browser
application and the server.

There are toolkits that make this kind of thing very easy.  For example, go to
http://www.qooxdoo.org and click on the "demo" link.

The backend, the server side, can be whatever you like.  I wrote a PHP backend
and there's also a Java backend.  Both are included with qooxdoo.  You write
the stubs that allow your javascript application to make specific remote
procedure calls.  You can link to whatever database you like, in the backend.
PHP has access to sqlite (and nearly every other database in existence).  I
don't do Java, but I'm sure there are Java bindings for sqlite.  Either of
these would let your application run nicely in the browser, avoiding the
hassles of writing a stand-alone application.

Cheers,

Derrell

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Re: Logo usage

2006-12-17 Thread Muhammad Hassan

Thanks

On 12/17/06, Martin Jenkins <[EMAIL PROTECTED]> wrote:


Muhammad Hassan wrote:

>  I just want to know if it is legal to use Sqlite logo on my companies
>  website technology page http://badrit.com/page/technology, i want to
>  refer to the technologies we used?

As I understand it, Dr Hipp has disclaimed all rights to the SQLite
software, his intention being that you can do anything you want with it.
The copyright release notice specifically states that:

>  "SQLite software" shall mean any computer source code, documentation,
makefiles,
>  test scripts, or other information that is published on the SQLite
website

so I'd say go ahead. If you're still worried there's a rather similar
image at http://en.wikipedia.org/wiki/SQLite

Martin



-
To unsubscribe, send email to [EMAIL PROTECTED]

-





--
السلام عليكم ورحمة الله وبركاته
Muhammad Hassan Nasr
www.BadrIT.com

mobile: +2 010 606 8822
e-mail: [EMAIL PROTECTED]


Re: [sqlite] Is sqlite the right db for me?

2006-12-17 Thread Martin Jenkins

Steve Davis wrote:

My consideration has been that although setting up a server and mySQL is
trivial for me, it might not be for someone else who isn't a geek.

You should take a look at http://www.cherrypy.org/ From that site:
CherryPy  is a pythonic, 
object-oriented HTTP framework. It provides the foundation over which 
complex web-based applications can be written, with little or no 
knowledge of the underlying protocols. CherryPy 
 allows developers to build web 
applications in much the same way they would build any other 
object-oriented Python program.

There's a tutorial at http://www.cherrypy.org/wiki/CherryPyTutorial

Martin

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Re: Logo usage

2006-12-17 Thread Martin Jenkins

Muhammad Hassan wrote:


 I just want to know if it is legal to use Sqlite logo on my companies
 website technology page http://badrit.com/page/technology, i want to
 refer to the technologies we used?


As I understand it, Dr Hipp has disclaimed all rights to the SQLite 
software, his intention being that you can do anything you want with it. 
The copyright release notice specifically states that:


 "SQLite software" shall mean any computer source code, documentation, 

makefiles,

 test scripts, or other information that is published on the SQLite website


so I'd say go ahead. If you're still worried there's a rather similar 
image at http://en.wikipedia.org/wiki/SQLite


Martin


-
To unsubscribe, send email to [EMAIL PROTECTED]
-



RE: [sqlite] Is sqlite the right db for me?

2006-12-17 Thread Steve Davis
Roger,

I genuinely appreciate your comments.

My consideration has been that although setting up a server and mySQL is
trivial for me, it might not be for someone else who isn't a geek.  But that
will have to be resolved in the installation process.

Thanks again. 


All the best 

Steve Davis

Steve Davis - too much time on his hands


-Original Message-
From: Roger Binns [mailto:[EMAIL PROTECTED] 
Sent: Sunday, 17 December 2006 5:39 PM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] Is sqlite the right db for me?

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Steve Davis wrote:
| Does that change your opinion?

Not in the slightest.  You can run the web server and browser on the same
machine as you have presumably already been doing.  (Unless you have been
using the word browser to mean something other than a web browser).

| It is not a web-based app, rather browser based.

Browser apps are web based.  Note that I never said the web server has to
run on a different machine.  However you do have that capability should you
need it in the future.  With a standard application, you can only make it
remotely available either by some heavyweight solution such as VNC/RDP or by
rewriting it.

| Many brigades do not have net access at their stations, they might 
| only have someone there once a fortnight, so it isn't viable.  Also 
| this app might also be used on a notebook at a remote location...where 
| there is often no mobile phone coverage.

The point is that networking is becoming more ubiquitous.  It might take
months or years, but eventually there will be more connections.  So you can
have a single standalone machine in the station running the app (both server
and browser).  But when it becomes network accessible in two years time,
someone on the road with a cellphone will be able to access the data.  Heck
if you have two machines in the station, the second one will be able to
access the web app on the first trivially.

| In fact, my mistake too...it is written in ASP/VBScript/MSaccess 
| because that is the language I knew at the time.  That's why it is 
| browser
based. I
| have since moved on (ahead?) and use PHP/mySQL.

A browser is a good environment to target.  The display easily resizes,
users can simply change things such as font sizes, printing is free, help is
easy to integrate and CSS can make it beautiful without too much effort.

The various web toolkits mentioned in the presentation I linked to make the
web app be significantly less effort.  One of the test apps written was a
time tracker.  For some of the toolkits, that was accomplished in
9 (yes nine) lines of code.

| The choice was to embellish it (a bit) to incorporate some DHTML or
rewrite
| it from scratch so it is not browser dependent which to me seems like 
| part of the evolutionary process.

Standard applications are a pain.  They are significantly harder and more
effort to write.  (Wait till you learn about layout management or have to
deal with people using different default font sizes).  There are a few more
things you can do in a standard app that you can't in a web app such as raw
access to hardware, or very complex user interaction.

Roger
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFFhPQfmOOfHg372QQRAu4SAJ4iIWUY/Q+i1T13W/ajreegoXM0dwCgwOTg
LQsAKL4pxcT0r/kVPMBBxyM=
=/JOw
-END PGP SIGNATURE-


-
To unsubscribe, send email to [EMAIL PROTECTED]

-



-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] Re: Logo usage

2006-12-17 Thread Muhammad Hassan

I just want to know if it is legal to use Sqlite logo on my companies
website technology page http://badrit.com/page/technology, i want to refer
to the technologies we used?
Please reply.
Thanks.

On 12/13/06, Muhammad Hassan <[EMAIL PROTECTED]> wrote:




Can i use Sqlite logo on my companies website technology page
http://badrit.com/page/technology, i want to refer to the technologies we
used?
Please reply.
Thanks.

--
Muhammad Hassan Nasr
www.BadrIT.com

 <[EMAIL PROTECTED]>





--

Muhammad Hassan Nasr
www.BadrIT.com