Comments - MariaDB ODBC 3.2.2 insert zero date for empty strings

2 weeks, 5 days ago Ian Gilfillan
This comment has the status of 'removed' and can only be seen by you.

If you need to retrieve them as NULL, you could insert them as NULL, either explicitly, or by setting the default value to NULL:

CREATE OR REPLACE TABLE t1 (id INT, dt DATETIME DEFAULT NULL);
       
INSERT INTO t1(id) VALUES (1);

SELECT * FROM t1;             
+------+------+
| id   | dt   |
+------+------+
|    1 | NULL |
+------+------+
 
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.