SQLite Forum

Select of text that matches scientific notation format automatically converted to number
Login
The OP is using an existing SQLite db. The problem came up when this db was created as already discussed in several of the replies, and fixes were suggested.

If, however, the db cannot be obtained in some corrected form, then the only way would be to try to fix when SELECTing from the db. [typeof](https://sqlite.org/lang_corefunc.html#typeof) to indicate when the undesired conversion to numeric had occured and [printf](https://sqlite.org/lang_corefunc.html#printf) would convert back to the 3-4 digit airport code. But this seems ambiguous: For example 200000 was probably '2E5' (Dell City Municipal Airport), but could also have been '20E4'. The latter does not seem to exist as an airport code, so the database entry should be updated to '2E5'. But whether an ambiguity can be resolved in all cases is uncertain. And even if ambiguities could be resolved programming the update in SQL would be quite a project and involve another Sqlite database of all existing airport codes. Would this be available?