Re: [sqlite] Exit value of "PRAGMA integrity_check" in command line

2017-11-22 Thread 林自均
Hi Simon, Thank you for the suggestions. Yes, we already found the reason why the database would corrupt and fixed it. However, we still need to check users' database in our newer version of software in order to write new logs. We don't check this very often. The choice between deleting and

Re: [sqlite] Callback for sqlite3_finalize()

2017-11-22 Thread petern
Ben. Your post was in spam. Is your extension function an aggregate? From https://www.sqlite.org/c3ref/get_auxdata.html "These functions may be used by (non-aggregate) SQL functions..." The trace hook API has some statement level modes you might hook for to manage your cached data:

Re: [sqlite] Exit value of "PRAGMA integrity_check" in command line

2017-11-22 Thread Simon Slavin
On 23 Nov 2017, at 3:11am, 林自均 wrote: > It's for logs. If it corrupts, we rename it with a suffix ".corrupt" and > write new logs into a new sqlite file. Does that affect the way I check it? I was interested why you were checking for corruption, so your answer just

Re: [sqlite] Can I recursively concatenate strings?

2017-11-22 Thread petern
Shane. printf() will pad spaces you can replace with 'x' or whatever. WITH lengths(id,l) AS (VALUES (1,4),(2,1),(3,9)) SELECT id,l,replace(printf('%'||l||'s'),' ','x')mask FROM lengths; id,l,mask 1,4, 2,1,x 3,9,x If printf() weren't available, it would be worth the effort to add

Re: [sqlite] Exit value of "PRAGMA integrity_check" in command line

2017-11-22 Thread 林自均
Hi Simon, It's for logs. If it corrupts, we rename it with a suffix ".corrupt" and write new logs into a new sqlite file. Does that affect the way I check it? Best, John Lin Simon Slavin 於 2017年11月23日 週四 上午11:04寫道: > > > On 23 Nov 2017, at 3:00am, 林自均

Re: [sqlite] Exit value of "PRAGMA integrity_check" in command line

2017-11-22 Thread Simon Slavin
On 23 Nov 2017, at 3:00am, 林自均 wrote: > In other word, to check if a sqlite file is corrupted, I have to check the > stdout instead of the exit value. Am I right? Why are you checking for corrupted databases ? What will you do if the database is corrupt ? Simon.

Re: [sqlite] Exit value of "PRAGMA integrity_check" in command line

2017-11-22 Thread 林自均
Hi Richard, Thank you for the explanation! In other word, to check if a sqlite file is corrupted, I have to check the stdout instead of the exit value. Am I right? Best, John Lin Richard Hipp 於 2017年11月23日 週四 上午10:53寫道: > On 11/22/17, 林自均 wrote: > > > >

Re: [sqlite] Exit value of "PRAGMA integrity_check" in command line

2017-11-22 Thread Richard Hipp
On 11/22/17, 林自均 wrote: > > $ sqlite3 other-db.sqlite 'PRAGMA integrity_check' > Error: database disk image is malformed > $ echo $? > 11 > > Is that normal? > Yes. The error is occurring as SQLite is trying to parse the schema, not while running "PRAGMA integrity_chck". --

Re: [sqlite] Exit value of "PRAGMA integrity_check" in command line

2017-11-22 Thread 林自均
Hi Richard, After I update to 3.21.0, the situation doesn't change. $ sqlite3 --version 3.21.0 2017-10-24 18:55:49 1a584e499906b5c87ec7d43d4abce641fdf017c42125b083109bc77c4de48827 For "some-db.sqlite" I mentioned in the previous mail, it exit with 0, like you said. However, if I copy

Re: [sqlite] Exit value of "PRAGMA integrity_check" in command line

2017-11-22 Thread Richard Hipp
On 11/22/17, 林自均 wrote: > > Usually, if the database corrupts, the exit value is non-zero. However, I > recently bumped into a corrupted sqlite file that makes the previous > command exit with zero. > The behavior of PRAGMA integrity_check changed with release 3.21.0. It

Re: [sqlite] how into insert row into middle of table with integer primary key

2017-11-22 Thread Stephen Chrzanowski
SQL in any flavor isn't going to get what you want directly, as you've seen in these posts. The data is in your database for a reason. Its data. It isn't supposed to be manipulated in the way you want to do in this thread. Displaying something in a particular order is done at the application

[sqlite] Exit value of "PRAGMA integrity_check" in command line

2017-11-22 Thread 林自均
Hi folks, The document of "PRAGMA integrity_check" says: > If the integrity_check pragma finds problems, strings are returned (as multiple rows with a single column per row) which describe the problems. But it doesn't specify the exit value of: $ sqlite some-db.sqlite "PRAGMA integrity_check"

Re: [sqlite] Bug

2017-11-22 Thread Simon Slavin
On 23 Nov 2017, at 12:40am, Ivan De La Cruz wrote: > SQLiteDataAdapater is dropping characters after a space in the field when > filling a datatable (c# winforms). > > I.e. > Field : 100 > ml

[sqlite] Bug

2017-11-22 Thread Ivan De La Cruz
SQLiteDataAdapater is dropping characters after a space in the field when filling a datatable (c# winforms). I.e. Field : 100 ml Select returns

Re: [sqlite] Can I recursively concatenate strings?

2017-11-22 Thread Simon Slavin
On 22 Nov 2017, at 9:56pm, Shane Dev wrote: > P.S I know that substr('x', 1, stringlengths.length) would work in > this particular case but then I must know maximum value of > stringlengths.length at the point of time when I construct the query. Is > there a more

Re: [sqlite] how into insert row into middle of table with integer primary key

2017-11-22 Thread Simon Slavin
On 22 Nov 2017, at 8:30pm, Shane Dev wrote: > Imagine I have a GUI element with a drop down list of fruit. The source of > the list is my fruit table and it may have many entries. It might more > convenient to list the popular fruit near the top. In that case the >

Re: [sqlite] Can I recursively concatenate strings?

2017-11-22 Thread R Smith
On 2017/11/22 11:56 PM, Shane Dev wrote: Let's say I have a table of stringlengths - sqlite>select * from stringlengths; length 4 1 9 ... Can I create a view xstrings containing strings (for example of char 'x') with the lengths specified in stringlengths? Pretty easily:   -- SQLite

Re: [sqlite] how into insert row into middle of table with integer primary key

2017-11-22 Thread Keith Medcalf
>> Hi, Shane, >> What I don't understand is why do you need to do that? >Imagine I have a GUI element with a drop down list of fruit. The >source of >the list is my fruit table and it may have many entries. It might >more >convenient to list the popular fruit near the top. In that case the

Re: [sqlite] Many ML emails going to GMail's SPAM

2017-11-22 Thread jose isaias cabrera
On Wednesday, November 22, 2017 10:32 AM, Wout Mertens wrote... In SO you have very little socialization going on. This mailinglist is GUILTY! And I am not Dominique. :-) This is the only mailing list that I am subscribed twice. There is so much knowledge in here, that it should be kept

[sqlite] Can I recursively concatenate strings?

2017-11-22 Thread Shane Dev
Let's say I have a table of stringlengths - sqlite>select * from stringlengths; length 4 1 9 ... Can I create a view xstrings containing strings (for example of char 'x') with the lengths specified in stringlengths? desired result - sqlite>select * from xstrings; string x ...

Re: [sqlite] Many ML emails going to GMail's SPAM

2017-11-22 Thread jose isaias cabrera
This one. That one. Esta. Aquella. :-) -Original Message- From: Peter Da Silva Sent: Wednesday, November 22, 2017 8:12 AM To: SQLite mailing list Subject: Re: [sqlite] Many ML emails going to GMail's SPAM On 11/21/17, 9:54 PM, "sqlite-users on behalf of jose isaias cabrera"

Re: [sqlite] how into insert row into middle of table with integer primary key

2017-11-22 Thread Igor Korot
Hi, On Wed, Nov 22, 2017 at 2:30 PM, Shane Dev wrote: > On 22 November 2017 at 17:08, Igor Korot wrote: > >> Hi, Shane, >> >> >> What I don't understand is why do you need to do that? >> > > Imagine I have a GUI element with a drop down list of fruit.

Re: [sqlite] how into insert row into middle of table with integer primary key

2017-11-22 Thread Shane Dev
On 22 November 2017 at 17:08, Igor Korot wrote: > Hi, Shane, > > > What I don't understand is why do you need to do that? > Imagine I have a GUI element with a drop down list of fruit. The source of the list is my fruit table and it may have many entries. It might more

Re: [sqlite] Many ML emails going to GMail's SPAM

2017-11-22 Thread Drago, William @ CSG - NARDA-MITEQ
> -Original Message- > From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On > Behalf Of Keith Medcalf > Sent: Wednesday, November 22, 2017 11:33 AM > To: SQLite mailing list > Subject: Re: [sqlite] Many ML emails going to

Re: [sqlite] how into insert row into middle of table with integer primary key

2017-11-22 Thread Chris Locke
> Why do I want store ID numbers > whose values may change? Why not. Because that's not what the row id column is for. Not strictly. That's why it's called 'id' - it's an identification field. You can't (shouldn't) be using it for other means. A database requirement later might need that column

Re: [sqlite] Many ML emails going to GMail's SPAM

2017-11-22 Thread Niall O'Reilly
On 21 Nov 2017, at 16:27, Drago, William @ CSG - NARDA-MITEQ wrote: > Please, not a forum. The email list is instant, dynamic, and convenient. I > don't think checking into a forum to stay current with the brisk activity > here is very practical or appealing. I agree with Bill on this. It

Re: [sqlite] Many ML emails going to GMail's SPAM

2017-11-22 Thread Igor Korot
Hi, On Wed, Nov 22, 2017 at 10:53 AM, jungle Boogie wrote: > On 22 November 2017 at 07:56, Igor Korot wrote: >> Hi, >> Postgres very recently switched to PGLister for their ML >> >> This software switch tries to do exactly that - it tries to stay >>

Re: [sqlite] Many ML emails going to GMail's SPAM

2017-11-22 Thread dmp
Well I think some have pointed out the issues with a online web forum, logging in, lack of email notifications? Mailing lists are one aspect of the Internet that in the last 25yrs has not disappointed me. Keeping the mailing list seems to work or the irc option perhaps. With that being said I

Re: [sqlite] Many ML emails going to GMail's SPAM

2017-11-22 Thread jungle Boogie
On 22 November 2017 at 07:56, Igor Korot wrote: > Hi, > Postgres very recently switched to PGLister for their ML > > This software switch tries to do exactly that - it tries to stay > complaint with all this DMARC stuff. > > Here is the announcement that was posted on their

Re: [sqlite] Many ML emails going to GMail's SPAM

2017-11-22 Thread Keith Medcalf
>> There is nothing wrong with email - but there is an awful lot wrong >> with gnail and Google's ideas on how email is done. (Not to >> mention Yahoo, but it seems that MS have the sense to leave the >> underpinnings of hotmail as they were.) >> To put it simply - friends don't let friends

Re: [sqlite] how into insert row into middle of table with integer primary key

2017-11-22 Thread Igor Korot
Hi, Shane, On Wed, Nov 22, 2017 at 12:40 AM, Shane Dev wrote: > Hi Igor, > > Homework exercise? No, this is purely a hobby project in my free time. My > goal is see how much logic can moved from application code to the database. > > Why do I want store ID numbers whose

Re: [sqlite] Many ML emails going to GMail's SPAM

2017-11-22 Thread Igor Korot
Hi, Postgres very recently switched to PGLister for their ML This software switch tries to do exactly that - it tries to stay complaint with all this DMARC stuff. Here is the announcement that was posted on their wiki page: https://wiki.postgresql.org/wiki/PGLister_Announce. Since SQLite

Re: [sqlite] Many ML emails going to GMail's SPAM

2017-11-22 Thread Drago, William @ CSG - NARDA-MITEQ
> There is nothing wrong with email - but there is an awful lot wrong with gnail > and Google's ideas on how email is done. (Not to mention Yahoo, but it > seems that MS have the sense to leave the underpinnings of hotmail as they > were.) > > To put it simply - friends don't let friends use

Re: [sqlite] Many ML emails going to GMail's SPAM

2017-11-22 Thread Keith Medcalf
On Wednesday, 22 November, 2017 04:47, Richard Damon wrote: >There is a fundamental problem with the email system that it goes >back to a kinder and gentler time, and it is trivial to spoof most >mail. Including good old-fashioned snail mail of course. There is

Re: [sqlite] Many ML emails going to GMail's SPAM

2017-11-22 Thread Wout Mertens
In SO you have very little socialization going on. This mailinglist is awesome because it is filled with people who will enthousiastically share very detailed information, each in their own way. On SO there is no long-term narrative. I subscribed to this mailing list because I needed help, and I

Re: [sqlite] Many ML emails going to GMail's SPAM

2017-11-22 Thread Dominique Devienne
On Wed, Nov 22, 2017 at 3:08 PM, Wout Mertens wrote: > One more reason for some forum vs a mailing list: You can "like" a post > without spamming everyone, thus showing your appreciation to the poster and > surfacing interesting content for summarization algorithms. Or

Re: [sqlite] Many ML emails going to GMail's SPAM

2017-11-22 Thread Wout Mertens
One more reason for some forum vs a mailing list: You can "like" a post without spamming everyone, thus showing your appreciation to the poster and surfacing interesting content for summarization algorithms. On Wed, Nov 22, 2017 at 2:13 PM Peter Da Silva < peter.dasi...@flightaware.com> wrote: >

Re: [sqlite] how into insert row into middle of table with integer primary key

2017-11-22 Thread Peter Da Silva
On 11/22/17, 1:43 AM, "sqlite-users on behalf of R Smith" wrote: > Oh there are many valid reasons why to have Order in data, one I use > regularly is to dictate the process flow in manufacturing where some thing >

Re: [sqlite] Many ML emails going to GMail's SPAM

2017-11-22 Thread Peter Da Silva
On 11/21/17, 9:54 PM, "sqlite-users on behalf of jose isaias cabrera" wrote: > But, whatever it is, I will be part of the next phase of communication. This. ___

Re: [sqlite] Many ML emails going to GMail's SPAM

2017-11-22 Thread J Decker
Amongs all of these, I'd like to throw in that I'd like to see a gitter.im channel for sqlite (as opposed to discord or slack). gitter is much easier to share code snippets on and is much faster. It's also got nice integration with github... although that's less important since sqlite isn't

Re: [sqlite] Many ML emails going to GMail's SPAM

2017-11-22 Thread Richard Damon
On 11/21/17 3:29 PM, Keith Medcalf wrote: And checking SPF is pretty useful as well. Once you have enforced strict compliance, however, the effect of SPF is negligible (less than 1/1000%). DKIM/DMARC generally causes more trouble than it solves (it was designed by a committee of idiots after

Re: [sqlite] how into insert row into middle of table with integer primary key

2017-11-22 Thread R Smith
On 2017/11/22 8:40 AM, Shane Dev wrote: However, this just moves the problem from the id to the sort column. I still have to consider how to manage changes to values in the sort column. Apparently there is no single SQL statement which can insert a record in to any arbitrary sort position. Even