Re: [sqlite] Is it possible to transpose a table using SQL?

2019-03-31 Thread Shane Dev
Hi Keith, Jean-Luc I should have mentioned my shell is configured to display column headers Product/Region|Belgium|France|USA for table t1 and Product/Region|Oil_filter|Spark_plug|Coolent for view v1. By "dynamically changing table", I meant the number of columns and rows could could change after

Re: [sqlite] FTS5 Transaction Leads to NULL Pointer

2019-03-31 Thread Philip Newton
On Tue, 19 Mar 2019 at 07:35, Dan Kennedy wrote: > > Now fixed here: > >https://sqlite.org/src/info/45c73deb440496e8 From that diff, it seems that you changed the documentation of the function's parameters where the function was defined (see fts5_hash.c line 489 at the right) but not where

Re: [sqlite] Bug in sqlite3 (CLI, linux/Ubuntu)

2019-03-31 Thread Keith Medcalf
Works fine for me on Centos ... using the default (ancient) version of SQLite3 # sqlite3 /tmp/test.db "CREATE TABLE test (col1); INSERT INTO test VALUES(1);" # touch /tmp/test.init # sqlite3 /tmp/test.db "SELECT * FROM test;" 2>/dev/null 1 # sqlite3 -init /tmp/test.init /tmp/test.db "SELECT *

Re: [sqlite] Is it possible to transpose a table using SQL?

2019-03-31 Thread Keith Medcalf
On Sunday, 31 March, 2019 14:07, Shane Dev wrote: >Is it possible to create a view which switches rows and columns of a >dynamically changing table? >For example, imagine we have table t1 where both columns and rows >could change after the view has been created >sqlite> select * from t1;

Re: [sqlite] Is it possible to transpose a table using SQL?

2019-03-31 Thread Jean-Luc Hainaut
If by "a dynamically changing table " you mean that any data change (not schema change) in t1 will propagate to v1, and if the set of Product values doesn't change, then you can try this: create table t1(Product,Belgium,France,USA); insert into t1 values

Re: [sqlite] Bug in sqlite3 (CLI, linux/Ubuntu)

2019-03-31 Thread Software
> Dear colleagues > > I detected an unexpected behaviour in sqlite3 (CLI) that I consider a bug as > it seems not documented. > > When using an init file (even if an empty file), sqlite3 outputs an extra > empty line to stdout. This messes up parsing of the sqlite3 output, as this > line

Re: [sqlite] Is it possible to transpose a table using SQL?

2019-03-31 Thread Simon Slavin
On 31 Mar 2019, at 9:07pm, Shane Dev wrote: > Is it possible to create a view which switches rows and columns of a > dynamically changing table? Sorry, but no. A VIEW is just a saved SELECT statement. If you can't do it in a SELECT statement, you can't do it in a view. And you can't do

[sqlite] Is it possible to transpose a table using SQL?

2019-03-31 Thread Shane Dev
Hello, Is it possible to create a view which switches rows and columns of a dynamically changing table? For example, imagine we have table t1 where both columns and rows could change after the view has been created sqlite> select * from t1; Product/Region|Belgium|France|USA Oil_filter|1|2|3