Click to See Complete Forum and Search --> : SQL in oracle


payalsaxena1504
05-03-2006, 08:10 PM
may anybody tell me the difference between these datatypes used in SQL
char,varchar & varchar2?
thnx for help!

chazzy
05-03-2006, 08:33 PM
char is static length - if you define the column to be char(30), each entry will always use 30 spaces.

varchar/varchar2 are variable width. if you define them to be varchar/varchar2(30) then they can use at most 30 spaces, but you save the space they don't use. obviously using char is less strenuous, but varchar's save space.

a note on varchar though:


Now deprecated - VARCHAR is a synonym for VARCHAR2 but this usage may change in future versions.

payalsaxena1504
05-04-2006, 06:30 AM
thnx for yr reply,actually i was bit confused btw varchar & varchar2.