On 10 Oct 2012, at 6:21pm, jkp487-sql...@yahoo.com wrote:

> Is there a way to get column data type information for 
> derived columns in a query or view? For example, if I have something like 
> this:
> 
> 
> select Customer.LastName || Customer.FirstName as Fullname
> 
> 
> then no data type is returned for that column.

The column does not have a data type.  Because different values in the same 
column might have different datatypes.  However, each individual value has a 
datatype.  So if you have designed your schema and written your code so that 
columns are consistent you can just get the datatypes from every value in the 
first row, and assume that every other row is the same.

So either look at the first row of the table that the SELECT returns, or do the 
SELECT first with a LIMIT 1, and use the types returned from that.

Simon.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to