Help with VARCHAR needed

Chris Sharman chris.sharman@ccagroup.co.uk
Tue, 25 Mar 2003 15:55:22 +0000


Edis, Robert wrote:
> As Quiz is meant to provide formatted output, especially to a printer, I
> would not expect what you see to be anything less than either the size of
> the longest value or the max potential size of the field.

Yes.

> Generally VARCHAR is used to A) conserve storage space as the actual amount
> used will be the length of the value plus 1 byte and B) for better data
> comparison as you don't need to worry about trailing blanks.

2 byte length (on VMS) actually.
I'd be surprised if it conserves storage space: the 'normal' 
implementation is to allocate the maximum permanently. It's possible 
that PH deallocates & reallocates heap every time the length changes, 
but I doubt it.

> The big difference between outputting a CHAR vs. VARCHAR will occur in a
> subfile.  I expect a CHAR will be right padded with spaces to the size of
> the field whereas VARCHAR will not thereby reducing the overall size of the
> subfile.

Subfiles are always fixed length (VMS), with fields at fixed positions.
Again, I'd be very surprised if that's not the case across all 
platforms. That sort of variable union is hard to handle in most languages.



-----------------------------------------------------------------------

Any views expressed in this message are those of the sender and not
necessarily those of CCA Group.  The unauthorized use, disclosure,
copying or alteration of this message is forbidden.  The contents of
this message may be confidential and/or privileged, copyright CCA Group
and are intended solely for the use of the individual or entity to whom
they are addressed.  Whilst this message has been scanned, CCA Group
cannot guarantee that it is virus free or compatible with your systems
and accepts no responsibility for any loss or damage arising from its
use. The recipient is advised to run their own anti-virus software. If
you receive this message in error please contact
postmaster@ccagroup.co.uk immediately, destroy any copies and delete it
from your computer systems.