Search Results lz_uncompress
Overview
SYS.UTL_COMPRESS is an Oracle-supplied PL/SQL package that provides Data Compression Utilities within the database kernel. In Oracle EBS 12.1.1 and 12.2.2, this package serves as the foundational compression engine available to application code, allowing EBS PL/SQL programs to reduce the physical size of binary data before it is stored, transmitted, or archived. The package implements a basic form of the Lempel-Ziv (LZ) compression algorithm and is exposed to the E-Business Suite application schema (APPS) through public synonyms and standard grants. Within EBS, its primary business function is to enable efficient handling of large binary payloads — typically BLOB and RAW data such as attachments, XML documents, CLOB-to-BLOB conversions, or outbound interface files — without requiring external compression tools or operating system utilities. ETRM classifies the object as an OTHER API, reflecting that it is not an EBS business API but a generic database utility that EBS code may call indirectly.
Key Procedures and Functions
The package documents seventeen procedures and functions. The primary interfaces are:
- LZ_COMPRESS — Compresses input data and returns the compressed result. Two overloads are documented: one accepting RAW source data and returning RAW, and one accepting BLOB source data and returning a BLOB. A third overload compresses a source BLOB into an existing destination BLOB, overwriting its original contents.
- LZ_UNCOMPRESS — The inverse operation, restoring previously compressed data to its original form.
- LZ_COMPRESS_OPEN — Initializes a compression context or handle for piecewise (streaming) compression of data supplied in multiple chunks, subject to the package constant UTLCOMP_MAX_HANDLE of 5.
- LZ_COMPRESS_ADD — Adds an incremental chunk of source data to an open compression handle.
- LZ_COMPRESS_CLOSE — Finalizes a piecewise compression operation and releases the handle.
- LZ_UNCOMPRESS_OPEN — Opens an uncompression context for streaming decompression.
- LZ_UNCOMPRESS_EXTRACT — Extracts the next decompressed portion of data from an open context.
- LZ_UNCOMPRESS_CLOSE — Closes an uncompression context and releases associated resources.
- ISOPEN — Reports whether a given compression or uncompression handle is currently open.
The package also declares five user-defined exceptions: invalid_handle, invalid_argument, buffer_too_small, data_error, and stream_error, each bound via PRAGMA EXCEPTION_INIT to Oracle error codes -29299, -29261, -29297, -29294, and -29293 respectively. The invalid_argument exception (ORA-29261) is raised when a caller supplies a parameter value outside the accepted range — most commonly a compression quality argument outside the valid 1..9 range, where 1 represents fastest compression and 9 the slowest but most compact output, with a default of 6. The matching constant invalid_argument_errcode exposes the same -29261 value for programmatic comparison.
Tables Accessed
ETRM documents no tables referenced directly by SYS.UTL_COMPRESS via APPS synonyms. The package operates entirely in memory on RAW and BLOB values passed by the caller, so it does not persist data itself; any storage of compressed output is the responsibility of the invoking program. Compression state for the piecewise interfaces is maintained internally in package state rather than in database tables.
Usage Notes
In Oracle EBS, UTL_COMPRESS is not exposed as a standalone concurrent program or form; it is invoked programmatically by custom PL/SQL, interface programs, or other packages — ETRM records that it is referenced by one other package. Typical invocations include compressing LOB data before insertion into EBS attachment or staging tables, compressing outbound XML or flat-file payloads for FTP transport, and shrinking archived interface data. The piecewise (_OPEN, _ADD, _EXTRACT, _CLOSE) interfaces are preferred when handling data larger than the PL/SQL limit or when memory confinement is required, and ISOPEN should be checked before reuse of a handle. Because only five handles are available per session, handles must be closed promptly to avoid invalid_handle errors. Callers should also validate the quality argument before invocation to prevent ORA-29261, and should trap buffer_too_small and data_error when decompressing untrusted input.
-
PACKAGE: SYS.UTL_COMPRESS
12.1.1
-
PACKAGE: SYS.UTL_COMPRESS
12.2.2