tags:

views:

80

answers:

1

Hi this is my code which will not work correctly ! what is wrong with its data type :( thanks

CREATE TABLE T1 (A INTEGER NOT NULL);
CREATE TABLE T3 (A SMALLINT NOT NULL);
INSERT T1 VALUES (32768.5);
SELECT * FROM T1;
INSERT T3 SELECT * FROM T1;
SELECT * FROM T3;
+8  A: 

32768.5 is not an integer, and it's too big to fit in a smallint.

Paul Tomblin
Mysql numeric max referencehttp://dev.mysql.com/doc/refman/5.0/en/numeric-types.html
BozoJoe
could you help me that just the errors that will be occured are for lines 3 and 4?
@user328920, how about posting the errors you got? As I said, if you want to store 32768.5 in a field, don't make it INTEGER. If you want to make the column INTEGER, then don't try to store a non-integer in it.
Paul Tomblin
thanks a lot for your answer