ORA_SERVER_ERROR_MSG returns an error message text as a VARCHAR2 datatype.
SQL> SQL> SQL> DECLARE 2 error VARCHAR2(64); 3 BEGIN 4 FOR i IN 1..ora_server_error_depth LOOP 5 error := ora_server_error_msg(i); 6 dbms_output.put_line('error:'||error); 7 END LOOP; 8 END; 9 / PL/SQL procedure successfully completed. SQL> SQL>