Small. Fast. Reliable.
Choose any three.

This information is obsolete. You are looking at the CVSTrac source management system display for SQLite that was replaced by Fossil on 2009-08-11. The information shown here has not been updated since that cut-over. These pages are retained for historical reference only.

I could not find any info on converting and comparing to avoid type confusion. Is there a way to guarentee that comparisons are of a given type?

For example, I am looking for something like:

  ...WHERE NUMBER(A) > NUMBER(B)  // dummy sql

  ...ORDER BY NUMBER(X), STRING(Y)  // dummy sql

In other words, how does one guarentee that comparisons are being interpreted as the needed or expected type? (This is assuming I don't want to pre-declare column types)


   ...WHERE CAST(A as INTEGER) > CAST(B as INTEGER)
   ...ORDER BY CAST(X as REAL), CAST(Y AS TEXT)


Kudos on Dynamic Typing

I applaud SQLite for implementing dynamic, free-form typing. Some will criticize you for it, but dynamic typing offers a lot of flexibility and "meta" ability for sophisticated programming.