On 2019-11-13 18:42, blackfalconsoftw...@outlook.com [firebird-support] 
wrote:
> Here is the link to the definition of CHAR and VARCHAR field
> definitions from the IB-Experts site...
> 
> 
>  https://www.ibexpert.net/ibe/index.php?n=Doc.CHAR
> https://www.ibexpert.net/ibe/index.php?n=Doc.CHAR

>  In neither the CHAR or VARCHAR definitions is it noted that unused
> space is filled with nulls or blank data as both are stored as
> variable length fields internally within a table.

That is incorrect. A CHAR will be stored blank-padded (space for normal 
character sets, 0x00 for octets), while a VARCHAR will be stored 0x00 
padded. However, due to a RLE (Run Lenght Encoding) applied, that padded 
will be stored 'compressed'.

> However, the CHAR
> data type, as would be expected, can only store as a maximum, the
> number of characters that its original definition set forth.  The
> VARCHAR field can hold up to over 32,000+ bytes of data.

That is incorrect. Both a VARCHAR(n) and a CHAR(n) will allow storing a 
maximum of n characters, the only difference is that the value (as seen 
by the consumer) of a CHAR(n) is right-padded with spaces, while a 
VARCHAR(n) is not padded.

Mark
  • Re: [firebird-sup... Clyde Eisenbeis cte...@gmail.com [firebird-support]
  • Re: [firebird-sup... blackfalconsoftw...@outlook.com [firebird-support]
    • Re: [firebir... Dimitry Sibiryakov s...@ibphoenix.com [firebird-support]
      • [firebir... blackfalconsoftw...@outlook.com [firebird-support]
        • Re: ... Dimitry Sibiryakov s...@ibphoenix.com [firebird-support]
          • ... blackfalconsoftw...@outlook.com [firebird-support]
          • ... Dimitry Sibiryakov s...@ibphoenix.com [firebird-support]
          • ... blackfalconsoftw...@outlook.com [firebird-support]
          • ... Dimitry Sibiryakov s...@ibphoenix.com [firebird-support]
          • ... Mark Rotteveel m...@lawinegevaar.nl [firebird-support]
          • ... blackfalconsoftw...@outlook.com [firebird-support]
          • ... Dimitry Sibiryakov s...@ibphoenix.com [firebird-support]
          • ... blackfalconsoftw...@outlook.com [firebird-support]
          • ... Dimitry Sibiryakov s...@ibphoenix.com [firebird-support]
          • ... Mark Rotteveel m...@lawinegevaar.nl [firebird-support]
          • ... Dimitry Sibiryakov s...@ibphoenix.com [firebird-support]
          • ... Dimitry Sibiryakov s...@ibphoenix.com [firebird-support]
          • ... Clyde Eisenbeis cte...@gmail.com [firebird-support]
          • ... Dimitry Sibiryakov s...@ibphoenix.com [firebird-support]
          • ... Mark Rotteveel m...@lawinegevaar.nl [firebird-support]

Reply via email to