mahanare
December 27th, 2003, 09:47 AM
Hi, i was trying the following.. in mysql.
1)create table test(id INTEGER NOT NULL);
2)INSERT INTO TEST VALUES();
This statement is inserting a record with element "0"
3) then i saw with desc test;
mysql> DESCRIBE TEST;
+-------+---------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+---------+------+-----+---------+-------+
| id | int(11) | | | 0 | |
+-------+---------+------+-----+---------+-------+
1 row in set (0.00 sec)
mysql>
here y it took default value 0 .. i dont know
i didnt mention it in the query.
4)when i give INSERT INTO TEST VALUES(NULL);
then only i am getting error.
5)is there difference between "" and NULL?
if true wat is NULL exactly..
how to get error message when i give
INSERT INTO TEST VALUES();
thnx
1)create table test(id INTEGER NOT NULL);
2)INSERT INTO TEST VALUES();
This statement is inserting a record with element "0"
3) then i saw with desc test;
mysql> DESCRIBE TEST;
+-------+---------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+---------+------+-----+---------+-------+
| id | int(11) | | | 0 | |
+-------+---------+------+-----+---------+-------+
1 row in set (0.00 sec)
mysql>
here y it took default value 0 .. i dont know
i didnt mention it in the query.
4)when i give INSERT INTO TEST VALUES(NULL);
then only i am getting error.
5)is there difference between "" and NULL?
if true wat is NULL exactly..
how to get error message when i give
INSERT INTO TEST VALUES();
thnx