Question: In this below example why other than "NAME1" all giving null as result in oracle 11g.

If I mention space explicitly it takes space otherwise null only not empty string.Please help me to clarify this.

In NAME2 I specify the empty space but still it gives null.

```
select 
NVL(NAME,' ') AS NAME1,
NVL(NAME,'') AS NAME2,
NVL(NAME,NULL) AS NAME3,
NAME AS NAME4 
from employee

```

**OUTPUT :**

(space),null,null,null

Answer: 
Because in Oracle a ZERO length varchar is treated as NULL.

In your example 

```
NVL(NAME, ' ') AS NAME1 will evaluate to either NAME or ' ' - empty string.
NVL(NAME, '') as NAME2 will evaluate to either NAME or a zero length string

```
Because '' is equal with null in oracle. For example these two queries are same:

```
update  test set name=''  where id = 15
update  test set name=null   where id = 15

```