Re: Do I need to create a field type LONG?

From: Sharkie <sharkdba_at_yahoo.com>
Date: 7 May 2004 13:48:30 -0700
Message-ID: <423b5ab1.0405071248.10c736a1_at_posting.google.com>


galkas_at_mail.ru (Galina) wrote in message news:<ecdc865.0405052359.1dd8e62b_at_posting.google.com>...
> Hi Jim
> Thank you for your answer. Of course, it should be this way. Any
> respectable database stores strings allocating disk space as much as
> necessary and not more.

That's why it's called varchar ==> variable character length. char data type on the other hand will pad your string up to specified length, see example:

SQL> create table temp (varname varchar2(20), fixname char(20)); Table created.

SQL> insert into temp values ('short string', 'short string'); 1 row created.

SQL> insert into temp values ('longer string', 'longer string'); 1 row created.

SQL> select '|'||varname||'|' "varname" from temp;

varname



|short string|
|longer string|

SQL> select '|'||fixname||'|' "fixname" from temp;

fixname


|short string        |
|longer string       |
Received on Fri May 07 2004 - 22:48:30 CEST

Original text of this message