Difference between revisions of "Portable SQL/Common/DBMS Differences"
From Linuxnetworks
(NULL in column definition) |
(→Differences between database implementations) |
||
| Line 2: | Line 2: | ||
| − | = Differences between | + | = Differences between implementations = |
== NULL in column definition == | == NULL in column definition == | ||
Revision as of 14:00, 3 September 2006
Differences between implementations
NULL in column definition
This table is originally from "Building Truly Portable Database Applications in PHP": NULL
| Database | Default value | Definition allowed | Notes |
|---|---|---|---|
| Firebird | NULL | no | |
| MySQL | NULL | yes | |
| Oracle | NULL | yes | Empty strings considered NULL |
| PostgreSQL | NULL | yes | |
| SQL Server | NOT NULL | yes | |
| SQLite | NULL | yes | |
| Sybase ASE | NOT NULL | yes |
The "Definition allowed" column indicates if specifying NULL in table column definitions is allowed for CREATE TABLE statements - NOT NULL is always allowed. If "yes", the following statement doesn't generate an error:
CREATE TABLE mytable ( id INTEGER NULL )