Re: [sqlite] BUG: Illegal initialization in icu.c : sqlite3IcuInit

2017-01-26 Thread Dominique Devienne
On Fri, Jan 27, 2017 at 1:24 AM, Richard Hipp wrote: > On 1/26/17, dandl wrote: > > > > 1. Why was VS the first compiler to detect this? > > Perhaps VS is the only compiler still in frequent use that does not > support C99? I guess David's question can also be

Re: [sqlite] Using SQLite, how can I search for chars that include a ', similar to OLE DB .Parameters?

2017-01-26 Thread GB
Clyde Eisenbeis schrieb am 26.01.2017 um 18:45: It appears that sqlite3 is not part of System.Data.SQLite. Aaah! Now we get somewhere! You should have told us from the beginning that you are using SQLite through the .NET/MONO Wrapper. All the mentioning of sqlite3_bind_* and the like refer to

Re: [sqlite] SQLite output mode

2017-01-26 Thread Michael Falconer
Just from some quick command line tool playing around, a dirt quick fix presented itself. .mode csv followed by .mode column (following the .mode ascii operation) seems to return the .column mode to normal. This on SQLite 3.16.2 on Linux command line. I'm not suggesting this as a fix as Dr Hipp

Re: [sqlite] SQLite output mode

2017-01-26 Thread Richard Hipp
On 1/26/17, Nikolas Manes wrote: > Hello, > I am Nikolas and facing an issue with sqlite, could you please help? > You will find more details on the link bellow. > http://stackoverflow.com/q/41730574/6293866 The ".mode ascii" command changes the default row and column

Re: [sqlite] SQLite output mode

2017-01-26 Thread Simon Slavin
On 26 Jan 2017, at 8:34pm, Nikolas Manes wrote: > I am Nikolas and facing an issue with sqlite, could you please help? > You will find more details on the link bellow. > http://stackoverflow.com/q/41730574/6293866 > * Please post your answer to Stack Overflow. No. I

[sqlite] SQLite output mode

2017-01-26 Thread Nikolas Manes
Hello, I am Nikolas and facing an issue with sqlite, could you please help? You will find more details on the link bellow. http://stackoverflow.com/q/41730574/6293866 * Please post your answer to Stack Overflow. Thank you, Nikolas. ___ sqlite-users

Re: [sqlite] application function value in sql where

2017-01-26 Thread dspublic
On 2017/01/26 6:23 PM, dspub...@freemail.hu wrote: Thanks for responses, I have an other problem select * from (select row_number(name) as id,name from example order by name desc) t order by name In this query, the server why doesn't use the nested "order by"? I want to numbering the inner

Re: [sqlite] Possible bug when creating a calculated index

2017-01-26 Thread Simon Slavin
On 26 Jan 2017, at 11:33pm, Ersin Akinci wrote: > (Please someone correct me if I'm wrong here. I'm a SQLite n00b who > managed to stumble onto a subtle problem while debugging Rails. =) Nope, you got it right. And Michael has too. I took your original report and

Re: [sqlite] BUG: Illegal initialization in icu.c : sqlite3IcuInit

2017-01-26 Thread Richard Hipp
On 1/26/17, dandl wrote: > > 1. Why was VS the first compiler to detect this? Perhaps VS is the only compiler still in frequent use that does not support C99? > 2. Is there an authoritative view on which standard Sqlite should comply > with? > SQLite should compile with VS. I

Re: [sqlite] BUG: Illegal initialization in icu.c : sqlite3IcuInit

2017-01-26 Thread dandl
From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of David Empson >>>The ANSI/ISO C 1990 standard states this in section 6.5.7, under Constraints: >>>“All the expressions in an initializer for an object that has static storage >>>duration or in an initializer

Re: [sqlite] Possible bug when creating a calculated index

2017-01-26 Thread Michael Falconer
Thank you Simon, I do see the inconsistency and thanks for those examples. I had answered previously before I saw your explanation and I now see why there is concern. It certainly appears to be inconsistent given such use cases. On 27 January 2017 at 10:26, Michael Falconer

Re: [sqlite] Possible bug when creating a calculated index

2017-01-26 Thread Ersin Akinci
Michael, I think part of the problem is that the "obviously" (or 'obviously', ha) useful behavior here would be for single quoted arguments to result in column interpretation. You're quite right to say that you want to be told that your column doesn't exist--that is very helpful information!. But

Re: [sqlite] Possible bug when creating a calculated index

2017-01-26 Thread Michael Falconer
Ersin, apologies if I seem to be suffering from terminal thickness, but I still don't get it. Why would I expect anything other than column interpretation from a single quoted argument. I *want to be told* that my column does not exist, I don't want a calculated index so why should I be expecting

Re: [sqlite] Possible bug when creating a calculated index

2017-01-26 Thread Simon Slavin
On 26 Jan 2017, at 10:56pm, Michael Falconer wrote: > as I see it there is no problem here. Explicit quoting regardless, the > column does not exist and an error is returned, isn't this the expected > outcome? Yet it’s not consistent. I should have given more

Re: [sqlite] Possible bug when creating a calculated index

2017-01-26 Thread Ersin Akinci
Michael, If I understood DRH and Simon correctly, I think the cause for concern is that SQLite should be interpreting the single quotes as a string literal, yet it interprets it as a column. Perhaps it's a strange example (i.e., why would you want to index a string literal?), but still, the

Re: [sqlite] Possible bug when creating a calculated index

2017-01-26 Thread Michael Falconer
Simon, as I see it there is no problem here. Explicit quoting regardless, the column does not exist and an error is returned, isn't this the expected outcome? In the DRH quoted section a reason is presented as to why no error is returned due to a built in default action. This may or may not be a

Re: [sqlite] Using SQLite, how can I search for chars that include a ', similar to OLE DB .Parameters?

2017-01-26 Thread Joe Mistachkin
Clyde Eisenbeis wrote: > > I can't read CHM docs. > I'm somewhat curious about that. Anyhow, there are alternatives: 1. IntelliSense in the Visual Studio IDE (this requires the XML file "System.Data.SQLite.xml", which should have been included with your DLL).

Re: [sqlite] Using SQLite, how can I search for chars that include a ', similar to OLE DB .Parameters?

2017-01-26 Thread Clyde Eisenbeis
I can't read CHM docs. I'd appreciate some example code which uses "sqlite3_bind_". Thanks! On Thu, Jan 26, 2017 at 12:02 PM, Joe Mistachkin wrote: > > Clyde Eisenbeis wrote: >> >> It appears that sqlite3 is not part of System.Data.SQLite. >> > > Actually, it is.

Re: [sqlite] BUG: Illegal initialization in icu.c : sqlite3IcuInit

2017-01-26 Thread David Empson
> On 26/01/2017, at 8:46 PM, Clemens Ladisch wrote: > > Ziemowit Laski wrote: >> Visual C++ > > Which one? > >> correctly catches this. > > Oh? What exactly is illegal about this? > >> struct IcuScalar { >>const char *zName;/* Function name

Re: [sqlite] Using SQLite, how can I search for chars that include a ', similar to OLE DB .Parameters?

2017-01-26 Thread Joe Mistachkin
Clyde Eisenbeis wrote: > > It appears that sqlite3 is not part of System.Data.SQLite. > Actually, it is. However, the managed components provide a "wrapper" around the core library functionality. The documentation, in Windows CHM format, is available here: https://urn.to/r/sds_docs

Re: [sqlite] Using SQLite, how can I search for chars that include a ', similar to OLE DB .Parameters?

2017-01-26 Thread Clyde Eisenbeis
Usually I look at examples, and extract the relevant info. After I have extracted relevant info, I create functions that are universally valid for different programs ... see attachment for one example. In this case, I have attempted to create code using what has been described so far. However,

Re: [sqlite] application function value in sql where

2017-01-26 Thread David Raymond
Did you mean to order by name in both the inside and outside? Or did you mean "order by id desc" for the inner part? If so you can always do that on the outside, which as mentioned is the only one that counts in the end. select row_number(name) as id, name from example order by name asc, id

Re: [sqlite] application function value in sql where

2017-01-26 Thread R Smith
On 2017/01/26 6:23 PM, dspub...@freemail.hu wrote: Thanks for responses, I have an other problem select * from (select row_number(name) as id,name from example order by name desc) t order by name In this query, the server why doesn't use the nested "order by"? I want to numbering the inner

Re: [sqlite] application function value in sql where

2017-01-26 Thread dspublic
On 2017/01/25 3:18 PM, Dominique Devienne wrote: On Wed, Jan 25, 2017 at 1:54 PM, Richard Hipp wrote: On 1/25/17, Richard Hipp wrote: On 1/25/17, dspub...@freemail.hu wrote: I get weird sql result with subselect too select * from

Re: [sqlite] Using SQLite, how can I search for chars that include a ', similar to OLE DB .Parameters?

2017-01-26 Thread R Smith
On 2017/01/26 5:46 PM, Clyde Eisenbeis wrote: To answer a previous question, here is an example of stCmdString contents: stCmdString = "SELECT fstPriority, fstInfo, fiKeyID FROM PadTable WHERE fstInfo LIKE '%macro%'" This works. Yes, and so it should, but this is what you think it

Re: [sqlite] Using SQLite, how can I search for chars that include a ', similar to OLE DB .Parameters?

2017-01-26 Thread Warren Young
On Jan 26, 2017, at 8:40 AM, Clyde Eisenbeis wrote: > > When I tried entering: > > sqlite3_bind_ > > the compiler starts complaining. What I wrote was "sqlite3_bind_*()” which you were expected to understand as a reference to the 15 functions beginning with “sqlite3_bind_”

Re: [sqlite] Using SQLite, how can I search for chars that include a ', similar to OLE DB .Parameters?

2017-01-26 Thread Simon Slavin
On 26 Jan 2017, at 3:04pm, Clyde Eisenbeis wrote: > string stCmdString = "SELECT" + stFieldNames + "FROM " + stTableName > + " WHERE " + stLikeFieldName + " LIKE ('%' || " + > liststLikeFieldValue[0] + " || '%')"; Still looks like there would be spaces missing from that.

Re: [sqlite] text/numeric comparison confusion

2017-01-26 Thread Dominique Devienne
On Thu, Jan 26, 2017 at 5:04 PM, David Raymond wrote: > Other thing to point out is that constants/(expressions that aren't coming > from a field in a table) have "no affinity", so explicitly typing '25' is a > no affinity, not a text affinity, and 25 is no affinity,

Re: [sqlite] text/numeric comparison confusion

2017-01-26 Thread Hick Gunter
The constant '1' (of storage class TEXT) has no affinity, neither has the constant 1 (of storage class INTEGER), nor the result of an expression - with documented exceptions, notably CAST( AS ). Consider: 1 = '1' --- 0 (1=1) = '1' --- 0 cast((1=1) as integer) = '1'

Re: [sqlite] text/numeric comparison confusion

2017-01-26 Thread David Raymond
Other thing to point out is that constants/(expressions that aren't coming from a field in a table) have "no affinity", so explicitly typing '25' is a no affinity, not a text affinity, and 25 is no affinity, not integer affinity. (Section 4.2 in the page linked by DRH) From section 4.3 linked

Re: [sqlite] Using SQLite, how can I search for chars that include a ', similar to OLE DB .Parameters?

2017-01-26 Thread Andy Ling
Now you know a bit more about what you are looking for, perhaps you should revisit the links Warren Young gave a few days ago... >> You’re looking for prepared statements with parameters: >>https://sqlite.org/c3ref/stmt.html >>https://sqlite.org/lang_expr.html#varparam Regards Andy

Re: [sqlite] text/numeric comparison confusion

2017-01-26 Thread Richard Hipp
On 1/26/17, Jeffrey Mattox wrote: > When used in a SELECT, I expect this comparison to be true (and it is): >( cast('25' as INTEGER) = 25 ) <--- true > > But, why is this false: >( '25' = 25 ) <--- false? > > and this is true: >( cast(25 as TEXT) = 25 ) <--- true > >

Re: [sqlite] Using SQLite, how can I search for chars that include a ', similar to OLE DB .Parameters?

2017-01-26 Thread Clyde Eisenbeis
To answer a previous question, here is an example of stCmdString contents: stCmdString = "SELECT fstPriority, fstInfo, fiKeyID FROM PadTable WHERE fstInfo LIKE '%macro%'" This works. On Thu, Jan 26, 2017 at 9:40 AM, Clyde Eisenbeis wrote: > Not finding much. > > I will

Re: [sqlite] Using SQLite, how can I search for chars that include a ', similar to OLE DB .Parameters?

2017-01-26 Thread Clyde Eisenbeis
Not finding much. I will try searching for a single word: string stCmdString = "SELECT" + stFieldNames + "FROM " + stTableName + " WHERE " + stLikeFieldName + " LIKE ('%' || ?1 || '%') "; When I tried entering: sqlite3_bind_ the compiler starts complaining. On Thu, Jan 26, 2017 at 9:18

[sqlite] text/numeric comparison confusion

2017-01-26 Thread Jeffrey Mattox
When used in a SELECT, I expect this comparison to be true (and it is): ( cast('25' as INTEGER) = 25 ) <--- true But, why is this false: ( '25' = 25 ) <--- false? and this is true: ( cast(25 as TEXT) = 25 ) <--- true So, being that second comparison is false (why?), then why isn't

Re: [sqlite] Using SQLite, how can I search for chars that include a ', similar to OLE DB .Parameters?

2017-01-26 Thread Clyde Eisenbeis
I'm searching the internet for sqlite3_bind_* () examples. On Thu, Jan 26, 2017 at 9:14 AM, Andy Ling wrote: > I think the point is, you need to use a prepared statement and bind the > parameters to it. > The bind process handles the special characters. > > So you will need

Re: [sqlite] Using SQLite, how can I search for chars that include a ', similar to OLE DB .Parameters?

2017-01-26 Thread Andy Ling
I think the point is, you need to use a prepared statement and bind the parameters to it. The bind process handles the special characters. So you will need to create a command string with question mark operators in like stCmdString += " AND fstInfo LIKE ('%' || ?1 || '%') AND fstInfo LIKE

Re: [sqlite] Using SQLite, how can I search for chars that include a ', similar to OLE DB .Parameters?

2017-01-26 Thread Clyde Eisenbeis
Re-reading the previous emails, it appears I also need to use sqlite3_bind_*(). On Thu, Jan 26, 2017 at 9:04 AM, Clyde Eisenbeis wrote: > I've also tried: > > string stCmdString = "SELECT" + stFieldNames + "FROM " + stTableName > + " WHERE " + stLikeFieldName + " LIKE ('%' ||

Re: [sqlite] Using SQLite, how can I search for chars that include a ', similar to OLE DB .Parameters?

2017-01-26 Thread R Smith
On 2017/01/26 5:04 PM, Clyde Eisenbeis wrote: I've also tried: string stCmdString = "SELECT" + stFieldNames + "FROM " + stTableName + " WHERE " + stLikeFieldName + " LIKE ('%' || " + liststLikeFieldValue[0] + " || '%')"; which does not work. Could you kindly simply output the resulting

Re: [sqlite] Using SQLite, how can I search for chars that include a ', similar to OLE DB .Parameters?

2017-01-26 Thread Clyde Eisenbeis
I've also tried: string stCmdString = "SELECT" + stFieldNames + "FROM " + stTableName + " WHERE " + stLikeFieldName + " LIKE ('%' || " + liststLikeFieldValue[0] + " || '%')"; which does not work. On Thu, Jan 26, 2017 at 8:14 AM, heribert wrote: > There are some

Re: [sqlite] Using SQLite, how can I search for chars that include a ', similar to OLE DB .Parameters?

2017-01-26 Thread heribert
There are some missing spaces i think: string stCmdString = "SELECT " + stFieldNames + " FROM " + stTableName + " WHERE " + stLikeFieldName + " LIKE '%'||" + liststLikeFieldValue[0] + "||'%'"; Am 26.01.17 um 15:04 schrieb Clyde Eisenbeis: I tried replacing this: string stCmdString =

Re: [sqlite] Using SQLite, how can I search for chars that include a ', similar to OLE DB .Parameters?

2017-01-26 Thread heribert
There are some missing spaces i think: string stCmdString = "SELECT " + stFieldNames + " FROM " + stTableName + " WHERE " + stLikeFieldName + " LIKE '%'||" + liststLikeFieldValue[0] + "||'%'"; Am 26.01.17 um 15:04 schrieb Clyde Eisenbeis: I tried replacing this: string stCmdString =

Re: [sqlite] Using SQLite, how can I search for chars that include a ', similar to OLE DB .Parameters?

2017-01-26 Thread Clyde Eisenbeis
I tried replacing this: string stCmdString = "SELECT" + stFieldNames + "FROM " + stTableName + " WHERE " + stLikeFieldName + " LIKE '%" + liststLikeFieldValue[0] + "%'"; with this: string stCmdString = "SELECT" + stFieldNames + "FROM " + stTableName + " WHERE " + stLikeFieldName + " LIKE

Re: [sqlite] Possible bug when creating a calculated index

2017-01-26 Thread Simon Slavin
On 25 Jan 2017, at 12:50pm, Simon Slavin wrote: > Bug is as follows: Anyone ? Did I miss something and you’re all too polite to point it out ? Simon. ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org

Re: [sqlite] BUG: Illegal initialization in icu.c : sqlite3IcuInit

2017-01-26 Thread Richard Damon
On 1/26/17 8:05 AM, Hick Gunter wrote: The OP proposes intializing the structure member with "0" instead of "(void*)db", which I read the other way around and reminds me of certain implicit equivalences 0 <==> (void*)0, on eof which was recently discussed here. Perhaps the OP's Compiler does

Re: [sqlite] BUG: Illegal initialization in icu.c : sqlite3IcuInit

2017-01-26 Thread dandl
>>>From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On >>>Behalf Of Ziemowit Laski Sent: Thursday, 26 January 2017 7:36 AM To: sqlite-users@mailinglists.sqlite.org Subject: [sqlite] BUG: Illegal initialization in icu.c : sqlite3IcuInit >>> >>>Visual C++ correctly catches

Re: [sqlite] BUG: Illegal initialization in icu.c : sqlite3IcuInit

2017-01-26 Thread Hick Gunter
The OP proposes intializing the structure member with "0" instead of "(void*)db", which I read the other way around and reminds me of certain implicit equivalences 0 <==> (void*)0, on eof which was recently discussed here. Perhaps the OP's Compiler does not allow initialization of a dynamic

Re: [sqlite] BUG: Illegal initialization in icu.c : sqlite3IcuInit

2017-01-26 Thread Clemens Ladisch
Hick Gunter wrote: > On ILP_32 architectures, the integer 0 What integer 0? The message is about initializing scalars[11].pContent (a "void*") with "(void*)db", which is "sqlite3*". > Oh? What exactly is illegal about this? > >> struct IcuScalar { >> const char *zName;

Re: [sqlite] BUG: Illegal initialization in icu.c : sqlite3IcuInit

2017-01-26 Thread Hick Gunter
On ILP_32 architectures, the integer 0 is not discernible from the (void *)0 (aka NULL) and so most compilers don't bother to issue a warning. This comes from an age where programmers were expected to know how computers work on an assembly language level and would "know what they are doing"