On Sat, Apr 16, 2011 at 07:40:59PM +0200, Tobias Vesterlund scratched on the 
wall:
> Hi,
> 
> I ran into something I don't understand, maybe someone here can shed some 
> light on it for me.
> 
> I have a table named Tg which is created (with tcl) by:
> 
> CREATE TABLE Tg (TgConfigId INTEGER PRIMARY KEY AUTOINCREMENT,
>         OtherColumn INTEGER);
> 
> If I do:
> INSERT INTO Tg (TgConfigId) VALUES (1);
> 
> The following select works:
> SELECT * FROM Tg WHERE TgConfigId = 1;
> 
> But if I insert '1' instead I have to select on '1', 1 no longer works.
> That makes some sense,

  Actually, it doesn't make sense.  If it is truly an INTEGER PRIMARY
  KEY column, you should only be able to insert integer values.  You
  can insert '1', but it will be converted and stored as an integer.

  Any other column is a different story, as others have pointed out,
  but an INTEGER PRIMARY KEY column is limited to only integer values.

   -j

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

"Intelligence is like underwear: it is important that you have it,
 but showing it to the wrong people has the tendency to make them
 feel uncomfortable." -- Angela Johnson
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to