David Mitchell wrote:
> I found some unexpected results with ODBC and ran a simple test.  Based
> on the results of the test, it looks like varchar storage, at least a
> currently used with MS Access ODBC and J, does not remove padding spaces.
> 
> The test created two Access databases each with one table with one
> varchar column.  I inserted 10000 text vectors in each database, the
> ones in the first database were 7 characters long, the vectors for the
> second were padded with spaces to length 255.  The first database was
> 324K on disk, the second was 5796K.
> 
> As far as I can tell, the same thing happens with ddins.
> 
> Is there an option to have ODBC or J remove the padding spaces?

I'm not sure if ansi sql set rules for storage of padding spaces, but I guess it
is implementation dependent.  iirc padding space may be stored as RLE (run
length encoding) in some database. As a comparison I run you test on firebird
2.0, the two database were both 1208KB.

one possibility is to use rtrim function to trim out padding spaces, but will it
save storage space or not may depend on database.

btw, it may run faster if starting transaction for each handle before running
the loop in verb fee.

-- 
regards,
bill
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to