Skip to content

Commit 2a431b0

Browse files
committed
Merge pull request bizoo#16 from mleonard87/better-schema-prefix-support
Better schema prefix support
2 parents 745637d + d6383a1 commit 2a431b0

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

RunSQL.sql

+6-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,12 @@ SET FEEDBACK OFF
55
@&1
66
SELECT 'Filename: &1' FROM DUAL;
77
SELECT '(' || TYPE || ' ' || NAME || '/0:' || POSITION || ')' || ' ' || LINE || ':' || POSITION || ' ' || TEXT as ERRORS
8-
FROM USER_ERRORS
8+
FROM ALL_ERRORS
99
WHERE line <> 0
10-
AND TYPE || ' ' || NAME in (&2)
10+
AND (
11+
TYPE || ' ' || OWNER || '.' || NAME in (&2)
12+
OR
13+
(OWNER = USER AND TYPE || ' ' || NAME in (&2))
14+
)
1115
ORDER BY NAME, TYPE, SEQUENCE;
1216
exit

oracle_lib.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ def find_entities(view):
66
Return all 'create or replace' type and name in the script.
77
"""
88
results = []
9-
positions = view.find_all(r'(?im)create\s+(?:or\s+replace\s+)?(?:force\s+)?(package(?:\s+body)?|procedure|function|trigger|view|type)\s+(\w+\.)?(\w+)', 0, "$1 $3", results)
9+
positions = view.find_all(r'(?im)create\s+(?:or\s+replace\s+)?(?:force\s+)?(package(?:\s+body)?|procedure|function|trigger|view|type)\s+(\w+\.)?(\w+)', 0, "$1 $2$3", results)
1010
return dict((val.upper(), view.rowcol(pos.begin())[0]) for (pos, val) in zip(positions, results))
1111

1212

0 commit comments

Comments
 (0)