Hi sqlite-users,
    When I was toying around with sqlite in python, I ran into an
interesting caveat when INSERTing into a table where an unsupported
data type didn't throw an exception/error from sqlite's perspective.
    In the example below, I expected an insert of a text field to an
integer column to throw an error, but the insert succeeded:

$ sqlite3.exe ~/test.db 'CREATE TABLE bar2(foo INTEGER)'
$ sqlite3.exe ~/test.db 'INSERT INTO bar2(foo) VALUES(6)'
$ sqlite3.exe ~/test.db 'INSERT INTO bar2(foo) VALUES("a")'
$ sqlite3.exe ~/test.db 'SELECT * FROM bar2'
6
a
$ sqlite3.exe --version
3.8.4.3 2014-04-03 16:53:12 a611fa96c4a848614efe899130359c9f6fb889c3

    Being able to INSERT and print out 'a' above caught me off guard a bit.
    Is this programmer error when I ran CREATE TABLE or the INSERT
(this is the most likely answer, but I wanted to be sure), or is this
by design?
Thank you!
-Garrett
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to