Re: [sqlite] Computed columns in VIEWs return NULL but should be able to be typed! Any ideas?

2013-06-17 Thread HAUBOURG
Thanks Stephan for your feedback. Bad news for me. I see two solutions: - hire a dev for this. I'm not following enough sqlite lists to estimate if this is feasible. Any opinion? - hire a QGIS dev to hack a autodetection of type using content of fields. Ugly, probably slow and prone to errors..

Re: [sqlite] Computed columns in VIEWs return NULL but should be able to be typed! Any ideas?

2013-06-15 Thread Stefan Keller
Hi RĂ©gis I'd wish to give you a solution but I'm sorry to have new news about that issue. I'd be happy if there are any SQlite devs around to give you a solution in order to make this database more usable (an more SQL compatible). Yours, Stefan 2013/6/11 regish

Re: [sqlite] Computed columns in VIEWs return NULL but should be able to be typed! Any ideas?

2013-06-11 Thread regish
Hi all, I'm starting to use SQLITE in GIS use cases. I'm facing this view typing column issue, which prevent my favourite client from interpreting correctly numeric data types. I'm using QGIS, so I won't be able to map numeric values (they fall back as text values). Is there anything new since

Re: [sqlite] Computed columns in VIEWs return NULL but should be able to be typed! Any ideas?

2010-05-11 Thread BareFeetWare
On 11/05/2010, at 6:12 PM, Ben Harper wrote: > To determine the type of columns in a view I use > SELECT typeof(column) FROM viewname LIMIT something; > > Unfortunately if most of the column data is NULL then you can end up having > to scan the entire table. Yes, I also do that as a last

Re: [sqlite] Computed columns in VIEWs return NULL but should be able to be typed! Any ideas?

2010-05-11 Thread Ben Harper
To determine the type of columns in a view I use SELECT typeof(column) FROM viewname LIMIT something; Unfortunately if most of the column data is NULL then you can end up having to scan the entire table. I'm not sure how SQlite calculates these types, but this simple workaround has been OK for

Re: [sqlite] Computed columns in VIEWs return NULL but should be able to be typed! Any ideas?

2010-05-08 Thread Stefan Keller
Right, I don't want to lessen scalability of my application. But I also don't want to introcude redundancy just because some columns on the the view lack a type. I assume SQLite wants to adhere to the relational model which states: The result of a select statement is another relation. And "A view

Re: [sqlite] Computed columns in VIEWs return NULL but should be able to be typed! Any ideas?

2010-05-07 Thread Pavel Ivanov
> To Pavel: My application reads the column types out in order to pretty > print the values - as mentioned by Tom - but also to generate a dialog > for entering new data (of course combined with INSTEAD OF TRIGGERs). So as I see it: you have some universal code for displaying and inputing data.

Re: [sqlite] Computed columns in VIEWs return NULL but should be able to be typed! Any ideas?

2010-05-06 Thread Dan Bishop
Stefan Keller wrote: > Thank you, Tom and Dan, for your constructive answers. > > To Pavel: My application reads the column types out in order to pretty > print the values - as mentioned by Tom - but also to generate a dialog > for entering new data (of course combined with INSTEAD OF TRIGGERs). >

Re: [sqlite] Computed columns in VIEWs return NULL but should be able to be typed! Any ideas?

2010-05-06 Thread Stefan Keller
Thank you, Tom and Dan, for your constructive answers. To Pavel: My application reads the column types out in order to pretty print the values - as mentioned by Tom - but also to generate a dialog for entering new data (of course combined with INSTEAD OF TRIGGERs). I understand that it's

Re: [sqlite] Computed columns in VIEWs return NULL but should be able to be typed! Any ideas?

2010-05-05 Thread BareFeetWare
On 06/05/2010, at 2:51 PM, Dan Bishop wrote: > BareFeetWare wrote: >> >> I've had the same issue. In the end I had to parse my view functions in my >> own code and look for functions that give a particular type of result. So, >> for instance, round() gives an integer, round(..., 2) gives a

Re: [sqlite] Computed columns in VIEWs return NULL but should be able to be typed! Any ideas?

2010-05-05 Thread Dan Bishop
BareFeetWare wrote: > On 04/05/2010, at 3:14 AM, Stefan Keller wrote: > > >> But in SQLite if a view column comes from a function result or some >> computation, then the column type is NULL...!? It's not taking the >> result-type as mentioned in the manual >>

Re: [sqlite] Computed columns in VIEWs return NULL but should be able to be typed! Any ideas?

2010-05-05 Thread BareFeetWare
On 04/05/2010, at 3:14 AM, Stefan Keller wrote: > But in SQLite if a view column comes from a function result or some > computation, then the column type is NULL...!? It's not taking the > result-type as mentioned in the manual > (http://www.sqlite.org/lang_select.html) - even when I try to do

Re: [sqlite] Computed columns in VIEWs return NULL but should be able to be typed! Any ideas?

2010-05-05 Thread Pavel Ivanov
> I interpret the silence on the lis that anyone agrees that SQLite has a bug Generally silence on this list means that everybody disagrees with you and/or doesn't see enough arguments in your email to even start any discussion. When everybody agrees that SQLite has a bug you get a lot of

Re: [sqlite] Computed columns in VIEWs return NULL but should be able to be typed! Any ideas?

2010-05-05 Thread Stefan Keller
I interpret the silence on the lis that anyone agrees that SQLite has a bug because there seems to be no way to get VIEWS returning the column type if the column is calculated or a function. This also breaks compatibility as mentioned in http://www.sqlite.org/datatype3.html ("SQL statement that

Re: [sqlite] Computed columns in VIEWs return NULL but should be able to be typed! Any ideas?

2010-05-03 Thread Stefan Keller
Unfortunately the application which reads from this view needs that all columns are typed - even if the values types deviate from it - and I think this is a logical assumption. So, I fear I do have only one chance and SQLite doesn't let me do it: CREATE VIEW myview AS SELECT id, name,

Re: [sqlite] Computed columns in VIEWs return NULL but should be able to be typed! Any ideas?

2010-05-03 Thread Simon Slavin
On 3 May 2010, at 6:14pm, Stefan Keller wrote: > But in SQLite if a view column comes from a function result or some > computation, then the column type is NULL...!? It's not taking the > result-type as mentioned in the manual > (http://www.sqlite.org/lang_select.html) - even when I try to do a

Re: [sqlite] Computed columns in VIEWs return NULL but should be able to be typed! Any ideas?

2010-05-03 Thread Pavel Ivanov
> Is there a way to give such columns a type anyway? I guess you aware that columns in SQLite doesn't have types? They only have "declared type" (which is arbitrary string used in CREATE TABLE statement) and affinity. OTOH values in each row have types. And neither "declared type" nor affinity

[sqlite] Computed columns in VIEWs return NULL but should be able to be typed! Any ideas?

2010-05-03 Thread Stefan Keller
I have a question regarding VIEWs in SQLite: It looks like if SQLite simply copies the column type from the original table into the corresponding view column. And I know SQLite implements some 'loose column typing'. That's ok so far. But in SQLite if a view column comes from a function result