News for hackers. Stuff that matters.
Re:Null Values in SQL Queries by ak39 on Monday February 03, 2020 @09:57AM (#22224642)
AFAIK, this Oracle "feature" is only true for columns marked as "not nullable". So if you attempt to insert an empty sting ("") into a not-nullable column, it will fail.

All other relational databases differentiate between empty strings and NULL.

Re:Null Values in SQL Queries by Sean1708 on Monday February 03, 2020 @10:58AM (#22225284)
Nah, it's true for all columns:

  SQL*Plus: Release 11.2.0.4.0 Production on Mon Feb 3 15:56:30 2020
  
  Copyright (c) 1982, 2013, Oracle.  All rights reserved.
  
  
  Connected to:
  Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production
  
  SQL> create table foo(fook varchar2(10) not null);
  
  Table created.
  
  SQL> insert into foo values ('');
  insert into foo values ('')
                          *
  ERROR at line 1:
  ORA-01400: cannot insert NULL into ("SPORTSBOOK_DOCK"."FOO"."FOOK")
  
  
  SQL> create table bar(bark varchar2(10));
  
  Table created.
  
  SQL> insert into bar values ('');
  
  1 row created.
  
  SQL> insert into bar values ('a');
  
  1 row created.
  
  SQL> insert into bar values (null);
  
  1 row created.
  
  SQL> select * from bar;
  
  BARK
  ----------
  
  a
  
  
  SQL> select * from bar where bark = '';
  
  no rows selected
Re:Null Values in SQL Queries by shawnz on Monday February 03, 2020 @10:23AM (#22224898)
It is also true for nullable columns.
Re:Null Values in SQL Queries by thenewnewguy on Monday February 03, 2020 @06:15PM (#22230442)
> if you attempt to insert an empty sting ("") into a not-nullable column, it will fail

Yes, because it will convert the empty string into a NULL, and fail to insert that NULL into a non-NULLable column.