>Ok, I was kinda hoping for a more "permanent" solution such as:

Did you consider creating a view?

>int sqlite3_cast_column_type(sqlite3* db, const char* zDBname, const char* 
>zTable, const char* zColumn, int newColumnType);
>
>that would cast the column into the desired type, returning SQLITE3_ERROR if 
>the cast is invalid (like from double to integer, or text to numeric).

You can use a CASE statement for this:

  select case typeof (a) 
  when 'real' then a
  else 'Invalid type: ' || typeof (a) end  
  from my_table;

Ralf 

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

Reply via email to