
How to Compress Data in Pieces with UTL_COMPRESS.LZ_COMPRESS_ADD
Build a compressed BLOB row by row as data is read, without holding all of it uncompressed in one variable first.
PL/SQL (Procedural Language for SQL) is Oracle's proprietary extension to standard SQL. It combines the data manipulation power of SQL with the procedural capabilities of a programming language. PL/SQL allows developers to write complex database-centric applications by incorporating variables, conditions, loops, error handling, and modular programming constructs like procedures and functions. This language is tightly integrated with Oracle databases, enabling efficient data processing and transaction management.

Build a compressed BLOB row by row as data is read, without holding all of it uncompressed in one variable first.

Shrink text-like BLOB and RAW data to a fraction of its size in gzip format, and see what is not worth compressing.

Read Oracle error messages in other languages and build your own messages from templates with %s and %d placeholders.

Find close matches for misspelled names and places with edit distance and Jaro-Winkler similarity scores.

Make text safe for HTML and XML, turn references back into characters, validate encodings, and look up locale data.

Turn text and binary data into Base64 for JSON, XML, and e-mail, including a BLOB encoded in pieces as a data URI.

Turn text bytes from one character set into another, such as UTF-8 into Latin-1, and see what happens to characters that do not fit.

Turn PL/SQL numbers into the bytes binary formats use, in big-endian or little-endian order, and read them back.

Handle RAW values byte by byte, and store and test yes-or-no flags in single bytes with AND, OR, XOR, and NOT.

Insert, delete, replace, and move text in the middle of a SecureFile LOB without rewriting everything after it.

Save a large text value to a file on the database server in one call, such as a CSV export built with LISTAGG.

Encode CLOB text into BLOB bytes in the character set you choose, decode it back, and catch characters that do not convert.

Copy text and binary files from the database server into CLOB and BLOB values, with character set conversion for text.

Build large text and binary values in PL/SQL with temporary LOBs: create, write, append, read, copy, trim, and free them.

Turn a DBMS_SQL cursor into a ref cursor to return it, or a ref cursor into a DBMS_SQL cursor to describe its columns.

Fetch the rows of a dynamic query in batches into collections, the DBMS_SQL way of doing BULK COLLECT with a LIMIT.

Bind collections to placeholders in dynamic SQL so one execution inserts or updates a row for every element.

Learn the names, types, and nullability of a query's columns at run time, and write PL/SQL that prints any query.