Skip to content

Instantly share code, notes, and snippets.

@mortenbra
Created March 18, 2017 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mortenbra/3204a125e3da1008e19b36bf94586950 to your computer and use it in GitHub Desktop.
Save mortenbra/3204a125e3da1008e19b36bf94586950 to your computer and use it in GitHub Desktop.
Show errors from user_errors, formatted for easy parsing
set pagesize 9999
set linesize 9999
set heading off
set trim on
select lower(attribute) -- error or warning
|| ' '
|| line || '/' || position -- line and column
|| ' '
|| lower(name) -- file name
|| case -- file extension
when type = 'PACKAGE' then '.pks'
when type = 'PACKAGE BODY' then '.pkb'
else '.sql'
end
|| ' '
|| replace(text, chr(10), ' ') -- remove line breaks from error text
as user_errors
from user_errors
where attribute in ('ERROR', 'WARNING')
order by type, name, line, position;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment