On Thu, Feb 04, 2010 at 03:59:14PM +0800, gujx scratched on the wall:
> There is a table like this:


> Is there any way to resolve this?

  First off, you need to understand that columns do not have "types",
  they have affinities.

     http://sqlite.org/datatype3.html
 
  Read this whole page.  Several times.  Make sure you understand it in
  great detail.



  Second, you can put any type into (almost) any column, so it doesn't
  matter.  If the affinity is setup right, SQLite will usually do the
  right thing.  For example, if you have a column with numeric affinity
  and you insert the text value '12', it will converted to an integer
  before it is stored.

  Which bind function you use is usually dictated by what you have
  (e.g. if you have a text value, you use _text(), if you have an int,
  you use _int()), rather than the column you are placing it in. 
  SQLite will try its best to convert what you've given it into a
  format that makes sense for the column, but if it can't, it will store
  it in whatever format you sent.  Which is more or less exactly the
  position you'd be in if you wanted to do the conversion "by-hand."

   -j

-- 
Jay A. Kreibich < J A Y  @  K R E I B I.C H >

"Our opponent is an alien starship packed with atomic bombs.  We have
 a protractor."   "I'll go home and see if I can scrounge up a ruler
 and a piece of string."  --from Anathem by Neal Stephenson
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to