Re: Writing bzcompressed data into SQL-DB?

From: Michael Austin (maustin_at_firstdbasource.com)
Date: 08/21/04


Date: Sat, 21 Aug 2004 14:26:01 GMT

Oliver Spiesshofer wrote:

> Hi,
>
> when compressing strings with bzcompress, I have the problem that the
> result apparently often contains 'letters' that mess up sql statements.
>
> Of course I can urlencode the string, but that wont keep it as small.
> What would be the best way to send a bzcompressed string to a SQL
> statement? is it possible at all without urlencode?
>
> thanks
>
> Oliver
>

Unless it is a password where the data is short enough or the data is NEVER used
in a select statement (using LIKE '%some text%' I would advise to NOT compress
the data. REtreiving the data or selecting on the data will cause a performance
hit you may not want to experience.

As long as the data is enclosed in single-quotes and you can guarantee that the
compressed data won't use single-qoutes, then you shouldn't have any problem.
If you urlencode your data you have another degree of obfuscation that will
translate into performance degradation.

Writing a web app based on testing one single connection is a problem waiting to
happen. Don't code with the mis-conception that if it works for one query it
will work for thousands per hour...

-- 
Michael Austin.
Consultant - Not Available.
Donations still welcomed. http://www.firstdbasource.com/donations.html
:)


Relevant Pages

  • Writing bzcompressed data into SQL-DB?
    ... when compressing strings with bzcompress, I have the problem that the ... result apparently often contains 'letters' that mess up sql statements. ... Of course I can urlencode the string, but that wont keep it as small. ...
    (comp.lang.php)
  • Re: How to write long string sentences
    ... Do you want to manage long SQL statements or do you want to manage long ... trying to manipulate the SQL statement as a string. ... I still question if you are wanting long string manipulation or simply ... If for some reason you don't want to use Visual Designers for managing your ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Big Strings
    ... I have also found compressors that work with streams, ... >also compressing these large blocks nicely. ... IMO ShortStrings are dangerous little legacy things ... That can point into a 'file' and give you access to a 'string' stored ...
    (alt.comp.lang.borland-delphi)
  • Re: OT but maybe interesting-compression schemes?
    ... >> loss is to number long strings of ones and zeros. ... >> or zeros are required to describe a string of 1024 ones and zeros. ... >> Who could use a little compressing around the middle. ...
    (rec.crafts.metalworking)
  • Re: OT but maybe interesting-compression schemes?
    ... >>> loss is to number long strings of ones and zeros. ... >>> or zeros are required to describe a string of 1024 ones and zeros. ... >>> Who could use a little compressing around the middle. ...
    (rec.crafts.metalworking)