What is the Difference between varchar and varchar2 in SQL. Please explain in detail with some good example.
+3
A:
Varchar2 is specific to Oracle.
The most significant nonstandard behavior of varchar2 is that an empty string ('') is the same as null.
In standard SQL, null is not the same as any string literal, not even the empty string.
Bill Karwin
2010-10-14 17:37:18
+1 Probably worth mentioning that in Oracle, a condition testing whether `Field = ''` always evaluates as NULL (ie. never true), even if `Field` is '' (ie. NULL).
Mark Bannister
2010-10-15 11:40:19
@Mark: Thanks, that's a good point. Whereas in standard SQL, `Field = ''` can be true.
Bill Karwin
2010-10-15 17:09:19