I use Oracle Database 11g and I have a fairly simple code:
set serveroutput on format wrapped;
declare
result_ clob;
begin
result_ := dbms_random.string('P', 10);
dbms_output.put_line(result_);
end;
When I try to run it gives me an error saying:
identifier 'DBMS_RANDOM' must be declared
Why dbms_random is not recognized as a valid identifier? Do I have to import it?
Probably this is a permissions problem. EXECUTE on DBMS_RANDOM is not granted by default, so you need a DBA user to grant you the EXECUTE privilege.
grant execute on dbms_random to << your_username >>;
There is an outside chance the package is not installed, although installation is the default. Again, you need a DBA user to check, and if need be run the installation script.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With