Re: [sqlite] How to retrieve table names for the given string

2018-09-27 Thread Keith Medcalf
Insert the following schema views: -- Catalog Views using sqlite_master for SysObjects (Object Names) -- and the various pragma_(ObjectName) tables to retrieve schema data -- all TEXT columns in views have "collate nocase" attachmented to the output -- columns to ensure that where conditions on

Re: [sqlite] How to retrieve table names for the given string

2018-09-27 Thread Richard Hipp
On 9/27/18, Revathi Narayanan wrote: > Hi, > > I have one requirement like I want to display all the table names for the > given column name. > > Ex: If the table T1 and T2 has column names like C1 then it should display > both the table names T1 and T2. > > I tried to execute the query using

Re: [sqlite] How to retrieve table names for the given string

2018-09-27 Thread Igor Tandetnik
On 9/27/2018 9:43 AM, Revathi Narayanan wrote: I have one requirement like I want to display all the table names for the given column name. Ex: If the table T1 and T2 has column names like C1 then it should display both the table names T1 and T2. With sufficiently recent SQLite version, you

Re: [sqlite] How to retrieve table names for the given string

2018-09-27 Thread Simon Slavin
On 27 Sep 2018, at 2:43pm, Revathi Narayanan wrote: > I tried to execute the query using sqlitemaster. But it's displaying only > table names not column names. sqlite_master does not have column name columns. They're just mentioned in the CREATE statement. You might want to combine it with

[sqlite] How to retrieve table names for the given string

2018-09-27 Thread Revathi Narayanan
Hi, I have one requirement like I want to display all the table names for the given column name. Ex: If the table T1 and T2 has column names like C1 then it should display both the table names T1 and T2. I tried to execute the query using sqlitemaster. But it's displaying only table names not

[sqlite] A SQL statement reformatter

2018-09-27 Thread Simon Slavin
For those times when you have to understand a poorly-formatted SQL statement: I seem to prefer 'full' mode. Simon. ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org

Re: [sqlite] storing unsigned 64 bit values

2018-09-27 Thread Keith Medcalf
If you wanted to store it as purple tree smoke signals you could do that too. However, the fact of the matter is that SQLite3 does not perform conversions to and from purple tree smoke signals, and the OP was not trying to store the value as a "hex or decimal representation of the number", or

Re: [sqlite] storing unsigned 64 bit values

2018-09-27 Thread Nathan Wagner
On Thu, Sep 27, 2018 at 11:05:24AM -0600, Keith Medcalf wrote: > so the only way to store something [larger than a signed 64-bit int] > is as a double-precision float. I'd like to point out that you could *store* it as the hex or decimal text representation of the integer. If you included

Re: [sqlite] Is SQLITE_DETERMINISTIC ignored on an aggregate?

2018-09-27 Thread Richard Hipp
On 9/27/18, Deon Brewis wrote: > Is there anything that SQLITE_DETERMINISTIC would ever be used for in an > aggregate? (Function with xStep/xFinal as opposed to just xFunc). > > I assume it's ignored, but just checking. I believe you are correct. But why are you asking? -- D. Richard Hipp

Re: [sqlite] storing unsigned 64 bit values

2018-09-27 Thread Keith Medcalf
Well, you could call it a shiny shoe integer. the "shiny shoe" part is just ignored, just like your use of the word unsigned. And no, the value stored was a IEEE-754 double precision floating point so you got to keep the high 53 bits are the rest were discarded (this is because the value was

Re: [sqlite] storing unsigned 64 bit values

2018-09-27 Thread Simon Slavin
On 27 Sep 2018, at 5:10pm, Conor Lennon wrote: > It's declared as a unsigned integer There is no such thing in SQLite. SQLite has an integer type, but it is an 8-byte signed integer. If you don't need to sort on that

Re: [sqlite] [EXTERNAL] Re: storing unsigned 64 bit values

2018-09-27 Thread Hick Gunter
"unsigned" is ignored by sqlite. Depending on how you inserted the value, it could be stored as a text or as a real value, irrespective of the declared type. -Ursprüngliche Nachricht- Von: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] Im Auftrag von Conor Lennon

Re: [sqlite] storing unsigned 64 bit values

2018-09-27 Thread Conor Lennon
On 27/09/18 17:03, Simon Slavin wrote: > On 27 Sep 2018, at 11:53am, Conor Lennon wrote: > >> e.g. 18446744073709551615 (one less than 2 to the power of 65) >> >> I seem to have managed to store this value in a database. > What is the affiliation for that column ? Did you declare it as INTEGER

Re: [sqlite] storing unsigned 64 bit values

2018-09-27 Thread Simon Slavin
On 27 Sep 2018, at 11:53am, Conor Lennon wrote: > e.g. 18446744073709551615 (one less than 2 to the power of 65) > > I seem to have managed to store this value in a database. What is the affiliation for that column ? Did you declare it as INTEGER or something else ? Simon.

[sqlite] Is SQLITE_DETERMINISTIC ignored on an aggregate?

2018-09-27 Thread Deon Brewis
Is there anything that SQLITE_DETERMINISTIC would ever be used for in an aggregate? (Function with xStep/xFinal as opposed to just xFunc). I assume it's ignored, but just checking. - Deon ___ sqlite-users mailing list

[sqlite] SQLite pre-compiled DLL for Windows x64

2018-09-27 Thread Eric Grange
Hi, For version 3.25.2, the precompiled x64 DLL appears missing, there are several vsix downloads, but when extracting the bundled DLLs (in the Redist/Retail directories), they appear different (or non-standard ones that need some form of post-processing ?), for instance the x86 dll is larger

Re: [sqlite] Bug in 3.25.2 (RECURSIVE CTE + window function)

2018-09-27 Thread Richard Hipp
Thanks for the report and test case. Now fixed on trunk and on branch-3.25. On 9/25/18, Щекин Ярослав wrote: > Hello. > > Here's the self-contained test case: > > WITH t(id, parent) AS ( > SELECT CAST(1 AS INT), CAST(NULL AS INT) > UNION ALL > SELECT 2, NULL > UNION ALL > SELECT 3, 1 > UNION

Re: [sqlite] SQLITE PERCENTAGE

2018-09-27 Thread Radovan Antloga
select 100.0 * sum(survived) / count(*) as tot_pct_survived FROM passengers Regards Radovan frknozdmr01 je 26.09.2018 ob 3:03 napisal: Hi, I need to find the percent of passengers survived? (total). How do you do it? I tried the comment below but it did not work. SELECT SUM(CASE WHEN

[sqlite] storing unsigned 64 bit values

2018-09-27 Thread Conor Lennon
I am trying to store and retrieve unsigned 64 bit integer values in sqlite through c bindings. e.g. 18446744073709551615 (one less than 2 to the power of 65) I seem to have managed to store this value in a database. When I run sqlite3 on the command line and select the column, I get back

[sqlite] System.AccessViolationException: 'Attempted to read or write protected memory. This is often an indication that other memory is corrupt.'

2018-09-27 Thread Ayush Maheshwari
When Connection is open then the exception is:-System.AccessViolationException Code is:-- * SQLiteCommand cmd = new SQLiteCommand();* *cmd.Connection = connection;* *connection.Open();* *Helper helper = new Helper(cmd);* *helper.BeginTransaction();* Please help

[sqlite] SQLITE PERCENTAGE

2018-09-27 Thread frknozdmr01
Hi, I need to find the percent of passengers survived? (total). How do you do it? I tried the comment below but it did not work. SELECT SUM(CASE WHEN survived=1 THEN 1.0 ELSE 0.0 END) / CAST(COUNT(*) AS FLOAT)*100 AS tot_pct_survived FROM passengers; This is the

[sqlite] Bug in 3.25.2 (RECURSIVE CTE + window function)

2018-09-27 Thread Щекин Ярослав
Hello. Here's the self-contained test case: WITH t(id, parent) AS ( SELECT CAST(1 AS INT), CAST(NULL AS INT) UNION ALL SELECT 2, NULL UNION ALL SELECT 3, 1 UNION ALL SELECT 4, 1 UNION ALL SELECT 5, 2 UNION ALL SELECT 6, 2 ), q AS ( SELECT t.*, ROW_NUMBER() OVER (ORDER BY t.id) AS rn FROM t