Last active
January 25, 2023 12:57
-
-
Save oraculix/9f4d58ea0c042aec1dc65e516901f7e1 to your computer and use it in GitHub Desktop.
Regular expression search in Oracle PL/SQL source code
This file contains hidden or 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
-- Find first occurence of NEXTVAL case-insensitive and deliver the line of occurrence and the lines around it. | |
WITH found AS ( | |
SELECT owner, name, type, line FROM all_source | |
WHERE owner = 'GSMADMIN_INTERNAL' | |
AND regexp_instr(text, 'NEXTVAL',1,1,0,'i') > 0 | |
) | |
SELECT a.* | |
FROM all_source a, found | |
WHERE a.owner = found.owner | |
AND a.name = found.name | |
AND a.type = found.type | |
AND a.line BETWEEN found.line-1 AND found.line+1 | |
; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment