[sqlite] If I got many to many relationship data first, how do I insert them to my table?

2017-04-04 Thread 邱朗
"Another option is to create an "Unknown" customer, and link any new orders to it. You can easily change that parent-id on the order later."This solution seems not work (especially in my case) because it is easy to have more than one unknown customer. Then I can't decide who orders what later.

Re: [sqlite] Incompatibility into configure.ac

2017-04-04 Thread Scott Robison
On Tue, Apr 4, 2017 at 9:52 PM, Jens Alfke wrote: > >> On Apr 4, 2017, at 8:33 PM, Pavel Volkov wrote: >> >> bash it's Bourne again shell. Not Bourne shell. Bash is more then POSIX >> shell. > > Yes, that’s what they said. The Bourne shell is ‘sh’. >

Re: [sqlite] Incompatibility into configure.ac

2017-04-04 Thread Jens Alfke
> On Apr 4, 2017, at 8:33 PM, Pavel Volkov wrote: > > bash it's Bourne again shell. Not Bourne shell. Bash is more then POSIX > shell. Yes, that’s what they said. The Bourne shell is ‘sh’. > And you forgot the FreeBSD in your listing. As example. It does not use bash

Re: [sqlite] Incompatibility into configure.ac

2017-04-04 Thread Pavel Volkov
Hello. bash it's Bourne again shell. Not Bourne shell. Bash is more then POSIX shell. And you forgot the FreeBSD in your listing. As example. It does not use bash at all. Thank you. On Apr 4, 2017 4:34 PM, "Gary R. Schmidt" wrote: > On 04/04/2017 23:20, Richard Hipp wrote: >

Re: [sqlite] Vacuum results in larger database after running pragma integrity_check

2017-04-04 Thread Richard Hipp
On 4/4/17, Richard Hipp wrote: > On 4/4/17, Ben Newberg wrote: >> I've noticed with 3.18.0 that it's possible to make a database increase >> in >> size after running pragma integrity_check (which returns "ok") and then >> running vacuum. > > I can now

Re: [sqlite] Vacuum results in larger database after running pragma integrity_check

2017-04-04 Thread Richard Hipp
On 4/4/17, Ben Newberg wrote: > I've noticed with 3.18.0 that it's possible to make a database increase in > size after running pragma integrity_check (which returns "ok") and then > running vacuum. I can now repro the behavior and have bisected to this check-in:

Re: [sqlite] Get notified as soon as it's save to modify a db after sqlite3_update_hook() was triggered

2017-04-04 Thread Stadin, Benjamin
Hi Peter, Wrapping the bbox was solely for the purpose of additional (and optional) performance. At the moment, this column would be optional and used instead of the geopackage geometry in some situations (e.g. improve rtree indexing by avoiding to create the bbox for every geometry). The

Re: [sqlite] Vacuum results in larger database after running pragma integrity_check

2017-04-04 Thread Richard Hipp
Can you email me the database that does this? On 4/4/17, Ben Newberg wrote: > I've noticed with 3.18.0 that it's possible to make a database increase in > size after running pragma integrity_check (which returns "ok") and then > running vacuum. > > Alternatively, vacuuming

[sqlite] Vacuum results in larger database after running pragma integrity_check

2017-04-04 Thread Ben Newberg
I've noticed with 3.18.0 that it's possible to make a database increase in size after running pragma integrity_check (which returns "ok") and then running vacuum. Alternatively, vacuuming without running pragma integrity_check first keeps the database the same size as before. The page size on

Re: [sqlite] Get notified as soon as it's save to modify a db after sqlite3_update_hook() was triggered

2017-04-04 Thread Peter Aronson
If you're creating GeoPackages with the F.3 RTREE Spatial Indexes extension, you do not "wrap" a bounding box. You need to define 5 functions from SQL/MM -- ST_MinX, ST_MaxX, ST_MinY, ST_MaxY and ST_IsEmpty -- that take a geometry blob as input and return (for the first four) a floating point

Re: [sqlite] All versions compatible "very big" estimatedCost (Virtual tables)

2017-04-04 Thread Max Vlasov
On Tue, Mar 28, 2017 at 11:26 AM, Max Vlasov wrote: > > > So, what is the maximum reasonable value of estimatedCost that will not > turn sqlite into possible overflow errors while telling at the same time > that I consider some variant very, very expensive? Or maybe

Re: [sqlite] BUG: CLI generates invalid SQL for strings with many newlines

2017-04-04 Thread Charles Leifer
I hate to be critical of Dr Hipp, but this commit stinks. Even if using the sqlite3 shell isn't the blessed way of producing a backup, I'm sure a lot of folks prefer it to the online backup API. It's this simple: "echo .dump | sqlite3 my_db.db | gzip > my_db.sql.gz" That's beautiful. And now it

Re: [sqlite] column alignment of views and tables;

2017-04-04 Thread Paul Sanderson
oops you need to select the string length from the column width select substring('', 1, 16 - length(printf("%2.f", price))) || printf("%2.f", price) from prices Paul www.sandersonforensics.com skype: r3scue193 twitter: @sandersonforens Tel +44 (0)1326 572786

Re: [sqlite] column alignment of views and tables;

2017-04-04 Thread Paul Sanderson
Just shooting out so no time to test. But could you try something like select substring('', 1, length(printf("%2.f", price))) || printf("%2.f", price) from prices Paul www.sandersonforensics.com skype: r3scue193 twitter: @sandersonforens Tel +44 (0)1326 572786

Re: [sqlite] column alignment of views and tables;

2017-04-04 Thread Dominique Devienne
On Tue, Apr 4, 2017 at 3:47 PM, Hans M. van der Meer wrote: > Simon, thanks. > Now at last, I know how to continue. > But SQLite itself ships with a portable version of printf too. So you can convert your integer or real typed columns into text typed ones for display,

Re: [sqlite] column alignment of views and tables;

2017-04-04 Thread Hans M. van der Meer
Simon, thanks. Now at last, I know how to continue. 2017-04-04 15:03 GMT+02:00 Simon Slavin : > > On 4 Apr 2017, at 11:25am, Hans M. van der Meer > wrote: > > > I am building a simple bookkeeping. > > With PHP and SQLite i now have tables and views with

Re: [sqlite] Incompatibility into configure.ac

2017-04-04 Thread Gary R. Schmidt
On 04/04/2017 23:20, Richard Hipp wrote: On 4/4/17, Pavel Volkov wrote: The "+ =" operator works as you would expect in bash only. And it causes an error in the Bourne shell, for example. You have piqued my curiosity. Who is still using Bourne shell instead of

Re: [sqlite] Incompatibility into configure.ac

2017-04-04 Thread Richard Hipp
On 4/4/17, Pavel Volkov wrote: > The "+ =" operator works as you would expect in bash only. > And it causes an error in the Bourne shell, for example. You have piqued my curiosity. Who is still using Bourne shell instead of the Bourne-again shell (bash)? Bash has

Re: [sqlite] Get notified as soon as it's save to modify a db after sqlite3_update_hook() was triggered

2017-04-04 Thread Richard Hipp
On 4/3/17, Stadin, Benjamin wrote: > Hi, > > Is there a hook which allows to get notified as soon as it’s save to modify > a db connection after (or as alternative to) sqlite3_update_hook was > triggered? There is no such callback built into SQLite. But you

Re: [sqlite] column alignment of views and tables;

2017-04-04 Thread Simon Slavin
On 4 Apr 2017, at 11:25am, Hans M. van der Meer wrote: > I am building a simple bookkeeping. > With PHP and SQLite i now have tables and views with columns for values and > prices: not nicely aligned because decimal values are aligned different > from values that are

[sqlite] recursive clause

2017-04-04 Thread Cem Dayanik (Ibtech-Software Infrastructure)
Hello there, I am trying to find a memory leak with MemoScope. It is using sqllite. Memoscope has some issue to find the problem so I am actually querying the data. CREATE TABLE InstanceReferences (InstanceAddress INTEGER, RefByAddress INTEGER) CREATE TABLE Instances (TypeId INTEGER, Address

[sqlite] sqlite3_exec() on prepared/bound statement

2017-04-04 Thread Labar, Ken
Hello all, * Short story: To support better security through binding, we would like to request a new C/C++ API function similar to sqlite3_exec(), however it will take a prepared statement instead of an sql string. * Long story: We finally allowed a user string input directly into our database

[sqlite] Get notified as soon as it's save to modify a db after sqlite3_update_hook() was triggered

2017-04-04 Thread Stadin, Benjamin
Hi, Is there a hook which allows to get notified as soon as it’s save to modify a db connection after (or as alternative to) sqlite3_update_hook was triggered? The background to this question is that I’m trying to prepare a proposal for Geopackage. And one of the questions is if it’s possible

[sqlite] column alignment of views and tables;

2017-04-04 Thread Hans M. van der Meer
Hi users, I am building a simple bookkeeping. With PHP and SQLite i now have tables and views with columns for values and prices: not nicely aligned because decimal values are aligned different from values that are interpreted as integers. I like to create reports in which the column of prices

[sqlite] Incompatibility into configure.ac

2017-04-04 Thread Pavel Volkov
Hello. Please, replace the "+ =" operators in the configure.ac file with a more compatible way of combining strings. The "+ =" operator works as you would expect in bash only. And it causes an error in the Bourne shell, for example. Please, see this patch: --- configure.ac.orig 2017-04-03

Re: [sqlite] BUG: CLI generates invalid SQL for strings with many newlines

2017-04-04 Thread Clemens Ladisch
James K. Lowden wrote: >>> Why not use vis(3) instead? >> >> Because vis() is a nonstandard function that is not available >> everywhere, > > "everywhere" is a high standard, but vis is freely available and > included or packaged with almost anything not Windows. It is not included in the

Re: [sqlite] BUG: CLI generates invalid SQL for strings with many newlines

2017-04-04 Thread Clemens Ladisch
Charles Leifer wrote: > This bit me... I fat-fingered a command and deleted my database. I had a > backup dump taken earlier in the day. Go to restore it and all of a sudden > this error starts cropping up. > > What to do? From the link the in the first post: sed -e "s/'||char(10)||'/\\n/g" <