Name

gz_compress — Compress data using gzip algorithm

Synopsis

gz_compress ( in str varchar );

Description

The gz_compress returns its argument compressed with the gzip algorithm. The argument and return values are arbitrary strings, possibly including any 8 bit characters.

Parameters

str

The string containing data to be compressed.

Return Types

A string containing the compressed data.

Examples

Example24.134.GZIP test 2

Just see how it compresses.

create procedure
gz_test_2 (in str varchar)
{
  declare res any;
  declare _out varchar;
  declare _len integer;

  result_names (_out, _len);

  res := string_output ();
  result (str, length (str));
  str := gz_compress (str);
  result ('binary', length (str));
  gz_uncompress (str, res);
  result (res, length (res));
}

SQL> gz_test_2 ('f00f f00f m0053 2 w3r h4x0r7 ch002 00000000000000000000000');
_out                      _len
VARCHAR                   INTEGER
_______________________________________________________________________________

f00f f00f m0053 5 w3r h4x0r7 ch002 00000000000000000000000  58
binary                    43
f00f f00f m0053 5 w3r h4x0r7 ch002 00000000000000000000000  58

3 Rows. -- 10 msec.
SQL>