Re: [sqlite] How do I see a full query?

2016-12-27 Thread Igor Korot
Keith, On Tue, Dec 27, 2016 at 10:59 PM, Keith Medcalf wrote: > >> > So whether hard coding the empty string in the query or using a >> parameter (in which you can use some value other than an empty string) >> depends on what you will need in the context of the application.

Re: [sqlite] How do I see a full query?

2016-12-27 Thread Igor Korot
Hi, Simon, On Tue, Dec 27, 2016 at 12:14 AM, Simon Slavin wrote: > > On 27 Dec 2016, at 4:24am, Igor Korot wrote: > >> I have a weird situation where executing a query in a shell gives me a row, >> but executing the same query through the C-interface:

Re: [sqlite] How do I see a full query?

2016-12-27 Thread Keith Medcalf
> > So whether hard coding the empty string in the query or using a > parameter (in which you can use some value other than an empty string) > depends on what you will need in the context of the application. It will, > of course, never return a row in which the abt_ownr field has a value > other

Re: [sqlite] How do I see a full query?

2016-12-27 Thread Keith Medcalf
Yes. Either method would work, though you say: > because abt_ownr field will always be empty (unless there is a way to know > what user connected to the DB). So whether hard coding the empty string in the query or using a parameter (in which you can use some value other than an empty string)

Re: [sqlite] How do I see a full query?

2016-12-27 Thread Igor Korot
Hi, Keith, On Dec 27, 2016 7:23 AM, "Keith Medcalf" wrote: The problem is that your query is broken -- they are not the same. Double-quotes surround names (table names, column names, index names, view names, alias names). Strings (text values) are surrounded by

Re: [sqlite] How do I see a full query?

2016-12-27 Thread Igor Korot
Hi, Hick, On Tue, Dec 27, 2016 at 3:02 AM, Hick Gunter wrote: > The functions sqlite3_sql() and sqlite3_expanded_sql() will return the > original and expanded (i.e. with the bound values insted of parameter names) > SQL strings for a statement created with the

Re: [sqlite] How do I see a full query?

2016-12-27 Thread Keith Medcalf
sqlite3_expand_sql was added at checkin https://www.sqlite.org/src/info/99a6c51887d9d784 so far as I can tell the next release after it was added was 3.14 -- any release prior to 24 July 2016 cannot contain the function since it did not exist before the above checkin. Are you using a

Re: [sqlite] How do I see a full query?

2016-12-27 Thread Igor Korot
Hi, Keith, On Tue, Dec 27, 2016 at 9:18 PM, Keith Medcalf wrote: > > Yes. Either method would work, though you say: > >> because abt_ownr field will always be empty (unless there is a way to know >> what user connected to the DB). > > So whether hard coding the empty string

Re: [sqlite] How do I see a full query?

2016-12-27 Thread Keith Medcalf
The problem is that your query is broken -- they are not the same. Double-quotes surround names (table names, column names, index names, view names, alias names). Strings (text values) are surrounded by single-quotes. You just happen to be lucky that your query works since it is malformed from

Re: [sqlite] How do I see a full query?

2016-12-27 Thread Hick Gunter
The functions sqlite3_sql() and sqlite3_expanded_sql() will return the original and expanded (i.e. with the bound values insted of parameter names) SQL strings for a statement created with the sqlite3_prepare_V2() interface. -Ursprüngliche Nachricht- Von: sqlite-users

Re: [sqlite] Possible bug with union and join.

2016-12-27 Thread Don V Nielsen
Theory related question. I'm being argumentative, I know. But this issue is in the same category as one discussed weeks ago. SQLite is, in a sense, typeless. All data is stored as text (ignore blob). Correct? It is when one casts a column to something other than text that triggers SQLite to treat

Re: [sqlite] Possible bug with union and join.

2016-12-27 Thread Don V Nielsen
Thanks for the correction/information! Merry Christmas and Happy New Year to you. On Tue, Dec 27, 2016 at 9:48 AM, Richard Hipp wrote: > On 12/27/16, Don V Nielsen wrote: >> Theory related question. I'm being argumentative, I know. But this >> issue is in

Re: [sqlite] Possible bug with union and join.

2016-12-27 Thread Hick Gunter
Incorrect. All data is stored as NULL, integer, float, text or blob. The "declared type" is taken as a hint from the designer in respect to the kind of values he intends to store there. The result of the hint is called an "affinity", i.e. the kind of data the field "likes to" store. If the

Re: [sqlite] Possible bug with union and join.

2016-12-27 Thread Richard Hipp
On 12/27/16, Don V Nielsen wrote: > Theory related question. I'm being argumentative, I know. But this > issue is in the same category as one discussed weeks ago. > > SQLite is, in a sense, typeless. All data is stored as text (ignore > blob). Correct? It is when one casts