mysql - Compatibility Query for inserting null values in datefield -


i'm using oracle , mysql database in our project. trying write common queries both databases.

i'm trying insert date in date field both database tables. both databases support date format only: 2013-07-19. in course of our dml operations facing problem when inserting dates empty or null.

both databases have own syntax store "empty field" in date field/column.

mysql allows dates 0000-00-00 or null (specifically written @ appropriate position). oracle not support format. oracle allows date fields empty.

how write common queries in type of situation?

insert tablename(datefield) values(null); 

...works both in mysql , oracle, use that.


Comments