
How to Cast Numbers to RAW with UTL_RAW
Turn PL/SQL numbers into the bytes binary formats use, in big-endian or little-endian order, and read them back.
Posts tagged AI-Assisted are created with support from artificial intelligence. I use AI tools to research, draft, and refine ideas—combining human insight with machine precision to deliver clear, informed, and creative content.

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.

Get the columns, keys, indexes, and statistics of a table, index, or view as one JSON document in Oracle AI Database 26ai.

Split a ROWID into its object, file, block, and row number to see where rows are stored, including in bigfile tablespaces.

Turn PL/SQL compiler warnings on, off, or into errors from code, read the current setting, and restore it afterward.

Print the source the PL/SQL compiler actually sees after conditional compilation, for stored units or source text.

Find out the parameters, types, modes, defaults, and overloads of any procedure or function at run time.

Read the database version and release as PL/SQL constants, and use them to compile the right code for each release.

Create random numbers, strings, and test rows, shuffle query results, and get repeatable sequences with a seed.