Skip to content

Instantly share code, notes, and snippets.

@mathiasmag
Created February 23, 2018 20:14
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 mathiasmag/588143fb9b98f352b99887d8de8d6ef4 to your computer and use it in GitHub Desktop.
Save mathiasmag/588143fb9b98f352b99887d8de8d6ef4 to your computer and use it in GitHub Desktop.
Used in a VisualCode task building PL/SQL to show all errors in the schema code has been "compiled"
-- Origin: https://ora-00001.blogspot.se/2017/03/using-vs-code-for-plsql-development.html
-- https://gist.github.com/mortenbra/3204a125e3da1008e19b36bf94586950#file-vscode_show_errors-sql
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