[sqlite] segfault in load-extension but not in app

2017-11-15 Thread sub sk79
Hi, I am getting seg fault when same code is run as loadable-extension but not when run as shared lib linked to app. Thanks in advance for all help. The C++ code is compiled to 1. shared library and linked to app 2. loadable-extension and loaded from sqlite command line using '.load'. The C++

Re: [sqlite] Best way to develop a GUI front-end

2017-11-15 Thread Balaji Ramanathan
Thank you very much for all your suggestions. For now, I am going to start with a windows forms application in vb.net or forms in OpenOffice. Tcl/Tk is a steeper learning curve, and if someone can point me to some good resources that will walk a beginner through the development of a windows GUI

Re: [sqlite] Best way to develop a GUI front-end

2017-11-15 Thread Peter Da Silva
Tk is platform independent, so long as you don’t do UNIX-specific stuff (eg, assume UNIX file paths and stuff) any Tk app should work just fine on Windows. You may need to tweak the fonts, eg: if { $tcl_platform(platform) eq "windows" } { set font {Arial} } else { set font {Helvetica} }

Re: [sqlite] Simple SQL question?

2017-11-15 Thread Bart Smissaert
They end up in the wrong row. RBS On Wed, Nov 15, 2017 at 9:59 PM, Keith Medcalf wrote: > > That is not possible since there is only one column called issue_date in > all the tables mentioned in the query ... > > > --- > The fact that there's a Highway to Hell but only a

Re: [sqlite] Best way to develop a GUI front-end

2017-11-15 Thread Richard Hipp
On 11/15/17, Peter Da Silva wrote: > Tk is platform independent, so long as you don’t do UNIX-specific stuff (eg, > assume UNIX file paths and stuff) any Tk app should work just fine on > Windows. A majority of the SQLite source code and also the Fossil SCM source

Re: [sqlite] Simple SQL question?

2017-11-15 Thread Bart Smissaert
I like to just update that table as this AGE_AT_ISSUE column will be used often in various statements. There must be a simple way to do this, but just can't figure it out. RBS On Wed, Nov 15, 2017 at 9:25 PM, Peter Da Silva < peter.dasi...@flightaware.com> wrote: > Wouldn’t you create a view

Re: [sqlite] Simple SQL question?

2017-11-15 Thread Keith Medcalf
UPDATE table_a SET issue_date = (SELECT GetAgeAtDate(dob, issue_date) FROM table_p WHERE table_p.id = id); --- The fact that there's a Highway to Hell but only a Stairway to Heaven says a lot about anticipated traffic volume. >-Original

Re: [sqlite] Best way to develop a GUI front-end

2017-11-15 Thread Simon Slavin
On 15 Nov 2017, at 8:16pm, Balaji Ramanathan wrote: > Thank you very much for all your suggestions. For now, I am going to start > with a windows forms application in vb.net or forms in OpenOffice. You are locking yourself into the Windows system. By all means

Re: [sqlite] Simple SQL question?

2017-11-15 Thread petern
It is often helpful to study the syntax diagrams to see what is possible and intended by the language: https://sqlite.org/lang_update.html Take a look at the WHERE clause. The WHERE clause determines which rows are UPDATEd. One weakness in the documentation (although it may otherwise generally

Re: [sqlite] Simple SQL question?

2017-11-15 Thread Keith Medcalf
Then try making the where clause explicitly qualified with the table names. UPDATE table_a SET issue_date = (SELECT GetAgeAtDate(dob, issue_date) FROM table_p WHERE table_p.id = table_a.id); Actually, that would be correct. You can use the query

Re: [sqlite] Simple SQL question?

2017-11-15 Thread Bart Smissaert
Thanks, they both work indeed. Nice work! This bit looks strange to me: SELECT GetAgeAtDate(dob, issue_date) FROM table_p as issue_date is not in table_p. Never realised that this could work and learned something there. RBS On Wed, Nov 15, 2017 at 10:12 PM, Keith

Re: [sqlite] Best way to develop a GUI front-end

2017-11-15 Thread Igor Korot
Take a look at wx{Phoenix, Python}. It is much simpler, written in python, supports all its versions, and there demos and samples on its website - www.wxpython.org Thank you. On Wed, Nov 15, 2017 at 2:32 PM, Peter Da Silva wrote: > Tk is platform independent, so

Re: [sqlite] Simple SQL question?

2017-11-15 Thread David Raymond
Try... UPDATE TABLE_A SET AGE_AT_ISSUE = (SELECT GetAgeAtDate(P.DOB, ISSUE_DATE) FROM TABLE_P AS P WHERE P.ID = ID); -Original Message- From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of Bart Smissaert Sent: Wednesday, November 15, 2017 4:17 PM To:

Re: [sqlite] Running sums and averages

2017-11-15 Thread Dennis Clarke
Memory is cheap and most servers have plenty. Processors are fast and most servers have multiple with many cores. Select the entire table of columns you need into memory. Write a little code. No it won't scale very well into millions of rows but I could easily

Re: [sqlite] Simple SQL question?

2017-11-15 Thread Keith Medcalf
That is not possible since there is only one column called issue_date in all the tables mentioned in the query ... --- The fact that there's a Highway to Hell but only a Stairway to Heaven says a lot about anticipated traffic volume. >-Original Message- >From: sqlite-users

Re: [sqlite] Simple SQL question?

2017-11-15 Thread Bart Smissaert
That is getting close, but the calculated values end up with the right ID, but the wrong ISSUE_DATE. Will if an order by can sort this out. RBS On Wed, Nov 15, 2017 at 9:33 PM, David Raymond wrote: > Try... > > UPDATE TABLE_A SET AGE_AT_ISSUE = > (SELECT

[sqlite] Simple SQL question?

2017-11-15 Thread Bart Smissaert
Have 2 tables, TABLE_A and TABLE_P like this: CREATE TABLE_A(ID INTEGER, ISSUE_DATE INTEGER, AGE_AT ISSUE INTEGER) CREATE TABLE_P(ID INTEGER, DOB INTEGER) ID is he common field. Now I want to update the field AGE_AT_ISSUE of TABLE_A, so it will hold the age of the person identified by ID, at

Re: [sqlite] Simple SQL question?

2017-11-15 Thread Peter Da Silva
Wouldn’t you create a view instead, and not bother calculating age_at_issue until necessary since it’s derived completely from two other columns? On 11/15/17, 3:16 PM, "sqlite-users on behalf of Bart Smissaert"

[sqlite] LSM1 vtable extension portability

2017-11-15 Thread Dominique Devienne
I'm reading https://www.sqlite.org/src/artifact/529255dc70428900, and stumbled on: ** For FLOAT values, the content is the IEEE754 floating point value in ** native byte-order. This means that FLOAT values will be corrupted when ** database file is moved between big-endian and little-endian

Re: [sqlite] 1TB limit on encrypted database

2017-11-15 Thread Andrew Stewart
Thanks. This has worked. Andrew Stewart Argus Control Systems Ltd. -Original Message- From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of Richard Hipp Sent: Tuesday, November 14, 2017 12:34 PM To: SQLite mailing list

Re: [sqlite] Best way to develop a GUI front-end

2017-11-15 Thread Peter Da Silva
I contacted the Tcl core team and this is the response from Steve Landers: > tcl-lang.org was a temporary measure a few years ago when the .tk DNS went > missing. It wasn’t advertised but I guess it is now. > I’ve fixed it The official site is still at tcl.tk.

Re: [sqlite] Best way to develop a GUI front-end

2017-11-15 Thread Peter Da Silva
On 11/14/17, 10:32 PM, "sqlite-users on behalf of J Decker" wrote: > Initially I was interested in tcl/tk, and still am, but I'm not sure about > the tcl/tk packaging that would be necessary to make use on multiple >

[sqlite] Why there is duplicated sha1 functions in sqlite3 sources ?

2017-11-15 Thread Domingo Alvarez Duarte
Hello ! I'm making a build of sqlite3 that includes sha1 and shathree and other extensions, then made some changes to makefiles (Makefile.in, main.mk) then when trying to run the tests I got an error "multiple definition of 'SHA1Transform'" when trying to link dbhash.c . Why is sha1

Re: [sqlite] 1TB limit on encrypted database

2017-11-15 Thread Richard Hipp
On 11/15/17, Andrew Stewart wrote: > Thanks. This has worked. Temporarily. You cannot increase the max_page_count above 2147483646, so if your database continues to grow, you are going to need to look into increasing the page size from 1024 to something larger like