Indeed, Igor, it is documented behavior, but my point was to reply to the OP, who had written ruefully about SQLite's laissez-faire approach to datatypes. For the OP's benefit, I wanted to demonstrate the behavior, show what can be done with CAST, and then finally to show what can be done with CAST in a CHECK constraint. Using a CAST in the CHECK constraint can prevent the insertion of REALS into a column one has defined as INTEGER. It's possible to turn loose-loafer-wearing SQLite into a veritable buttoned-down wing-tipped data martinet. Regards Tim Romano Swarthmore PA
On Thu, Jul 15, 2010 at 8:07 AM, Igor Tandetnik <itandet...@mvps.org> wrote: > Tim Romano <tim.romano...@gmail.com> wrote: > > So it would appear that if the numeric value to be inserted can be > coerced > > to INTEGER without loss, it will in fact become an INTEGER, otherwise it > > stay what it was, REAL. > > ..., the behavior that is amply documented at > http://sqlite.org/datatype3.html > -- > Igor Tandetnik > > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users