Re: [sqlite] Static sqlite3 library for Linux

2018-02-14 Thread Arjen Markus
If you use the amalgamated source, there is only one file to be compiled. That 
can be as simple as:

gcc -c sqlite3.c

ar r libsqlite3.a sqlite3.o



Any further dependencies are up to the linker. No need to worry about that.



Regards,



Arjen


> -Original Message-
> From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On 
> Behalf
> Of Petros Marinos
> Sent: Wednesday, February 14, 2018 3:30 PM
> To: sqlite-users@mailinglists.sqlite.org
> Subject: [sqlite] Static sqlite3 library for Linux
>
> Greetings dears!
>
> While I am trying to build a static library of another tool which is 
> dependent to sqlite,
> I need to use an sqlite3 static library as well. Still, in my Centos 7.4 
> system, I
> cannot find one. The error is shown below:
>
> /bin/ld: cannot find -lsqlite3
> collect2: error: ld returned 1 exit status
> make[1]: *** [astdb2sqlite3] Error 1
> make: *** [utils] Error 2
>
> When I look for one with:
>
> yum provides */libsqlite*.a
>
> I find the Windows version:
>
> /usr/x86_64-w64-mingw32/sys-root/mingw/lib/libsqlite3.a
>
> Which of course is useless:
>
> /usr/lib/gcc/x86_64-redhat-linux/4.8.5/.../.../.../.../lib64/libsqlite3.a: 
> error adding
> symbols: File format not recognized
> collect2: error: ld returned 1 exit status
> make[1]: *** [astdb2sqlite3] Error 1
> make: *** [utils] Error 2
>
> Is there any chance that I can find a Linux flavour static sqlite3 library, 
> or do I have
> to build from source?
>
> And if I have to build from source, is it recommended to use the 
> sqlite-autoconf or
> the sqlite-src pkg? Or does the amalgamation file could be of any use, so as 
> to
> avoid compilation etc?
>
> PS: One final relevant question, does the resulting libsqlite3.a file (when 
> built from
> source), includes any other libraries like libc.a, libthread.a etc? Is there 
> a way to
> avoid this?
>
> Thank you in advance for your time!
>
> Best Regards,
> Petros
> ___
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

DISCLAIMER: This message is intended exclusively for the addressee(s) and may 
contain confidential and privileged information. If you are not the intended 
recipient please notify the sender immediately and destroy this message. 
Unauthorized use, disclosure or copying of this message is strictly prohibited. 
The foundation 'Stichting Deltares', which has its seat at Delft, The 
Netherlands, Commercial Registration Number 41146461, is not liable in any way 
whatsoever for consequences and/or damages resulting from the improper, 
incomplete and untimely dispatch, receipt and/or content of this e-mail.
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] thousand separator for printing large numbers

2017-02-10 Thread Arjen Markus
> -Original Message-
> From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On 
> Behalf
> Of Simon Slavin
> Sent: Friday, February 10, 2017 2:36 PM
> To: SQLite mailing list
> Subject: Re: [sqlite] thousand separator for printing large numbers
>
>
> On 10 Feb 2017, at 1:25pm, Arjen Markus  wrote:
>
> > Not entirely, in German-spoken countries the apostrophe (') is often used 
> > as a
> thousands-separator.
>
> That's Switzerland, right ?  Not a member of the EU.  I didn't know it 
> covered other
> countries too.  Thanks.
>
> To make it worse still, the ISO standard says we should all be using a 
> non-breaking
> space, regardless of country.
>
I have seen it in presentations by German speakers (the nationality, not the 
language), mostly as an unnoticed mistake or perhaps an automatic correction by 
"helpful" presentation software. (Another fun exercise: collect the various 
date formats in use in various countries)

Regards,

Arjen

DISCLAIMER: This message is intended exclusively for the addressee(s) and may 
contain confidential and privileged information. If you are not the intended 
recipient please notify the sender immediately and destroy this message. 
Unauthorized use, disclosure or copying of this message is strictly prohibited. 
The foundation 'Stichting Deltares', which has its seat at Delft, The 
Netherlands, Commercial Registration Number 41146461, is not liable in any way 
whatsoever for consequences and/or damages resulting from the improper, 
incomplete and untimely dispatch, receipt and/or content of this e-mail.
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] thousand separator for printing large numbers

2017-02-10 Thread Arjen Markus
> -Original Message-
> From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On 
> Behalf
> Of Simon Slavin
>
> Just to add to what Clemens wrote, you would at least need ways of doing 
> comma-
> separation for thousands, dot-separation for thousands, and space-separator 
> for
> thousands.  Between them, those cover the USA, Canada, and all countries in 
> the
> EU.

Not entirely, in German-spoken countries the apostrophe (') is often used as a 
thousands-separator.

Regards,

Arjen





DISCLAIMER: This message is intended exclusively for the addressee(s) and may 
contain confidential and privileged information. If you are not the intended 
recipient please notify the sender immediately and destroy this message. 
Unauthorized use, disclosure or copying of this message is strictly prohibited. 
The foundation 'Stichting Deltares', which has its seat at Delft, The 
Netherlands, Commercial Registration Number 41146461, is not liable in any way 
whatsoever for consequences and/or damages resulting from the improper, 
incomplete and untimely dispatch, receipt and/or content of this e-mail.
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] TCL tests

2015-05-12 Thread Arjen Markus
Hi Sairam,



Hm,

Hi Sairam,

You should perhaps consult http://www.sqlite.org/tclsqlite.html as it describes 
the Tcl interface and the way to run the tests.

Regards,

Arjen

> -Original Message-
> From: sqlite-users-bounces at mailinglists.sqlite.org [mailto:sqlite-users-
> bounces at mailinglists.sqlite.org] On Behalf Of Sairam Gaddam
> Sent: Tuesday, May 12, 2015 9:21 AM
> To: General Discussion of SQLite Database
> Subject: Re: [sqlite] TCL tests
>
> But when I tried to run the following message/error pops up :
>
>
> invalid command name "sqlite3_test_control_pending_byte"
> while executing
> "sqlite3_test_control_pending_byte 0x001"
> (file "./tester.tcl" line 92)
> invoked from within
> "source $testdir/tester.tcl"
> (file "attach.test" line 19)
>
> How to overcome this ?
>
> On Tue, May 12, 2015 at 12:25 PM, Arjen Markus 
> wrote:
>
> > Hi Sairam,
> >
> >
> >
> > That ought to be easy:
> >
> >
> >
> > tclsh name-of-test-file.test
> >
> >
> >
> > You will need an installation of Tcl, but these are easy to find. One
> > place is at ActiveState's site, www.activestate.com/activetcl<
> > http://www.activestate.com/activetcl>, but it may be that you already
> > have it on your system.
> >
> >
> >
> > Regards,
> >
> >
> >
> > Arjen
> >
> >
> >
> > > -Original Message-
> > > From: sqlite-users-bounces at mailinglists.sqlite.org
> > > [mailto:sqlite-users- bounces at mailinglists.sqlite.org] On Behalf Of
> > > Sairam Gaddam
> > > Sent: Tuesday, May 12, 2015 8:47 AM
> > > To: General Discussion of SQLite Database
> > > Subject: [sqlite] TCL tests
> > >
> > > Can anyone kindly help me how to compile and run TCL test scripts ?
> > > All the test scripts are .test files and I need help in executing them.
> > > ___
> > > sqlite-users mailing list
> > > sqlite-users at mailinglists.sqlite.org
> > > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
> > >
> >
> > DISCLAIMER: This message is intended exclusively for the addressee(s)
> > and may contain confidential and privileged information. If you are
> > not the intended recipient please notify the sender immediately and
> > destroy this message. Unauthorized use, disclosure or copying of this
> > message is strictly prohibited. The foundation 'Stichting Deltares',
> > which has its seat at Delft, The Netherlands, Commercial Registration
> > Number 41146461, is not liable in any way whatsoever for consequences
> > and/or damages resulting from the improper, incomplete and untimely
> > dispatch, receipt and/or content of this e-mail.
> > ___
> > sqlite-users mailing list
> > sqlite-users at mailinglists.sqlite.org
> > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
> >
> ___
> sqlite-users mailing list
> sqlite-users at mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

DISCLAIMER: This message is intended exclusively for the addressee(s) and may 
contain confidential and privileged information. If you are not the intended 
recipient please notify the sender immediately and destroy this message. 
Unauthorized use, disclosure or copying of this message is strictly prohibited. 
The foundation 'Stichting Deltares', which has its seat at Delft, The 
Netherlands, Commercial Registration Number 41146461, is not liable in any way 
whatsoever for consequences and/or damages resulting from the improper, 
incomplete and untimely dispatch, receipt and/or content of this e-mail.


[sqlite] TCL tests

2015-05-12 Thread Arjen Markus
Hi Sairam,



That ought to be easy:



tclsh name-of-test-file.test



You will need an installation of Tcl, but these are easy to find. One place is 
at ActiveState's site, 
www.activestate.com/activetcl, but it may 
be that you already have it on your system.



Regards,



Arjen



> -Original Message-
> From: sqlite-users-bounces at mailinglists.sqlite.org [mailto:sqlite-users-
> bounces at mailinglists.sqlite.org] On Behalf Of Sairam Gaddam
> Sent: Tuesday, May 12, 2015 8:47 AM
> To: General Discussion of SQLite Database
> Subject: [sqlite] TCL tests
>
> Can anyone kindly help me how to compile and run TCL test scripts ?
> All the test scripts are .test files and I need help in executing them.
> ___
> sqlite-users mailing list
> sqlite-users at mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>

DISCLAIMER: This message is intended exclusively for the addressee(s) and may 
contain confidential and privileged information. If you are not the intended 
recipient please notify the sender immediately and destroy this message. 
Unauthorized use, disclosure or copying of this message is strictly prohibited. 
The foundation 'Stichting Deltares', which has its seat at Delft, The 
Netherlands, Commercial Registration Number 41146461, is not liable in any way 
whatsoever for consequences and/or damages resulting from the improper, 
incomplete and untimely dispatch, receipt and/or content of this e-mail.


Re: [sqlite] float to string conversion problem

2013-06-14 Thread Arjen Markus

Hi Richard,

On Fri, 14 Jun 2013 08:26:19 -0400
 Richard Hipp  wrote:



SQLite has its own printf() implementation.  It has to. 
If it used system
printf(), than certain LOCALE settings would turn "." 
into "," and

introduce syntax errors.

The build-in printf() of SQLite also introduces a number 
of useful new
formatting options, such as %q, %Q, %w, and %z.  Those 
extensions (and
others) are widely used internally by SQLite, so at this 
point it would be

a VERY big task to convert to system printf().



Yes, I saw your message, just after I pressed the send 
button.

So, this has nothing to do with some quirk of the system's
printf() family.

Regards,

Arjen



DISCLAIMER: This message is intended exclusively for the addressee(s) and may 
contain confidential and privileged information. If you are not the intended 
recipient please notify the sender immediately and destroy this message. 
Unauthorized use, disclosure or copying of this message is strictly prohibited.
The foundation 'Stichting Deltares', which has its seat at Delft, The 
Netherlands, Commercial Registration Number 41146461, is not liable in any way 
whatsoever for consequences and/or damages resulting from the improper, 
incomplete and untimely dispatch, receipt and/or content of this e-mail.




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


Re: [sqlite] float to string conversion problem

2013-06-14 Thread Arjen Markus

Hi Filipe,

On Thu, 13 Jun 2013 15:59:35 +0100
 Filipe Madureira  
wrote:

Hi,

I have a problem executing a query on a WinCE6 ARM 
device.
I use SQlite for years and tested on all types of 
devices including WinCE6 ARM and never had a problem.


But I have one problem on particular device that has a 
Texas Instruments ARM CPU with WinCE6.

A very simple way to reproduce my problem is:
Create Table t1(c1 DECIMAL(12,3))
Insert Into t1(c1) values(2.55)
Select c1 From t1

I run this "Select" with sqlite3_get_table()
The value I get is "3.,+"

It makes no sense, it is not even a number, and only 
happens if the decimal values have a number higher than 
5.

This seems to be a problem with this CPU/WinCE version.

I don't know SQLite source code, and it is huge, so can 
someone tell me where in the source code the float (or 
double, I don't know) value of 2.55 is being converted to 
a string to be outputed by sqlite3_get_table()?

Or any hint on how to track the problem?

Note: I copied the database file to my PC and the value 
stored there is 2.55, so the problem is retrieving the 
value on the device.




I have no solution to offer and you probably thought of it
yourseld too, but the + might be an attempt (rather
superfluous and annoying) to indicate upward rounding
took place.

Does this happen with an ordinary C program too? The 
culprit
would be the printf() family as implemented on the 
platform.

Can scanf() read this type of numbers?

Regards,

Arjen



DISCLAIMER: This message is intended exclusively for the addressee(s) and may 
contain confidential and privileged information. If you are not the intended 
recipient please notify the sender immediately and destroy this message. 
Unauthorized use, disclosure or copying of this message is strictly prohibited.
The foundation 'Stichting Deltares', which has its seat at Delft, The 
Netherlands, Commercial Registration Number 41146461, is not liable in any way 
whatsoever for consequences and/or damages resulting from the improper, 
incomplete and untimely dispatch, receipt and/or content of this e-mail.




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


Re: [sqlite] VC++ and SQLite

2012-11-13 Thread Arjen Markus

On Tue, 13 Nov 2012 09:51:01 -0500
 Arbol One  wrote:

Following the advice of MSN:
Open the project's Property Pages dialog box. For 
details, see Setting Visual C++ Project Properties. 
Click the C/C++ folder. 
Click the Advanced property page. 
Modify the Force Includes property. 

and now my Force Include property text entry box has the 
word: stdafx.h


This now produces the following error:
fatal error C1083: Cannot open include file: 'stdafx.h': 
No such file or directory

1>  strtools.cpp.
What else needs to be changed now?



This seems to be a project-specific header file that
in turn includes all manner of standard header files
and project-specific header files that change rarely.

I have seen it being referenced and created when starting
a project from scratch. The easiest way to deal with it
is probably to simply remove any reference to it.

Regards,

Arjen



DISCLAIMER: This message is intended exclusively for the addressee(s) and may 
contain confidential and privileged information. If you are not the intended 
recipient please notify the sender immediately and destroy this message. 
Unauthorized use, disclosure or copying of this message is strictly prohibited.
The foundation 'Stichting Deltares', which has its seat at Delft, The 
Netherlands, Commercial Registration Number 41146461, is not liable in any way 
whatsoever for consequences and/or damages resulting from the improper, 
incomplete and untimely dispatch, receipt and/or content of this e-mail.




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


Re: [sqlite] Tcl syntax help

2011-12-07 Thread Arjen Markus

Hi Shamil,

yes, John's is more concise and better still, it works:
my use of [list insert ...] caused the last element to be delimited by
{} as it contains spaces.

Regards,

Arjen

On 2011-12-08 05:06, Shamil F. Daghestani wrote:

Thanks. It works even with my original list: set roads [list {Miller lane} 
{Pine street} {Wilson blvd}]

/sd

-Original Message-
From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] 
On Behalf Of John Gillespie
Sent: Wednesday, December 07, 2011 5:22 PM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] Tcl syntax help

Try
set roads {"Miller lane" "Pine street" "Wilson blvd"}
set SQL "insert into myTable VALUES( '[join $road "','"]' )"
db eval $SQL
# note the single quotes on each side of the join command
# and the  argument to the join command.

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

Disclaimer:

This email and any files transmitted with it are confidential and intended 
solely for the use of the individual or entity to which they are addressed. If 
you are not the intended recipient or have received this email in error please 
notify the system manager and destroy this email. Any unauthorized copying, 
disclosure or distribution of the material in this e-mail is strictly 
forbidden. Please note that any views or opinions presented in this email are 
solely those of the author and do not necessarily represent those of the 
company. Finally, the recipient should check this email and any attachments for 
the presence of viruses. The company accepts no liability for any damage caused 
by any virus transmitted by this email.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users





DISCLAIMER: This message is intended exclusively for the addressee(s) and may 
contain confidential and privileged information. If you are not the intended 
recipient please notify the sender immediately and destroy this message. 
Unauthorized use, disclosure or copying of this message is strictly prohibited.
The foundation 'Stichting Deltares', which has its seat at Delft, The 
Netherlands, Commercial Registration Number 41146461, is not liable in any way 
whatsoever for consequences and/or damages resulting from the improper, 
incomplete and untimely dispatch, receipt and/or content of this e-mail.




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


Re: [sqlite] Tcl syntax help

2011-12-07 Thread Arjen Markus

Hi Shamil,

I am not an expert in SQL, but how about:

set sqlRoads {}
foreach road $roads {
   lappend sqlRoads "'$road'"
}
db eval [list insert into myTable VALUES([join $sqlRoads ,])]

That way, the values are properly formatted, delimited by single quotes
and separated by commas.

Regards,

Arjen


On 2011-12-07 07:57, Shamil F. Daghestani wrote:

I have variables containing lists of values I'd like to insert into a table one row at a 
time.  For example: if I have a variable called "road" containing three items: 
Miller lane, Pine street, Wilson blvd.  How can I insert each of the road names in 
separate columns in my table?  Something like:

db eval {insert into myTable VALUES($roads)}

I understand I can split the list, save each road name in a variable, and 
insert them by putting them into the table with something like
... VALUES($v1,$v2,$v3)

But I don't want to do that because I have over one hundred columns and don't 
want to clutter my code.

Thanks!




Disclaimer:

This email and any files transmitted with it are confidential and intended 
solely for the use of the individual or entity to which they are addressed. If 
you are not the intended recipient or have received this email in error please 
notify the system manager and destroy this email. Any unauthorized copying, 
disclosure or distribution of the material in this e-mail is strictly 
forbidden. Please note that any views or opinions presented in this email are 
solely those of the author and do not necessarily represent those of the 
company. Finally, the recipient should check this email and any attachments for 
the presence of viruses. The company accepts no liability for any damage caused 
by any virus transmitted by this email.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users






DISCLAIMER: This message is intended exclusively for the addressee(s) and may 
contain confidential and privileged information. If you are not the intended 
recipient please notify the sender immediately and destroy this message. 
Unauthorized use, disclosure or copying of this message is strictly prohibited.
The foundation 'Stichting Deltares', which has its seat at Delft, The 
Netherlands, Commercial Registration Number 41146461, is not liable in any way 
whatsoever for consequences and/or damages resulting from the improper, 
incomplete and untimely dispatch, receipt and/or content of this e-mail.




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


Re: [sqlite] bug with sqlite

2011-03-29 Thread Arjen Markus
Hi,

is this under Windows? con is one of the reserved file names, dating
from the DOS days (or even before that). Other reserved names are aux, 
nul and prn (I think there is a fifth, but I cannot remember that one).

So, that has nothing to do with SQLite itself.

Regards,

Arjen


On 2011-03-28 21:26, Felix Zimmermann wrote:
> hi
> why isnt it possible to create a database file with the name "con" ? i just 
> doesnt work. no matter what file extension im taking.
> 
> regrets
> Felix
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> 
 

DISCLAIMER: This message is intended exclusively for the addressee(s) and may 
contain confidential and privileged information. If you are not the intended 
recipient please notify the sender immediately and destroy this message. 
Unauthorized use, disclosure or copying of this message is strictly prohibited.
The foundation 'Stichting Deltares', which has its seat at Delft, The 
Netherlands, Commercial Registration Number 41146461, is not liable in any way 
whatsoever for consequences and/or damages resulting from the improper, 
incomplete and untimely dispatch, receipt and/or content of this e-mail.




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


Re: [sqlite] What languages can include SQLite statically?

2010-05-21 Thread Arjen Markus
Hi,

On 2010-05-21 12:11, Jean-Denis Muys wrote:
> Well the answer is: any language with an external interface to the C ABI can
> link to the SQLite compiled C object code (on my planet they don't have .OBJ
> nor .LIB extensions. Perhaps we are not on the same planet) to yield an
> executable (I guess that's what you mean by 'EXE').
> 
> That include any C-family language of course: C, C++, Objective-C. Or even
> Go, though it's difficult to classify Go in the C family.
> 
> It should also be possible in Fortran for example, not that I can think of a
> good use case :-).
> 

Well, depending on your planet this can be said for any language :), but
it is indeed possible to use SQLite3 in a Fortran program. There are
actually two different bindings that I know of (one is my own - 
http://flibs.sf.net).

Regards,

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


Re: [sqlite] What languages can include SQLite statically?

2010-05-21 Thread Arjen Markus
Hi Gilles,

I do not quite understand why this is important to you, but the answer
is independent of SQLite itself - and it is a trifle complicated.

You can add Fortran to the list below - either a static or a dynamic
library will do fine.

If you look at Tcl, the matter becomes more complicated:
- Tcl supports static packages, in which case you can add a static
   library to the link step (and add a call to the proper Tcl functions
   to initialise it).
- Tcl also supports dynamically loading packages, in which case you
   need a dynamic library. But, and here comes the complication, you
   can also wrap the Tcl runtime executable and all (!) its dependencies
   into a single file. In fact there are various options to do so,
   for instance via Tclkit (you get a so-called starkit then).
   Does that count as a single EXE? You only need to distribute a
   single file - but there is still a dynamic library in there
   somewhere.

I am not very familiar with other dynamic languages (scripting
languages if you want), but I understand they have similar
technologies.

A language where this is definitely not possible is Java. There
you need to supply separate jar-files and native libraries. But
again, that is a matter of the _language mechanisms_, not of
SQLite. (The same for C#, if I am not grossly mistaken)

Regards,

Arjen

On 2010-05-21 11:31, Gilles Ganault wrote:
> Hello
> 
> My C skills are very basic. I was wondering: After compiling SQLite
> into an .OBJ or .LIB file, what languages can be used to include this
> output into a main program, so we end up with a single EXE.
> 
> I assume we have the choice of:
> - C
> - C++
> - Delphi (?)
> - Other?
> 
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] [Windows] Good GUI alternative to sqlite.exe?

2009-10-23 Thread Arjen Markus
How about SQLIteStudio? http://sqlitestudio.one.pl/index.rvt

Regards,

Arjen

On 2009-10-23 12:54, Gilles Ganault wrote:
> On Fri, 23 Oct 2009 11:13:05 +0100, "O'Neill, Owen"
>  wrote:
>> http://sqlitebrowser.sourceforge.net/screenshots.html
> 
> Thanks for the pointer.
> 
> "Version 1.2 released - 04/05/2005"
> "SQLite Database Browser requires Trolltech's QT"
> 
> I'll give it a shot but if I find something more recent and
> dependence-free, I'll report back.
> 
> ___
> 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] New Book Available

2009-07-10 Thread Arjen Markus
Hello Rich,

being a countryman of Rick's it was probably easier for me to
spot the typo ;).

Regards,

Arjen

On 2009-07-10 15:14, Rich Shepard wrote:
> On Thu, 9 Jul 2009, Arjen Markus wrote:
> 
>> there is a small typo there: Rick van der Lans (just one "a")
> 
>Thank you. I saw that after I sent the message to the list. My apologies
> to Rick.
> 
>> The 4th edition did not show up yet ...
> 
>I have a copy on my bookshelf that I purchased last year.
> 
> Rich
> 
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] New Book Available

2009-07-10 Thread Arjen Markus
Hi,

there is a small typo there: Rick van der Lans (just one "a")
The 4th edition did not show up yet ...

Regards,

Arjen

On 2009-07-09 15:50, cmar...@unc.edu wrote:
> On Thu, 9 Jul 2009, Rich Shepard wrote:
> 
>>   Rick van der Laans, who wrote the excellent "Introduction to SQL, 4th Ed."
>> (and eariler editions, of course) has just had his new book specific to
>> SQLite published. It is another resource for those who want a detailed
>> explanation of how to get the most from this great tool.
> 
> What is the title? I am not finding a new book by van der 
> Laans book on Google or Amazon.
> 
> Chris
> 
> ___
> 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] how to build TCL testing environment

2009-06-15 Thread Arjen Markus
Hello,

you can either install a Tcl distribution like ActiveState's 
(www.activestate.com) or use a tclkit - a standalone Tcl executable
(see: http://code.google.com/p/tclkit/)

Regards,

Arjen

On 2009-06-15 08:27, ??? wrote:
>  Hello,Everyone
>   I just have a project based on SQLite.For some reasons, I have to change 
> SQLite source code to cater for our requirement .
>   There are a lot of TCL Testing cases in the SQLite. So I want to configure 
> the testing environment in the Windows Operation System to  test  by TCL 
> scripts. So how can I achieve this goal to verify the SQLite Source Code ?
>   It 's a little urgent , someone can help me?
> thanks, :)
>  
>   
>  William Billy
> ___
> 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] "parameters are not allowed in views"

2009-02-28 Thread Arjen Markus
Hello Alexey,

uh, yes, that is true. But preprocessing the value of
user_id, etc. should insulate you from that sort of things, right?
Unfortunately, the Tclers' Wiki does not give a ready solution for
that. But with

[string map {\; "" \[ "" \] "" $user_id]

you can get rid of most threats, right?

Regards,

Arjen

On 2009-02-27 16:01, Alexey Pechnikov wrote:
> Hello!
> 
> On Friday 27 February 2009 17:32:36 Arjen Markus wrote:
>> This is the Tcl binding, right?
>> You could replace the variable by its value using [string map]:
>>
>> db eval [string map [list USER_ID $user_id ...] $sql_statement]
>>
>> or more directly:
>>
>> db eval \
>>  "CREATE TABLE view_report_01 AS ...
>>  WHERE u.id = $user_id
>>  ..."
>>
> 
> With SQL injection security problems as result. It's not a good decision.
> 
> 
> Best regards.
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Delft Hydraulics, GeoDelft, the Subsurface and Groundwater unit of TNO and 
parts of Rijkswaterstaat have joined forces in a new independent institute for 
delta technology, Deltares. Deltares combines knowledge and experience in the 
field of water, soil and the subsurface. We provide innovative solutions to 
make living in deltas, coastal areas and river basins safe, clean and 
sustainable. 

 

DISCLAIMER: This message is intended exclusively for the addressee(s) and may 
contain confidential and privileged information. If you are not the intended 
recipient please notify the sender immediately and destroy this message. 
Unauthorized use, disclosure or copying of this message is strictly prohibited.
The foundation 'Stichting Deltares', which has its seat at Delft, The 
Netherlands, Commercial Registration Number 41146461, is not liable in any way 
whatsoever for consequences and/or damages resulting from the improper, 
incomplete and untimely dispatch, receipt and/or content of this e-mail.




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


Re: [sqlite] "parameters are not allowed in views"

2009-02-28 Thread Arjen Markus
This is the Tcl binding, right?
You could replace the variable by its value using [string map]:

db eval [string map [list USER_ID $user_id ...] $sql_statement]

or more directly:

db eval \
 "CREATE TABLE view_report_01 AS ...
 WHERE u.id = $user_id
 ..."

Regards,

Arjen
On 2009-02-27 15:28, Alexey Pechnikov wrote:
> Hello!
> 
> Is there way to careate view such as
> 
> db eval {
> CREATE TABLE view_report_01 AS
> ?SELECT s.name ?AS service_name,
> ? t_l_r.cost AS cost
> ?FROM work.users ? AS u,
> ? work.user_contracts ?AS u_c,
> ? work.user_services ?AS u_s,
> ? work.services ? AS s,
> ? telephony.telephony_log_rating AS t_l_r,
> ? telephony.telephony_log ?AS t_l
> ?WHERE u.id = $user_id
> ?AND u.id = u_c.user_id
> ?AND u_c.id = u_s.owner_id
> ?AND u_s.service_id = s.id
> ?AND u_s.id = t_l_r.user_service_id
> ?AND t_l_r.log_id = t_l.rowid
> ?AND ($date_from = '' OR julianday(date2iso($date_from)) < t_l.date_start)
> ?AND ($date_to = '' OR (julianday(date2iso($date_to)) + 1) > t_l.date_start)
> }
> 
> I have params $user_id, $date_from, $date_to. There are a lot of queries to 
> this view and is needed to place params in the view.
> 
> Best regards.
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Delft Hydraulics, GeoDelft, the Subsurface and Groundwater unit of TNO and 
parts of Rijkswaterstaat have joined forces in a new independent institute for 
delta technology, Deltares. Deltares combines knowledge and experience in the 
field of water, soil and the subsurface. We provide innovative solutions to 
make living in deltas, coastal areas and river basins safe, clean and 
sustainable. 

 

DISCLAIMER: This message is intended exclusively for the addressee(s) and may 
contain confidential and privileged information. If you are not the intended 
recipient please notify the sender immediately and destroy this message. 
Unauthorized use, disclosure or copying of this message is strictly prohibited.
The foundation 'Stichting Deltares', which has its seat at Delft, The 
Netherlands, Commercial Registration Number 41146461, is not liable in any way 
whatsoever for consequences and/or damages resulting from the improper, 
incomplete and untimely dispatch, receipt and/or content of this e-mail.




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


Re: [sqlite] Which TCL distrabution for Windows XP for running SQLite tests?

2008-11-24 Thread Arjen Markus
Shane Harrelson wrote:

>
>It wasn't a loss of precision, it was mearly a display issue.   The Windows
>ActiveTCL 8.5
>distribution might display the floating point value as "5.4e-018" while the
>"unix"
>TCL 8.5 version would display "5.4e-18" (or something similar).   There's
>probably
>an option to control this in TCL, but I couldn't find it with a quick check.
>
>  
>
I do not think Tcl offers you such an option: this sort of things is 
hidden in the
depths of the C runtime library. Your best option would be to compare 
numbers
as numbers, not just as text.

Regards,

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


Re: [sqlite] Static embedding sqlite and compiling in gcc

2008-09-17 Thread Arjen Markus
icantthinkofone wrote:

>I lost my note on what I did to make this work.  I've rearranged my
>computers for work and installed sqlite3 on Ubuntu.  When I installed
>sqlite3, I did ./configure --disable-shared. When I recompile my working
>code on the new machine:
>gcc -static -L/usr/local/lib -I/usr/local/include mycode.o -lsqlite3
>-ldl -lpthread -o mycode
>the code compiles and runs on a server but the compiler gives the
>warning "Using 'dlopen' in statically linked applications requires the
>shared libraries from the glibc version used for linking".  It doesn't
>do that on the old one but I remember having this issue.  I just don't
>recall how to solve it.  A little help would be appreciated.
>  
>
Why do you use -ldl in the link step? That brings in the dynamic loader 
dlopen.
An alternative would be to explicitly specify libsqlite3.a instead of 
-lsqlite3.

Regards,

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


Re: [sqlite] GCC -ffast-math safe version of sqlite3IsNaN

2008-08-27 Thread Arjen Markus
Brown, Daniel wrote:

>Unfortunately our build system is automated and not particularly agile, it can 
>be done but it would be preferred not to have to do that and to replace the 
>offending function instead but I've never had to write a IsNaN test.
>
>  
>
I had a look at the sourcecode for sqlite3IsNaN():

SQLITE_PRIVATE int sqlite3IsNaN(double x){
  /* This NaN test sometimes fails if compiled on GCC with -ffast-math.
  ** On the other hand, the use of -ffast-math comes with the following
  ** warning:
  **
  **  This option [-ffast-math] should never be turned on by any
  **  -O option since it can result in incorrect output for programs
  **  which depend on an exact implementation of IEEE or ISO
  **  rules/specifications for math functions.
  **
  ** Under MSVC, this NaN test may fail if compiled with a floating-
  ** point precision mode other than /fp:precise.  From the MSDN
  ** documentation:
  **
  **  The compiler [with /fp:precise] will properly handle comparisons
  **  involving NaN. For example, x != x evaluates to true if x is NaN
  **  ...
  */
#ifdef __FAST_MATH__
# error SQLite will not work correctly with the -ffast-math option of GCC.
#endif
  volatile double y = x;
  volatile double z = y;
  return y!=z;
}

So it looks as if you have little choice. I'd say, Mike's suggestion is the
least painful.

Regards,

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


Re: [sqlite] Lemon

2008-06-27 Thread Arjen Markus
> Hi,
> Can u send me any documentation on LEMON that u have worked out.
> I have some queries also.
> 1.Does LEMON work on Windows environment?
> 2.I tried but it is not.I heard that it works on Linux environment.I am
> trying to know why not on windows...can u give me some info about it
>
> I am reading the material u have suggested me but it did not have any
> information regarding to my queries.
>
> Can u mail me if u have made any documentation on LEMON.
>

Well, basically lemon works as follows:
1. It reads the definition of the parser from the input file
   you give it as the first argument. From that it produces
   a set of tables that implement the parser. This information
   gets filled in in a template.
2. The result is a C file that you can use to parse (interpret)
   your input.
3. What it does not do is split up the input into tokens. You
   have to do that yourself.

I attach a small - not very efficient - example that shows a
few features of lemon.

As for your questions:
There is no reason it would not work on Windows: it is a
perfectly straghtforward C program, you get the source code
and compile it. One thing though: the template file must be
in the directory where you run the program, where the
executable lives or in the PATH.

(I am using it myself on Windows :). I am adapting it so that
it will produce Fortran code instead of C code. But that is
off topic.)

Here is my sample parser definition:

// expr.y
// Simple parser:
// expr = vaue + value + value + ...

%extra_argument {State *state}
%token_type {Token*}
%type term {int}

expr ::= firstterm plusterms . {
printf( "Result: %d\n", state->sum );
}

firstterm ::= term(T) . {
state->sum = T;
printf("First term: %d\n", T );
}

term(V) ::= NUMBER(N) . {
sscanf( N->token, "%d", &V );
printf("Term: %d -- %s\n", V, N->token );
}

plusterms ::= .
plusterms ::= plusterms plusterm .

plusterm ::= PLUS term(T) . {
state->sum = state->sum + T;
printf( "Result so far: %d\n", state->sum );
}

--
And here is the main program that includes the
resulting C code:

#include 
#include 
#include 

typedef struct {
char *token;
} Token;
typedef struct {
int sum;
} State;

#include "expr.h"
#include "expr.c"

int main( int argc, char *argv[] ) {
Token token[10];
State state;

void *pParser = (void *) ParseAlloc( malloc );

ParseTrace( stdout, ">>" );

token[0].token = "1"; Parse( pParser, NUMBER, &token[0], &state );
token[1].token = "+"; Parse( pParser, PLUS,   &token[1], &state );
token[2].token = "2"; Parse( pParser, NUMBER, &token[2], &state );
token[3].token = "+"; Parse( pParser, PLUS,   &token[3], &state );
token[4].token = "3"; Parse( pParser, NUMBER, &token[4], &state );

Parse( pParser, 0, &token[0], &state );

ParseFree( pParser, free );

return 0;
}

-
One thing to note:
As the tokens are not always treated the moment they are passed
to the parser - this depends on the grammar and the moment in the
parsing process, you need to make sure that the tokens remain
available. I have done that in this silly program by using an
array of them. But a smarter program would use lemon's
abilities to destroy the tokens when ready.

Regards,

Arjen

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


Re: [sqlite] Lemon

2008-06-25 Thread Arjen Markus
arjunkumar keerti wrote:

>Hi,
>I found in wikipedia that Lemon parser is a part of SQLite project but i
>couldn't found any sort of information regarding to LEMON.
>Can u give me any documentation regarding how to install it and how to work
>for some programs on Lemon parser generator or any URL's that might be
>helpful and can download the information regarding LEMON.
>
>  
>
You can find information on lemon at: http://www.hwaci.com/sw/lemon/

(And having gained some limited experience with it myself, this last 
week, I can
say it works quite nicely, with one or two caveats, perhaps :))

Regards,

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


Re: [sqlite] Writing double into a socket file

2008-06-10 Thread Arjen Markus
> I am going to guess yes.
>
> On Mon, Jun 9, 2008 at 9:58 PM, Russell Leighton
> <[EMAIL PROTECTED]>
> wrote:
>

>>
>> Aren' t there aligment and endian issues as well as potential floating
>> point representations between platforms?
>>

As most computers nowadays use the IEEE standard to represent
floating-point numbers this problem is much less complicated
than it used to be. I think only endian problems are left and
these are (relatively) easy to deal with.

Regards,

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


Re: [sqlite] Open-source project hosting at SQLite.org. Was: .net wrappers - mono vs. phxsoftware

2008-05-28 Thread Arjen Markus
D. Richard Hipp wrote:

>On May 28, 2008, at 11:24 AM, Robert Simpson wrote:
>
>  
>
>>You can browse the SVN sources for Mono.Data.SQLite here: ...
>>
>>
>
>FWIW, I hereby make the following offer to any open-source projects  
>related to SQLite:
>
> *   A third-level domain name.  Ex:   mono.sqlite.org
> *   Your own website.  Ex:   www.mono.sqlite.org
> *   A fossil repository for storing your files.
> *   Links to your site from the main SQLite website.
>
>Requests for new repositories will be evaluated based on the quality  
>of the project and the relevance of the project to the SQLite core.  I  
>am looking for projects that add significant value to SQLite.   
>Examples of the projects I am looking for include things like Robert  
>Simpson's Mono interface, ODBC drivers, bindings to other languages  
>(ex: Lua, Lisp, Fortran, etc.), and/or GUI database management tools  
>designed especially for SQLite.
>
>  
>
Hello,

this might be a nice opportunity to give my Fortran interface to SQLite 
a bit
more publicity. The source code is now part of my Flibs project 
(http://flibs.sourceforge.net),
but that means there is no obvious relation to SQLite as such.

Regards,

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


Re: [sqlite] Re: select round(98926650.50001, 1) ?

2007-09-05 Thread Arjen Markus

Doug Currie wrote:


I suspect the bug is in the functions that convert between string and
double; that's why I keep harping on Steele and White's (and
Clinger's) PLDI 1990 papers. What I don't know is why this bug appears
in the binary from sqlite.org but not in the version I build myself
with gcc 3.4.5 from SQLite version 3.4.2 source.

 

The implementation of that algorithm is far from trivial. It actually 
requires the

use of an arbitrary-precision library (or so at least is my understanding).

Regards,

Arjen



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



Re: [sqlite] Re: select round(98926650.50001, 1) ?

2007-09-03 Thread Arjen Markus

Serena Lien wrote:


Okay, but even if the rounded result does not have a finite binary
representation, shouldn't the displayed (human readable) representation be
at least truncated to the number of decimal places that were requested in
the round function? Not that I am confusing round with truncate, but surely
it is a more acceptable result?
 

Hm, that is a completely different question. It would mean that more 
information is
associated with the rounded result than merely the number (in internal 
representation).
I do not know enough about the way SQLite organises these things to 
speculate about

that, but it seems like a computational burden to me:

Suppose you have one million records to search for numbers that are then 
rounded. Not
only would you need to compute and store the rounded numbers but also 
the string
representation (or something to effect that you can get a proper decimal 
presentation).


Regards,

Arjen


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



Re: [sqlite] Re: select round(98926650.50001, 1) ?

2007-09-03 Thread Arjen Markus

Serena Lien wrote:


I have read some of the postings/faq about the difficulties with the round
function, when certain numbers do not have a finite representation in
binary, which SQLite uses. eg 9.95 is actually 9.9499...etc so that round(
9.95, 1) rounds down.

But, I have found several numbers which don't get rounded at all, and in
fact return more decimal places!

round(98926650.5, 1) -> 98926650.501
round(85227887.01, 1) -> 85227887.001

Even if these numbers cannot be represented properly in binary, why is it
they aren't rounded?

thanks for any assistance,
Serena
 

They are in fact rounded, but the internal binary representation can not 
be turned

into the appropriate decimal (and human readable) representation due to the
finite precision.

A number like 1.511 can be rounded to 1.5 and that is _exactly_ 
representable
as binary number. But if, as in your examples, the number requires more 
precision
than is available (remember: only a finite number of digits/bits in 
total, no matter

what the position of the decimal point/comma), the old problem of binary-to-
decimal conversion kicks in again.

Regards,

Arjen


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



Re: [sqlite] Sqlite 14 (cant open database)

2007-05-03 Thread Arjen Markus

Lloyd wrote:


This error occurs only on FAT 32 file system! I have a directory with
32764 files. one of the file is my sqlite database. It seems that, when
the file count reaches around this particular no. the SQLite cant open
database error occurs. Can anybody give me some hint? (I am mounting
FAT32 file system on my Linux)

 

That is a very large number of files! I know FAT32 can not handle files 
larger than
2 GB, and I imagine there is limit on the number of files as well. Try 
creating
some subdirectories and moving the files there. The problem is most 
likely in the filesystem.


Regards,

Arjen

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



Re: [sqlite] TCL Binding with VC6

2007-04-30 Thread Arjen Markus

yazan wasfi wrote:

Hi All,

I'm trying to compile sqlite with TCL enabled under VC6, Ive installed 
ActiveTCL8.4, and Added the include, lib, bin, to my VC6 project, when 
compiling the sqlite, I dont get any errors, but when trying to link it I get 
49 errors like this
Linking...
tclsqlite.obj : error LNK2001: unresolved external symbol __imp__Tcl_PkgProvide
tclsqlite.obj : error LNK2001: unresolved external symbol __imp__Tcl_Free
tclsqlite.obj : error LNK2001: unresolved external symbol __imp__Tcl_DStringFree
tclsqlite.obj : error LNK2001: unresolved external symbol __imp__Tcl_SetResult
tclsqlite.obj : error LNK2001: unresolved external symbol __imp__Tcl_Alloc
tclsqlite.obj : error LNK2001: unresolved external symbol 
__imp__Tcl_WrongNumArgs

I've included the c:/tcl/lib to my projects settings, but I'm not sure if there 
should be any other folders/files that should be added,
  
It looks as if you have left out a library in the link statement. The 
relevant library is tcl84.lib or if you compile

with stubs, tclstub84.lib in c:/tcl/lib.

Regards,

Arjen


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



Re: [sqlite] Fortran 95 Language Bindings

2007-04-23 Thread Arjen Markus

Liam Healy wrote:


Arjen,

Thank you for attentive maintenance and development on this valuable
interface.


Thanks, Gary's and your interest in a Fortran wrapper were enough to
revive my activities in this area.  With the documentation (almost) 
completed,
I guess it is time to add the link to the overview of wrappers in the 
SQLite Wiki.


Regards,

Arjen


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



Re: [sqlite] Fortran 95 Language Bindings

2007-04-23 Thread Arjen Markus

Liam Healy wrote:


Arjen,

I've taken another look at these bindings, and at my project.  For a 
variety
of reasons, most not related to the sqlite3 Fortran bindings, I have 
decided
to proceed in a different direction.  However, on closer examination 
of the
Fortran bindings and other language bindings to sqlite3 (C and Common 
Lisp
via CLSQL), I notice that there is no equivalent of 
sqlite3_get_table.  This

would make my use of a Fortran interface considerably more difficult.  At
first I thought there was no equivalent of sqlite3_exec but on closer
examination it appears that sqlite3_do performs that role.


Liam,

I added the subroutine sqlite3_get_table to the Fortran bindings. You will
need to use the CVS repository to get it (I have not released a new
version of the flibs stuff yet), but it works as simple as you might
expect -  see csvdata.f90 in the tests/sqlite directory.

Regards,

Arjen

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



Re: [sqlite] Fortran 95 Language Bindings

2007-04-19 Thread Arjen Markus

Liam Healy wrote:


Arjen,

I've taken another look at these bindings, and at my project.  For a 
variety
of reasons, most not related to the sqlite3 Fortran bindings, I have 
decided
to proceed in a different direction.  However, on closer examination 
of the
Fortran bindings and other language bindings to sqlite3 (C and Common 
Lisp
via CLSQL), I notice that there is no equivalent of 
sqlite3_get_table.  This

would make my use of a Fortran interface considerably more difficult.  At
first I thought there was no equivalent of sqlite3_exec but on closer
examination it appears that sqlite3_do performs that role.


Hello Liam,

hm, I have always thought of sqlite3_get_table() as a mere convenience 
function.
From the documentation it seems to be fairly easy to wrap this function 
as well

(some care needs to be taken about the allocated memory, so the Fortran
version would use an argument of type "character(len=*), dimension(:,:), 
pointer"
that the Fortran user should deallocate - no need to call 
sqlite3_free_table()).


Yes, sqlite3_do is a wrapper around sqlite3_exec(). I do not remember why
I chose that particular name - possibly to avoid any potential name 
clash, or

because I found the verb "do" more appropriate ;).

Even if you are not going to use these bindings, thanks for your comments.

Regards,

Arjen

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



Re: [sqlite] Fortran 95 Language Bindings

2007-04-16 Thread Arjen Markus

Gary Scott wrote:


Hi, CVF initially.  I will likely transition to IVF once a suitable version is 
released.

 

Well, that should be easy enough - MSVC/CVF is the platform I used to 
develop the interface.


I managed to extend the documentation on the interface last night - see 
http://flibs.sf.net -
actually it took me an embarrassingly small amount of time to fill in 
the big gap I had left there.
If there is anything unclear about it, let me know and I will try to fix 
it. Also, if you see any obvious

omissions from the full SQLite API, let me know.

The best way forward would be a "real" project, rather than any of the 
toys I have dabbled with.


Regards,

Arjen

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



Re: [sqlite] Fortran 95 Language Bindings

2007-04-16 Thread Arjen Markus

Gary Scott wrote:



I do not possess a C compiler, so I will need an all-Fortran solution, 
unless the C interface is provided as a compiled binary.


What Fortran compiler do you prefer? I can supply a precompiled C 
library that should be suitable
for a number of Fortran compilers (CVF, IVF on Windows, g95 on 
Linux/MingW or gfortran on Linux/Cygwin

for instance).

Regards,

Arjen

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



Re: [sqlite] Fortran 95 Language Bindings

2007-04-16 Thread Arjen Markus

Gary Scott wrote:


Liam Healy wrote:


I am very interested in this for a project of increasing urgency.  A few
months ago
I found the two links that the other emails mentioned, but found both of
them
inadequate and not well documented.  I think a  complete, documented
F95 API would be very useful.  I am willing to help and critique as time
allows;
I would be using gfortran on linux/amd64 if that makes a difference.



I like Arjen's project as it mirrors my design thoughts somewhat.  I 
am however unsure how it can be done in a compiler independent manner 
(I see no such markup in Arjen's work, however, so what am I 
missing?). The Fortran standard does not guarantee any particular 
argument passing mechanism.  It might use pass by reference or value 
or register at its own choosing depending on many factors, including 
optimization settings.  There is no standard way for the application 
programmer to choose. Each compiler vendor provides it's own unique 
method of adjusting calling mechanisms  and many do not by default 
match C.  Some compiler's are now beginning to support standard 
conforming mechanisms (which may not cover all cases still), but that 
will be rare for a year or two. I'll be out of town for the next week, 
hoping for approval to use SQLite in my project.  Without that 
approval, my incenstive will be less.  I do see this as an important 
need however.


Let me first tell you that I was inspired by Al Danial's work on a 
FORTRAN 77 interface for SQLite. I felt however
that with Fortran 95 a more generic interface would be possible and that 
is what I implemented. I have ample experience
with combining C and Fortran routines on a variety of platforms and the 
concerns Gary has are taken care of in

this implementation, though not in the most general way possible:
- I prefer putting the compiler-dependent parts in the C code
- On Windows you need to specify a particular calling convention 
(__stdcall), rather than the default.
 On UNIX and Linux there is no such distinction. I take care of that 
via the macro FTNCALL in csqlite.c
- Various Fortran compilers use different "name mangling" schemes - the 
name of a routine is decorated
 with one and sometimes two underscores or the name is capitalised. 
This is taken care of in the C code

 but not completely.
- There is also the matter of passing the implicit length of strings. 
This is done via the macro INBETWEEN:
 some Fortran compilers put the length directly after the string 
argument, others do it by appending these

 hidden arguments at the end.
- Note that the C routines have interfaces that are compatitble to 
FORTRAN 77 (i.e. no intent, no derived types,

 ...)
- The code should work alright on 64-bits machines (one of the things I 
adopted from Al's work)


Liam,

could you explain in some detail what you find inadequate? I know I 
should add more documentation, but
the functions as implemented ought to be useful enough. I have not much 
experience with building extensive
database applications, so that may show in the implementation. But I 
welcome comments and will revive

the work on this interface.

Regards,

Arjen


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



Re: [sqlite] Fortran 95 Language Bindings

2007-04-15 Thread Arjen Markus
> Hi, this is my first post, so please excuse any etiquette goofs.  I'm
> researching incorporation of SQLite into a project.  It would appear
> relatively straightforward to develop an F95 language binding, however
> it is likely to be compiler specific (extensions required to adapt
> calling syntax to C).  Is this a suitable place to ask basic C-oriented
> questions relative to the existing API?  Also, it would be my desire to
> not only map the existing API exactly (as public), but to also create a
> small additional layer atop the existing API with a slightly higher
> abstraction level to hide some of the low levelness of the API
> (pointers, handle passing, etc.).  Would anybody be interested in
> helping or critiquing as I progress?  (I haven't decided to do this yet,
> I'm awaiting corporate approval to use public domain software in my
> project, which they have refused in the past.  This part of the project
> would be on my own time so as to not involve company ownership issues).
>

Hello Gary,

have a look at the sqlite section of http://flibs.sf.net
It is not well documented, I am afraid, and it has a few quirks,
but it could be a nice start.

Regards,

Arjen

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



Re: [sqlite] serious performance problems with indexes

2006-10-27 Thread Arjen Markus

Peter De Rijk wrote:


I have run into a serious performance problem with tables with many rows.
The problem only occurs on tables with an index
The time needed for an insert into a table with an index is dependend on the 
number of rows. I have not formally checked, but from my tests it looks like 
an exponential dependence. This of course means that while sqlite is very 
fast on smaller datasets, it is slow on larger data sets and becomes unusable 
on large datasets (million of rows). The insert behaviour is normal on non 
indexed tables, but obviously queries are a problem then.

Is this index behaviour normal/expected for sqlite, or can this be solved?
 


Peter,
unless I am mistaken, inserting into a table that has an index requires 
the index
to be rebuilt for each insert. Are you inserting multiple rows in a 
single transaction
or not? If you could put them in a single transaction, I think the 
performance

will remain adequate, even for very large tables.

Regards,

Arjen



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



Re: [sqlite] Compiling Sqlite with Openwatcom

2006-10-25 Thread Arjen Markus

[EMAIL PROTECTED] wrote:


Hi Arjen

Unfortunately I am still using f77 not f90...

 


Hello Victor,

any specific reason? There are lots of (free) Fortran 90 compilers around,
and unless I am mistaken the Openwatcom compiler supports Fortran 90
(after all, the standard is more than 20 years old).

The good thing is that any FORTRAN 77 that complies to that standard
is also a valid Fortran 90 program, so if you decide to move to Fortran 90
you can do the transition in small steps.

The sample code by Danial is a good attempt to do it in FORTRAN 77,
but it is rather involved due to the limitations of that standard (computers
30 years ago were very different beasts).

Regards,

Arjen

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



Re: [sqlite] Compiling Sqlite with Openwatcom

2006-10-25 Thread Arjen Markus

[EMAIL PROTECTED] wrote:


Hi All,

I wonder whether anyone has already compiled Sqlite with Openwatcom (a free
compiler suite available at www.openwatcom.org including a C/C++/Fortran
compiler).

Since when I tried, I got the following compiling error on line 95 of the file
sqlite3ext.h: invalid declarator i.e. corresponding to the line
 void  (*interrupt)(sqlite3*);

This is the first step to generate a library that I will use to access Sqlite
from Fortran following the instructions given by Danial at
http://danial.org/sqlite/fortran/(my next step)

 


Hello Victor,

I know almost nothing about the Open Watcom compiler, but if you are
interested in using Sqlite from Fortran, see my flibs project on 
SourceForge:
http://flibs.sf.net - I created the interface library you will find 
there (insufficient

documentation, I am afraid, and some loose ends) after being inspired by
that same example.

Regards,

Arjen

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



Re: [sqlite] Re: SQLite Order BY

2006-10-09 Thread Arjen Markus

A. Pagaltzis wrote:


* John Stanton <[EMAIL PROTECTED]> [2006-10-09 19:35]:
 


Sorting data is time consuming, a physical law is involved. At
best it is an nlog(n) process.
   



Only when you sort by comparing elements with each other. Bucket
sort runs in O(n), f.ex. And quantum sort is O(1). ;-) Algorithms
that run faster than O(n log n) are very rarely practical,
however.
 


No, quantum sort is O(sqrt(n)) - much better than classical algorithms
but tough to implement and certainly not O(1) :)

Regards,

Arjen


Re: [sqlite] Wiki is locked

2006-10-06 Thread Arjen Markus

[EMAIL PROTECTED] wrote:




Whatever

Everything appears to be working now.
 


Yes, I can see the contents now. As we are on the subject of documentation,
someone on the Tclers' chat mentioned that the subcommand "exists" is
documented, but not actually implemented. Could you have a look at that too?

Regards,

Arjen

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



[sqlite] Wiki is locked

2006-10-05 Thread Arjen Markus

Hello,

I tried to access the SQLite Wiki this morning (MET 8:30), but all I got 
was a reply

that the query failed because the database was locked.

Can somebody (Richard Hipp most probably) look into this?

Regards,

Arjen

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



Re: [sqlite] Using Between in SQL

2006-08-30 Thread Arjen Markus

Roger wrote:


On Wed, 2006-08-30 at 12:03 +0100, Martin Jenkins wrote:
 


Roger wrote:
   


I have a question.

I trying to write a query as follows

Select *

From People

Where Surname Between 'A%' and 'E%'
Order by UPPER(Surname);

Now the problem i have is that i get only the Surnames from A up to D
and the E's are excluded.

Can anyone help me out, i am writing a web based application.

 


How about:

  Select *
  From People
  Where Surname Between 'A%' and 'F%' ' <--- s/E/F/
  Order by UPPER(Surname);
   


Thanks for the response guys but then my problem comes when i try and
query a range between T and Z i tried to make it query between T to A
but got no result. Anyway i will have to add a constraint in my PHP code
for T to Z.
 

Well, the character after 'Z' is 'a' in the ASCII table. You could try: 
BETWEEN 'Z' and 'a'


Regards,

Arjen



Re: [sqlite] Using Between in SQL

2006-08-30 Thread Arjen Markus

Roger wrote:


I have a question.

I trying to write a query as follows

Select *

From People

Where Surname Between 'A%' and 'E%'
Order by UPPER(Surname);

Now the problem i have is that i get only the Surnames from A up to D
and the E's are excluded.

Can anyone help me out, i am writing a web based application.

 


I am no expert on SQL, but I think it is likely that BETWEEN does not
acknowledge the wildcards.

Try: Surname between 'A' and 'E' instead (or 'F')

(If it does, there may be a severe interpretation problem - wildcards
introduce some sort of a range themselves, so the bounds are ranges too!)

Regards,

Arjen

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



[sqlite] Article on common errors in SQL queries

2006-06-05 Thread Arjen Markus

Hello,

I came across the article below and thought this might interest
at least some people on this list.

Regards,

Arjen

--

Title:
Semantic errors in SQL queries: A quite complete list

Authors:
Brass, S; Goldberg, C

Source:
JOURNAL OF SYSTEMS AND SOFTWARE 79 (5): 630-644 MAY 2006

Language:
English

Document Type:
Article

Author Keywords:
databases; SQL; queries; bugs; errors; semantic errors; logical errors; 
software correctness; *static* *analysis*; teaching; database courses; SQL exams

Keywords Plus:
PERFORMANCE

Abstract:
We investigate classes of SQL queries which are syntactically correct, but 
certainly not intended, no matter for which task the query was written. For 
instance, queries that are contradictory, i.e. always return the empty set, are 
obviously not intended. However, current database management systems (DBMS) 
execute such queries without any warning. In this paper, we give an extensive 
list of conditions that are strong indications of semantic errors. Of course, 
questions like the satisfiability are in general undecidable, but a significant 
subset of SQL queries can actually be checked. We believe that future DBMS will 
perform such checks and that the generated warnings will help to develop 
application programs with fewer bugs in less time. (c) 2005 Elsevier Inc. All 
rights reserved.




Re: [sqlite] SQLITE3.exe from Windows CMD

2006-05-04 Thread Arjen Markus

Josef Hlawatschek (JT) wrote:


Hi,

I want to use SQLITE3.EXE to run automated reports in Windows. I use
an init file to load parameters and a SQL script file. All goes well
until the SQL script has been executed, then the SQLITE3.EXE command
prompt appears. The command prompt only closes once you manually type
in ".exit" or ".quit". I have tried to add the ".exit" to the init and
SQL script file and it still does not close automatically.

I do not need to programmatically connect to the SQLITE DB, so I would
like to keep it as simple as possible.
 


Why not use a pipe:

- Put all commands in a file, say, sqlite.cmds
- Run SQLite3.exe with the following command:

 > sqlite3.exe < sqlite.cmds

That should work.

Regards,

Arjen


Re: [sqlite] Table question

2006-03-09 Thread Arjen Markus

Eugen Stoianovici wrote:

Is there a way o creating tables that have fields that are expressions 
rather than values?
Those expresions would return a value based on values stored in other 
fields of some other table (or the same table if that's necessary).


If the expressions do not vary per row, then you can put the expression 
in the SQL statement

to query the data in the tables.

Regards,

Arjen



Re: [sqlite] feild value pairs

2006-02-10 Thread Arjen Markus
chetana bhargav wrote:
> 
> Hi,
> 
>   My requirement is that, I want to store some common properties and some 
> more optional properties depending on the need of each application. Where 
> these optional properties need to be stored as feild value pairs. Most of the 
> values(almost 99.5%) values are of integer type. And there are some 100 odd 
> such properties
> 
>   Now my problem if I want to store these optional properties, do I create a 
> column for each type or just store them as blob. If we store them as blob is 
> there any sginificat performance impact if some one stores all the properties 
> in one record as the record size grows. Presuming all properties are stored 
> taking 400 bytes for each record(at max).
> 
>   Do we have any analysis the enumeration time or load time if we have large 
> data in one record. Or the overall impact because of couple of  large records.
> 
> 

Why not use a separate table with columns like:

- appname - string
- property- string
- intvalue- integer
- stringvalue - string

YOu can select all the properties for a specific application and the
general ones:
  
   SELECT * FROM xxx WHERE appname = 'myapp' OR appname = 'GENERAL';

or some such set-up. No need to use loads of columns. This is what
relational databases 
are good at.

Regards,

Arjen



Re: [sqlite] Versioning in SQL database?

2006-02-07 Thread Arjen Markus
Paul Tomblin wrote:
> 
> I am putting together something that will act like a Wiki for structured
> data (in this case, airport and navigation aid data like id, location,
> runways, etc).  I currently store the data in an SQL databasee, but only
> the "current" version.  I want to allow people to edit that data, but that
> means being able to compare versions, roll back erroneous edits, get what
> the database looked like before a particular editor came along, etc.  Is
> there anything written on this topic?  Has anybody ever tried it before?
> 
>

I recently saw something similar to what you describe (well, the airport
and navigation stuff) - http://www.flightaware.com - but maybe that is
just a similar area of application.

Regards,

Arjen



Re: [sqlite] Decimal separator

2006-02-01 Thread Arjen Markus
Carl Jacobs wrote:
> 
> > > All would be fine but look at this :
> > >
> > > create table test(
> > > price double,
> > > amount double default 0
> > > );
> > >
> > > insert into test(price) values("12,0");
> > >
> > > amount now = 0.0
> 
> The world seems to have settled on using Arabic numerals 0, 1, 2 ... 9. I
> think we should think about settling on . as the decimal separator, it would
> save a bit of confusion if we all used the same notation.
> 
> I suspect that "12,0" is being stored as a string. Don't forget that for all
> intents and purposes sqlite3 is typless, so it will store your value in
> whatever is the most compact form. So, if you want to, you can store a
> picture of yourself in field price!
> 
> Regards,
> Carl.

Older English books on mathematical and physical subjects use a dot that
is
centred on the line, not the period we are now accustomed to, because
that
particular glyph is simply not present on the keyboard. I can think of a
lot 
of other typograhical conventions that have lost the battle against the
relentless keyboard. Oh well, I suppose I am getting old ;).

As for the design decision that Richard mentions in his reply, I quite
agree: it is better to stick to that one radix point than to try and
satisfy all people - I have seen a lot of sorrow and hardship from the
imperfect attempts to do otherwise. (I will just bring in the example
of older versions of MS Excel where a dot or a comma in a file would
make it unusable on a machine with a different regional setting).

A helper function to sort this out would be the solution to go for.

Regards,

Arjen



Re: [sqlite] Building sqlite 3.2.8 on redhat 9 (off list)

2006-01-03 Thread Arjen Markus
Lloyd Thomas wrote:
> 
> Thanks Kimball
> Your right about having a little experience. I am
> just running into error after error installing apps, but I'm learnoing
> slowly. Anyway, I was trying to install the sqlite support for another
> application I want to use and as a side issue it seems to have installed
> sqlite 3.2.8 correctly for me. It would be good if I could type sqlite3 at
> the prompt and it would just start.
> 

Hello Lloyd,

you mean the sqlite3 command-line utility? Well, if all else fails,
try it with a small script that you can put in a directory within
your path:

---
# Run command-line utility sqlite3
#
export LD_LIBRARY_PATH=/your/install/dir/lib:$LD_LIBRARY_PATH
export PATH=/your/install/dir/bin:$PATH

sqlite3
---

(Store this in a convenient file like "mysqlite" and use:

chmod +x mysqlite

to make it executable)

The environment variables LD_LIBRARY_PATH and PATH are 
changed locally. So as soon as you leave the utility 
and thus the script, you go back to the original environment.

Regards,

Arjen



Re: [sqlite] Building sqlite 3.2.8 on redhat 9

2006-01-02 Thread Arjen Markus
Lloyd Thomas wrote:
> 
> I have compilted tcl, but had a problem with tk. having compiled sqlite3 I
> get a new error trying to run sqlite3 =
> 'sqlite3: error while loading shared libraries: libsqlite3.so.0: cannot open
> shared object file: No such file or diretory'
> 

That seems a common problem with shared objects/libraries ... they have
to 
be in the path of the dynamic linker/loader. Have you set
LD_LIBRARY_PATH
properly?

Regards,

Arjen



Re: [sqlite] Problem with floating point fields, and a feature request

2005-12-14 Thread Arjen Markus
Cariotoglou Mike wrote:
> 
> I see again that you all miss the point. I DO know how to handle floating 
> point. My point is :
> 
...
> 
> since a solution to this issue is fairly simple, and the applicable audience 
> is large, why not provide one?
> the fact that MSSQL will not be able to do the same is not an argument that 
> has stopped drh before, has it.
> 

Now you are missing the point :). The solution is not all that simple.
Perhaps the "best" approach is 
to allow for "fuzzy" comparisons. I refer you to
http://ftp.cac.psu.edu/pub/ger/fortran/hdk/eps.f90 (or .for)
for more information and an implementation of an algorithm that has
proven its usefulness.
(Don't take it too lightly: according to the author/transcriber it is
the result of long discussions and
disputes in at least one language community).

Your proposal could be used to set the tolerance for the fuzzy
comparison. Scaling issues are then
taken care of by that algorithm (I should have thought of it before)

Regards,

Arjen



Re: [sqlite] Problem with floating point fields, and a feature request

2005-12-14 Thread Arjen Markus
Cariotoglou Mike wrote:
> 
> as you may remember, some time ago I raised an issue with floating point
> accuracy, and how this may affect sqlite.
> 
> I now have a concrete example, which actually happened in an
> installation, and helps to demonstrate the severity of the issue:
> 
> try this code:
> 
> create table test(f double);
> insert into test values(13.04);
> update test set f=f+0.02;
> select * from test where f=13.06; -- returns no data
> 
> can you imagine how many bugs waiting to happen are out there, because
> of code like this ?
> 
> I know that there are a number of solutions to this problem, all
> involving changing the sql involved.
> however, these are not applicable to people using SQLITE via wrappers
> that generate their own UUPDATE code.
> 
> what I have been trying to say is that, there is also a neat solution to
> the problem, and one that can be implemented easily :
> 
> pragma floating_accuracy=0.001
> 
> setting the threshold for float comparisons to some predictable value.
> 
> Am I the only one that sees the problem? if not, please speak up, and
> maybe we can get a neat solution!

Well, I have come across it in many other contexts and there is no
general solution, unfortunately - well, using decimal floating-point
arithmetic might in some cases solve it (at least give more predictable
results, though not always).

What about the scale? I assume that the above accuracy refers to 
the range [value-0.001,value+0.001]. That would fail with
numbers 
smaller than 1/100 - not that uncommon. 

On the other hand a relative accuracy of say 1.0e-4% would fail if you
have numbers around zero: -0.001 could well be approximately 0
or 0.001. 

I think you will need (at least?) two measures of tolerance:
an absolute value and a relative one ...

Regards,

Arjen



Re: [sqlite] equivalent of linked tables in sqlite ?

2005-12-13 Thread Arjen Markus
gl demoor wrote:
> 
> I did some preliminary and extensive reseach (cough google cough :) on
> delphi and pocketpc
> 
> unless I'm missing something, delphi is not use for pocketpc programming
> 
> google results were of the following nature:
> >I'm pretty sure no one supports *Delphi* for *Pocket PC*, so you will need
> >to switch to another language. Your choices are C, C++, C#, and VB
> (Excerpt usenet message aug 2 05, by a Robert Zaret, eMVP)
> 
> I hope to use the same (type) language for desktop and ppc programmation.
> The most likely candidate seems evc++ & vc++. (I still have to learn it)
> even more so because the intended tool calls for lowlevel access to the
> serial port on the pocketpc (Dallas Ibutton interfacing).
> 
> I'm however concerned about the database connectivity. On a previous
> attempt, I bought Sybase PocketBuilder on sybase's reputation of being
> proficient at different db formats. Only to find out dbase, foxpro support
> and such was scrapped from pocketbuilder.
> 

I know very little about the development environment for PocketPC, but
you might consider Tcl/Tk:

http://wiki.tcl.tk/pocketpc describes what is available.

Regards,

Arjen



Re: [sqlite] how can I import CSV file into SQLite quickly

2005-12-07 Thread Arjen Markus
Arjen Markus wrote:
> 

> >
> 
> Hm, there is a CSV reading module in Tcllib, so one could contemplate
> using Tcl instead of Perl for this. That ought to take care of the
> quotes
> and other nastiness...
> 
>

Come to think it, my Fortran library to interface with SQLite has 
an example of reading a CSV file and putting it in a SQLite database.
Fortran 90/95 has the ability to properly read CSV files "out of the 
box", via its READ(..,*) statement.

The library can be retrieved at: http://www.sf.net/flibs
(Use anonymous CVS, no tarfile yet).

Regards,

Arjen



Re: [sqlite] how can I import CSV file into SQLite quickly

2005-12-07 Thread Arjen Markus
Aaron Peterson wrote:
> 
> On 12/7/05, Teg <[EMAIL PROTECTED]> wrote:
> > Hello All,
> >
> > Wouldn't it make sense to write a program that reads it in, one line
> > at a time, splits and inserts the data into the proper tables? Even
> > creating the table on the fly? That's what I'd do, a little command
> > line utility.
> 
> One could probably look at the mysqlimport source code for
> inspiration.  It would be nice to have a little command line utility
> for this as part of the main sqlite package...  This *can* be done
> with a sed or perl script, but it becomes increasingly difficult when
> the values also include commas, in which case programs often
> additionally enclose the values in quotes, etc.  mysqlimport has nice
> switches (--optionally-enclosed-by) to take care of cases like these
> so that everyone doesn't have to be a perl or sed genius to import
> some text file data into a table.
> 

Hm, there is a CSV reading module in Tcllib, so one could contemplate
using Tcl instead of Perl for this. That ought to take care of the
quotes
and other nastiness...

Regards,

Arjen



Re: [sqlite] Getting started!

2005-11-23 Thread Arjen Markus
Meenakshi K wrote:
> 
> Dear Sqlite pros,
> I am a newcomer interested to use sqlite educational purpose.
> I am using Qt 4 in the .Net environment.
> 
> How do get started with sqlite? I can't find any installation guidance.
> Please help. I know this is very basic, but i am stuck.
> 
> Thanks in advance!
> 
> Cheers,
> Meenakshi.

I do not know much about the combination Qt and .net, but sqlite
has a command-line tool which ought to be very useful. 
See: http://www.sqlite.org/sqlite.html

Regards,

Arjen



Re: [sqlite] sqlite and cygwin

2005-11-23 Thread Arjen Markus
Oliver Manthey wrote:
> 
> hello,
> 
> i'm new to sqlite and want to use it in a windows xp/cygwin/eclipse
> environment.
> 
> is there any documentation how to install sqlite into cygwin ?
> 
> looking forward,
> oliver

You should be able to do that via the instructions for Linux,
as the Cygwin environment is a lot like that.

Regards,

Arjen



Re: [sqlite] Compiling from source code on Windows

2005-11-18 Thread Arjen Markus
Ran wrote:
> 
> It will be great if you can send me the .dsp and .dsw files.
> About preparing the files - I prefer to do this on Linux as D. Richard Hipp
> suggested because I will anyway continue the development of my part on
> Linux.
> 

Hello Ran,

I replied before I saw that Richard had already indicated how to prepare
the sources. Good, I will send them monday (they are currently on my 
PC at home ;)).

Regards,

Arjen



Re: [sqlite] Compiling from source code on Windows

2005-11-18 Thread Arjen Markus
Ran wrote:
> 
> Hi all,
> 
> I have added some functionality to the source of SQLite3 to be used in a
> project I work on. The changes were done in func.c and in
> sqlite.h.in(I added one function to the API). This
> was done in Linux, and compiles and
> run fine.
> 
> Now I would like to port it also to windows and I am not sure how I can
> build it using VC++.
> 
> In the site of sqlite, there is a zip file with already processed files for
> building in Windows. But obviously, I prefer to build from the same source I
> have instead of copying/hacking the files in that zip file.
> Maybe I missed the instruction in the site, but I could not find it there,
> nor in the archives of the mailing list.
> 
> Can anyone can tell which tools should I install on Windows for preparing
> the files from the tar.gz sources to be built on windows?
> 
> In addition, I wonder if anyone has a solution file or a project file for
> VC++ for building the .lib and the sqlite3 executable, or can give any hints
> about how to build SQLite on Windows using VC++.
> 
> Thanks in advance,
> 
> Ran

Hi Ran,

I have built SQLite from the sources given on www.sqlite.org for Windows
using VC++. There is nothing special about it, but I can send you the
.dsp and .dsw files if you want.

You might want to generate the source code to be compiled using Cygwin 
or Mingw. I am not sure how specific the resulting code will be for 
these platforms, but at least it is a start.

Regards,

Arjen



Re: [sqlite] optimizing out function calls

2005-11-14 Thread Arjen Markus
Jay Sprenkle wrote:
> 
> On 11/14/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> > >  Original Message 
> > > Subject: Re: [sqlite] optimizing out function calls
> > > From: Jay Sprenkle <[EMAIL PROTECTED]>
> > > Date: Mon, November 14, 2005 4:34 pm
> > > To: sqlite-users@sqlite.org
> > >
> > > > - the random function in C has no arguments, it will produce
> > > >   a different result on every call (within the limits of the
> > > >   random number generator that is used). Of course from a
> > > >   mathematical point of view this is a monstrosity ;).
> 
> A monstrosity? Isn't that a bit emotionally over the top?
> 

I did add ";)"

> A random number generator should generate random numbers and
> they aren't supposed to be the same. It does generate the same
> sequence of numbers each time given the same seed so it's testable.
> 

Yes, but the implementation (not the definition) as a function a la C
causes it to deviate from the mathematical concept of a function.

> >
> > But 'random' is not a mathematical function. In software we often use
> > functions to get values from the outside world ( getch(),time() etc,
> > etc). Random is a function which fetches the next number from a random
> > number generator. The qualities of that random number depend on the
> > underlying generator. When we pass an argument to random it is just to
> > control the behaviour of the random number generator.
> >
> > We would not expect getch() and time() to return the same result each
> > time they are called (except on friday afternoons).
> 
> I think that's why DRH doesn't cache results for user defined functions.

Again, the implementation of getch and time as _C functions_ is a pure
implementation choice. Other languages do it in another way. The whole
point I was trying to make is that the apparent implementation form of
some 
functionality may be misleading as to its proper semantics.

Regards,

Arjen



Re: [sqlite] optimizing out function calls

2005-11-14 Thread Arjen Markus
Joe Wilson wrote:
> 
> What do other databases return for the types of SQL queries below?
> 
>   SELECT random(1) AS func FROM test ORDER BY func;
>   SELECT random() AS func FROM test WHERE func > 10;
> 
> MS Access appears to assume all functions called with the same
> arguments are constant and returns the same result for every row:
> 
>   select rnd() from test;
> 
>   0.5795186162
>   0.5795186162
>   0.5795186162
>   0.5795186162
>   0.5795186162
> 
> SQLite is apparently the other extreme - it assumes that each call a
> function can potentially yield a different result each time.
> 

If I may be so blunt and refer to Fortran and C for a comparison:

- the random function in C has no arguments, it will produce 
  a different result on every call (within the limits of the 
  random number generator that is used). Of course from a   
  mathematical point of view this is a monstrosity ;).
  Functions should return the same values given the same
  arguments.

- functions without arguments in Fortran are presumed 
  to return the same value. The compiler may decide to
  cache that value and _always_ return the same value.
  This is the reason in Fortran (90, ...) random
  numbers are generated via a subroutine, instead of
  a function.

Apart from this distinction, you can also encounter
the situation where one platform (compiler, OS, hardware)
always initialises the random number generator with
the same seed and another will use a seed derived from,
say, the system clock.

I know too little of SQL to say that the standard
defines the random function in this way or that, 
but these are the variations I have seen and my
guess is the standard does not prescribe anything
about it.

Regards,

Arjen



Re: [sqlite] Re: converting a mysql database

2005-11-06 Thread Arjen Markus
Dave Dyer wrote:
> 
> I looked into this, and the actual problem is windows returning
> a "access denied" error code when trying to recreate the journal
> file immediately after deleting it.   I can't find any documentation
> that says create might fail for this reason, but filemon (from
> systeminternals.com) says the status is "delete pending" in this
> situation.  So I think this is a genuine windows glitch, which
> might be related to my having a fast, dual-core processor.
> 
> In any case, it seems to be possible to paper over the problem
> by waiting a few milliseconds and retrying the create.

I have had weird problems in the past on a Windows platform 
with the deletion and re-creation of files. I have never 
been able to figure out what happened. 

I am not familiar with inner workings of SQLite but I can imagine
that this will not be a problem anymore when you use a 
transaction instead of individual inserts.

Regards,

Arjen



Re: [sqlite] Proposed 3.3.0 changes. Was: 5/2==2

2005-11-01 Thread Arjen Markus
Fred Williams wrote:
> 
> Well, since you put it that way.  May I go one step farther and request
> that this new Dynamic Type also adhere to "Bankers Rounding" commonly
> implemented as BCD in other so equipped databases.
> 
> For years I have spent countless hours testing  and sweating rounding
> and comparisons using "Float" (Real?) fields because (IMHO) the database
> designers were scientific mathematicians and the world of users were
> 99%^ business types.  So, spare me further anguish... :-)
> 

Hm, being an engineer (and not having too much experience with database,
I immediately admit), I have always thought it was the other way around:
administrative and financial people designing database systems :).

I rather like the idea Richard is trying to get across. Too often people
have been surprised by such awkward behaviour 5/2 becoming 2 or 5.1*5.1
turning out to be 26.00999 instead of 26.01 and the like.

As for banker's rounding: if I understand it correctly, there are at 
least two slightly different systems - an American and a European one.
That problem should be solved too, if you are going to introduce such
behaviour.

Regards,

Arjen



Re: [sqlite] Error code 25

2005-11-01 Thread Arjen Markus
Hannes Ricklefs wrote:
> 
> Hi,
> 
> does anyone know what error code 25 stands for I can't find it in the
> documentation! It occurs in relation to binding values to a prepared
> statement.
> 
> THanks,
> Hannes

You can find all codes in the sqlite.h include file:

#define SQLITE_RANGE   25   /* 2nd parameter to sqlite3_bind out of
range */ 

(I posted a message about one or two error codes missing from the online
docs last week - this is one of them).

Regards,

Arjen



[sqlite] Handling dates and timestamps via the C API

2005-10-31 Thread Arjen Markus
Hello,

I would like to know how I should handle dates and timestamps 
via the C API. I know that if I write an SQL insert statement, I have
to use one of the forms reserved for dates and timestamps and
the like, but how do I do this via the sqlite3_bind_* procedures?

Regards,

Arjen



Re: [sqlite] Dotnet C# support

2005-10-31 Thread Arjen Markus
Robert Simpson wrote:
> 
> That's exactly what I ended up doing in the ADO.NET 2.0 wrapper.  In order
> to implement full Compact Framework support and callbacks, I ended up
> writing stdcall entrypoints and callback wrappers for just about the entire
> SQLite API.
> 

My Fortran interface does something similar, I have done it that way to
hide
the gory (and platform-dependent) details of passing parameters of the
correct 
type to the SQLite C functions. On Windows I compile SQLite as a DLL -
that
takes care of the stdcall/cdecl issue.

Regards,

Arjen



Re: [sqlite] Dotnet C# support

2005-10-30 Thread Arjen Markus
Robert Simpson wrote:
> 

> 
> Lots of problems here ... My VB is rusty, but here goes:
> 
> 1.  Don't bother declaring the callback struct -- you cannot do any form of
> callbacks in .NET with SQLite without major hacking.  SQLite's callbacks are
> expected to be "cdecl" and .NET callbacks are always "stdcall" and you will
> get stack errors if you even attempt it.  The ADO.NET 2.0 provider for
> SQLite does it, but I had to go through hoops.
> 

Hm, this mismatch in calling convention could be solved by one or two
little wrapper
functions, couldn't it? I am not very familiar with .NET, so I could be
all wrong.

Regards,

Arjen



Re: [sqlite] Re: begin transaction and commit

2005-10-25 Thread Arjen Markus
Igor Tandetnik wrote:
> 
>
> 
> There is another reason that is more or less specific to SQLite: a batch
> of data manipulation (insert, update and delete) statements completes
> much faster when all statements are executed under a single transaction.
> 
> > I understeand that if I use them, and some serious error occures then
> > there is a rollback so that my application can know the place where is
> > not updated , but do I need it for a simple insert or update of 1
> > record ?
> 

Igor,

you seem to have answered a question I wanted to pose: 
a program I wrote that inserts some 100 rows consisting of no more than
four
columns takes several seconds, almost all time spent in the INSERT
statement.

I will try to do this with a transaction.

Regards,

Arjen



Re: [sqlite] FYI: Fortran interface to SQLite

2005-10-25 Thread Arjen Markus
Hamid Benhocine wrote:
> 
> Hello,
> Very interesting, I planned to do some work (not done yet) to
> provide my division with some examples using sqlite with fortran 90/95
> (to replace a home pivot format in  numerical computing : we use f90/95).
> So, if you have a release, you want to share, I will be happy to test it
> on our Unix platforms(IBM , SGI, Linux) with the Fortran 90/95 compilers
> - IBM XL Fortan Compiler ( 64/32 bits Mode),
> - SGI Mips Pro F90/95 Compiler (64/32 bits).,
> - PGF f90/95 (Portland Group)
> 
>

Hello Hamid,

that sounds great. Right now I have solved most obvious bugs,
which of course leaves the stupid ones and the not-so-obvious ones.

One big issue is the lack of proper documentation ;).
I will send you what I have right now via a private mail.

Regards,

Arjen



Re: [sqlite] getting only count of records

2005-10-25 Thread Arjen Markus
Wilfried Mestdagh wrote:
> 
> Hi Arjen,
> 
> AM> No, they will probably not all do the same internally: the result
> AM> may be the same, but the "virtual machine" that runs the SQL statements
> AM> will very probably do different things - this depends on optimisation
> AM> and so on. But for most of us it is mainly the result that counts
> AM> (and the time it takes for that result)
> 
> But what should then be the best one in speed ?
> 

As others have replied, the version(s) where you use count() return(s)
only
one record. And that can be seen from the sQL statement all by itself.
I do not think things can be faster than that: only one record
that will actually be returned to the calling program.

Regards,

Arjen



Re: [sqlite] sqlite on SunOS 5.6 (Solaris Sparc 6)

2005-10-25 Thread Arjen Markus
[EMAIL PROTECTED] wrote:
> 
> Has anyone sucessfully built sqlite 3.2.7 on a SunOS 5.6 (Solaris
> sparc 6) box?
> 
> I had no problems with sqlite 2, but can't seem to get sqlite3 to
> build.
> 
> Using the ./configure ; make route, it dies with:
> 
> ./lemon -DSQLITE_OMIT_CURSOR   parse.y
> cat parse.h ./src/vdbe.c | awk -f ./mkopcodeh.awk >opcodes.h
> awk: syntax error near line 36
> awk: illegal statement near line 36
> awk: syntax error near line 37
> awk: illegal statement near line 37
> awk: syntax error near line 42
> awk: illegal statement near line 42
> awk: syntax error near line 103
> awk: illegal statement near line 103
> make: *** [opcodes.h] Error 2
> 
> Trying to use the generic Makefile, I get the same results.
> 

I get the very same result, apparently awk on Sun does not
like the mkopcodeh.awk script.

It does not like the sub command and it does not like:

  nopush[i] = nopush[i] + (2^j)


I tried with "nawk" instead: this works without any 
problem! 

Regards,

Arjen



Re: [sqlite] getting only count of records

2005-10-25 Thread Arjen Markus
Wilfried Mestdagh wrote:
> 
> Hi Guillaume and Martin,
> 
> Thanks for quick responce. Studying the count() function if I use the
> method of Guillaume I dont need the 'where' clause:
> 
>   'select count(VehicleID) from tx'
> 
> But I assume all 3 methods will do internal exact the same. Result is
> also 1 field with the count in it.
> 

No, they will probably not all do the same internally: the result
may be the same, but the "virtual machine" that runs the SQL statements
will very probably do different things - this depends on optimisation
and so on. But for most of us it is mainly the result that counts 
(and the time it takes for that result)

Regards,

Arjen



[sqlite] FYI: Fortran interface to SQLite

2005-10-25 Thread Arjen Markus
Hello,

my (almost) first experience with SQLite was the sample
code that Al Danial published to show how to use SQLite
in a FORTRAN program.

I was inspired by his work to develop a more comprehensive
interface, this time in Fortran 90/95. I am pleased to 
say that this was fairly easy to do and that it is 
nearing a stage where I dare release it in the wild.

The idea:
- Provide a library that hides as much as possible 
  the detail of Fortran-C interfacing
- Provide low-level routines for flexibility and 
  some high-level routines for common tasks and
  ease of use.

It has been tested on Windows with Compaq Visual Fortran
and MS VC/C++ only so far, but it should not be
a problem to get to work with other common 
compiler combinations.

Anyone who is interested, just drop a note.

Regards,

Arjen



[sqlite] Documentation is slightly out-of-date

2005-10-25 Thread Arjen Markus
Hello,

I noticed that the documentation on the www.sqlite.org site
is slightly out-of-date: The list of #defines does not 
include SQLITE_ROW and a couple of others.

Regards,

Arjen



Re: [sqlite] Zip file with prebuilt DLL incomplete

2005-10-20 Thread Arjen Markus
Cory Nelson wrote:
> 
> Indeed it should probably include sqlite3.h, but you are supposed to
> generate an import .lib for your compiler using the .def file. VC++ comes
> with lib.exe, I'm not sure how you do it with others.
> 
>

I know that the GNU compilers have a similar utility - I just have never
used either (being lazy, I mostly rely on the compiler to provide the
.lib file - that does require the use of non-standard keywords, but
you can hide those).

Anyway, the header file is needed, as you say.

Regards,

Arjen



[sqlite] Zip file with prebuilt DLL incomplete

2005-10-20 Thread Arjen Markus
Hello,

I downloaded the sqlitedll-3_2_7.zip file the other day 
to do some initial experiments with SQLite, but it turns
out that this zip-file only contains the DLL itself and
the definitions file. 

If I understand it correctly, it is possible to link
against the DLL using that definition file, but it is
more common to use the import library. 

But even so, the sqlite3.h header file is missing.
So the zip-file as such is not useable.

Kind regards,

Arjen Markus