• Business posts
  • Technology posts
  • Company site
  • SubscribeRSS

Flex 3 SQLite and the mystery of “text value to numeric value”

Posted on March 14, 2008  by saarni
Filed Under Adobe AIR, Flex 3, sqlite
Tags: Adobe AIR, Flex 3, rtfm, sqlite, timestamp

Learning new development environments and languages can be quite fun, but sometimes it turns out just plain frustrating. Especially so if you are trying to learn something that is still in its beta stage. This time it was Adobe AIR and Flex 3.

The program in question required storing date and time values in an sqlite3 database. Now, as the title of this entry says, I should’ve just read the AIR sqlite handling manual 1 more time (or 2-10 more times) and I could’ve learnt that AIR SQL handling accepts “Date” as column type and handles inserting and getting Date objects from the database transparently. I did not notice this while studying and used “TIMESTAMP” as column type instead. This is where things went wrong… so wrong…

Using “TIMESTAMP” column type and inserting datetime strings worked flawlessly in the betas along with using sqlite date functions. But AIR 1.0 release came and suddenly my application started producing the following SQL errors everywhere:

SQLError: 'Error #3115: SQL Error.', details:'could not convert text value to numeric value.', operation:'execute'

Naturally for a few days I went through my SQL code and tables trying different things on columns that had types like “INTEGER”, “REAL”, “NUMERIC” and so on. After trying and trying I finally decided to read the AIR documentation again. The essential part turned out to be how AIR handles the column affinities in the release version: everything not recognized by AIR is given “NUMERIC” column affinity. This and the fact that AIR is now stricter about types is what changed between the betas and release version and broke the columns with “TIMESTAMP” as type since I was trying to insert text.

So, again, I should’ve just rtfm…

  • About

    Twinapex Blog is the voice of mobile and Internet experts. We tell tales about our exciting life in the world where communication methods convergence and you can access whatever information you wish, wherever, on whichever device you want.

    If you find us interesting and talented and you are looking for developers, please contact us and we might just be able to help you.

    Creative Commons License
    This work is licensed under a Creative Commons Attribution 3.0 Unported License.

  • Recently Written

  • PyDev, Python and system default Unicode encoding problem
  • Creating a drag’n’drop basket with jQueryUI
  • Mobile browser wars: Nokia microB vs. Firefox Fennec
  • Profiling PostgreSQL database
  • It will be damn big, and damn fast…
  • Black Friday was not sad for mobile commerce
  • Nokia N900, sports tracking and geotagging
  • PhoneGap ported on N900 (Maemo)
  • Do you really think 160 chars tells the story?
  • Installing Python Imaging Library (PIL) under virtualenv or buildout
  • Tags

  • aggregator analytics android api buildout c++ cms comic debug debugging developer django documentation eclipse extjs failure html iphone javascript jquery language linux mobile multilingual nokia php plone Plone (old) pys60 python release rss s60 seo series 60 setuptools sql subclipse symbian ubuntu usability virtualenv web web development zope
  • Monthly Archives

  • January 2010
  • December 2009
  • November 2009
  • October 2009
  • September 2009
  • August 2009
  • July 2009
  • February 2009
  • December 2008
  • November 2008
  • October 2008
  • September 2008
  • August 2008
  • July 2008
  • June 2008
  • May 2008
  • April 2008
  • March 2008
  • February 2008
  • November 2007
  • October 2007
  • September 2007
  • August 2007
  • July 2007
 
© Twinapex Oy 2010 Log in