Basic HTML version of Foils prepared 7 October 97

Foil 36 Datatypes in Oracle -I

From Untitled presentation ARL Database Tutorial -- February 98. by Gang Cheng, C.W. Ou, Geoffrey C. Fox


1 CHAR - stores fixed length character strings. 1 - 255 chars
  • When a row is inserted into or updated in the table, the value for the CHAR column has a fixed length
  • If a shorter value is given, the value is blank-padded to the fixed length
  • If a longer value with trailing blanks is given, blanks are trimmed from the value to the fixed length
  • If a value is too large, Oracle returns an error
2 VARCHAR2 - stores variable-length character strings. 1 - 2000 chars
  • For example, assume a column is declared VARCHAR2 with a maximum size of 50. If only 10 chars are given for the column in a particular row, the column in the row's row piece only stores the 10 chars (10 bytes), not 50
3 CHAR and VARCHAR2 have different comparison semantics in string comparisons

in Table To:


© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Tue Jan 27 1998