Created
February 23, 2018 20:14
-
-
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"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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