Skip to content

A Quick Report needs a random value, but calling `DBMS_RANDOM.VALUE` in Quick Report SQL is rejected with 'Forbidden PLSQL code rejected: DBMS_RANDOM.' Is there an alternate way to get a random-ish value in a Quick Report?

Answer

DBMS_RANDOM is specifically blocked in Quick Report SQL, since Quick Report SQL restricts which PL/SQL packages/functions can be called for security reasons. As a pseudo-random alternative that IS allowed, use REGEXP_SUBSTR(SYS_GUID(), '\d') to extract a pseudo-random single digit from a freshly generated GUID value — not cryptographically random, but simple to implement and sufficient for many practical Quick Report use cases that just need some variability rather than genuine randomness.

← Browse Reporting and analytics questions