| Firebird Docset → Firebird Database Docs → Firebird Null Guide → Setting a field or variable to NULL |
![]() |
Fields and variables can be set to NULL using the same syntax as for regular values:
insert into MyTable values (1, 'teststring', NULL, '8-May-2004')
update MyTable set MyField = null where YourField = -1
if (Number = 0) then MyVariable = null;
- “Wait a minute... and you said that MyField = NULL was illegal!”
That's right... for the comparison operator “=” (at least in pre-2.0 versions of Firebird). But here we are talking about “=” as an assignment operator. Unfortunately, both operators have the same symbol in SQL. In assignments, whether done with “=” or with an insert list, you can treat NULL just like any value - no special syntax needed (or indeed possible).
| Firebird Docset → Firebird Database Docs → Firebird Null Guide → Setting a field or variable to NULL |