Quantcast
Channel: Andrew's Oracle Blog
Viewing all articles
Browse latest Browse all 330

Default Size of a CHAR Column

$
0
0
If you do not specify a size for a CHAR column, the default is 1. You can see what I mean in the example below, which I tested on Oracle 11.2:

SQL> create table t1
  2  (c1 char,
  3   c2 char(1))
  4  /
 
Table created.
 
SQL> desc t1
Name                       Null?    Type
-------------------------- -------- ------------------
C1                                  CHAR(1)
C2                                  CHAR(1)
 
SQL> 

However, if you rely on defaults like this and the software supplier changes them, you could be left with an application which does not work. 

Viewing all articles
Browse latest Browse all 330

Trending Articles