Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 6 of 6 total
Thread varchar length
Sat, May 29 2010 3:03 PMPermanent Link

Jim Meehan

Hi

why do you need to specify a LENGTH for a VARCHAR

Since a VARCHAR has a variable length by definition,
it seems superfluous to need to specify the LENGTH

Jim
Sun, May 30 2010 3:19 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Jim

>why do you need to specify a LENGTH for a VARCHAR
>
>Since a VARCHAR has a variable length by definition,
>it seems superfluous to need to specify the LENGTH

Think of it as a maximum for which provision will be made in the table. The actual data can be shorter but not longer. If you want "real" VARCHARs use a CLOB Smiley

Roy Lambert [Team Elevate]
Sun, May 30 2010 5:31 PMPermanent Link

Rita Tipton

Varchae does not store any blank characters, reducing the size of a database
when the full length of the field is not used, although the length of the
used size is stored, adding a small overhead.

HTH
Rita

<Jim Meehan> wrote in message
news:DF019906-BA11-470A-90F8-46A8A2B2A9BA@news.elevatesoft.com...
> Hi
>
> why do you need to specify a LENGTH for a VARCHAR
>
> Since a VARCHAR has a variable length by definition,
> it seems superfluous to need to specify the LENGTH
>
> Jim
>

Mon, May 31 2010 3:23 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Rita


>Varchae does not store any blank characters, reducing the size of a database
>when the full length of the field is not used, although the length of the
>used size is stored, adding a small overhead.

That might be the case in some db systems, but I don't think it is in either DBISAM or ElevateDB. Tim has quite often been asked for a "real" varchar.

Roy Lambert [Team Elevate]
Tue, Jun 1 2010 3:25 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Roy,

<< That might be the case in some db systems, but I don't think it is in
either DBISAM or ElevateDB. Tim has quite often been asked for a "real"
varchar. >>

CLOBs are "real" VARCHARS.  In fact, I could simply call CLOBs VARCHARS,
permit a length up to High(Integer), and be done with it, and no one would
ever know the difference, except for the issue of indexing. Smiley

If you want to index a CLOB, then create a COMPUTED column that extracts the
portion of the CLOB that you want to index, and then index the COMPUTED
column instead.

--
Tim Young
Elevate Software
www.elevatesoft.com
Wed, Jun 2 2010 2:16 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Tim

>CLOBs are "real" VARCHARS. In fact, I could simply call CLOBs VARCHARS,
>permit a length up to High(Integer), and be done with it, and no one would
>ever know the difference, except for the issue of indexing. Smiley

I knew that - see the post in reply to Jim.

>If you want to index a CLOB, then create a COMPUTED column that extracts the
>portion of the CLOB that you want to index, and then index the COMPUTED
>column instead.

That I hadn't thought of - my thinking of indexing on CLOBs is limited to full text Smiley

Roy Lambert
Image