Search notes:

ORA-00984: column not allowed here

create or replace function tq84_fnc return number as begin
   return 42;
end tq84_fnc;
/
create table tq84_tab (num number, txt varchar(42));
Insert a record into tq84_tab:
insert into tq84_tab values(tq84_fnc, 'hello world');
drop function tq84_fnc;
tq84_fnc is not recognized as an identifier, Oracle throws ORA-00984: column not allowed here:
insert into tq84_tab values(tq84_fnc, 'hello world');
Cleaning up:
drop table tq84_tab;

SQLERRM and SQLCODE

The two «functions» sqlerrm and sqlcode cannot be used in SQL statements.
The insert statement in the exception handler throws an ORA-00984.
create table tq84_log(
   ts  timestamp default systimestamp,
   txt clob
);
 
declare
   num integer;
-- err varchar2(512);
begin
   select 0/0 into num from dual;
   insert into tq84_log(txt) values ('num = ' || num);
   commit;
  
exception when others then
   insert into tq84_log(txt) values ('error: ' || sqlerrm);
 
-- err := sqlerrm;
-- insert into tq84_log(txt) values ('error: ' || err);
 
   commit;
end;
/
If sqlerrm needs to be logged, it needs to be assigned to a variable first (as shown in the commented code above).

See also

This error message in a SQL model clause.
Other Oracle error messages

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1758207689, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/databases/Oracle/errors/ORA-00984_column-not-allowed-here(92): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78