Skip to content

Commit

Permalink
Add the OBJECT_NAME column to both db-objects SQLs (#457)
Browse files Browse the repository at this point in the history
- add ObjectName to db_objects
- add ObjectName to db-objects-synonym-public
  • Loading branch information
misolt authored Jul 1, 2024
1 parent d09753e commit 8522d61
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ SELECT
'PUBLIC' "Owner",
'SYNONYM' "ObjectType",
B.editionable "Editionable",
B.object_name "ObjectName",
-- This looks similar to filtering with WHERE and using count() instead of sum().
--
-- It is not similar. DB will see the LIKE inside a WHERE predicate and decide to
Expand Down Expand Up @@ -49,4 +50,7 @@ LEFT JOIN (
AND B.con_id = D.con_id
WHERE D.table_owner IS NULL
AND B.owner = 'PUBLIC'
GROUP BY B.con_id, B.editionable
GROUP BY
B.con_id,
B.editionable,
B.object_name
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
SELECT
A.con_id "ConId",
A.owner "Owner",
A.object_name "ObjectName",
A.object_type "ObjectType",
A.editionable "Editionable",
count(1) "Count"
Expand All @@ -24,12 +25,14 @@ WHERE A.owner NOT LIKE '%SYS'
GROUP BY
A.con_id,
A.owner,
A.object_name,
A.object_type,
A.editionable
UNION ALL (
SELECT
B.con_id "ConId",
'SYS' "Owner",
B.object_name "ObjectName",
'DIRECTORY' "ObjectType",
B.editionable "Editionable",
count(1) "Count"
Expand All @@ -40,13 +43,15 @@ UNION ALL (
GROUP BY
B.con_id,
B.owner,
B.object_name,
B.object_type,
B.editionable
)
UNION ALL (
SELECT
C.con_id "ConId",
C.owner "Owner",
C.object_name "ObjectName",
C.object_type "ObjectType",
C.editionable "Editionable",
count(1) "Count"
Expand All @@ -59,5 +64,6 @@ UNION ALL (
C.con_id,
C.owner,
C.editionable,
C.object_name,
C.object_type
)

0 comments on commit 8522d61

Please sign in to comment.