Skip to Main Content
Ted Struik - Oracle
Search For
Home
Home
Ted Struik - Oracle
Search
Site Map
Statistics
Page Errors
Apex
Apex
General
Autocomplete
Conditions
Errors
Items used in PL/SQL
Validations
Dynamic Actions
Logs
Version
App-wide Items
Error Handling
Apex Views
Apex Upgrade 4.2 to 5.1
Apex Upgrade 20.2 to 23.1
Database Dependencies
Show Source Code
URLs
Authorization
Modal Dialogs
Apex Office Print (AOP)
Apex-Sert
Warn on Unsaved Changes
Form Regions
Reports
Checkboxes
Download
Errors
Nowrap Columns
Substitution Strings
Use IR results in pl/sql
Clickable Row
Row Highlight
Translate Filters etc.
Bar Charts
Column Usage
Reset Pagination
Hide IR Actions menu items
Get Classic Report query
Interactive Grid
ORA-20987
ERR-1002
Copying Text
IG Info
Multiple Row Select
Read Only Options
Search
Sort and Search
Images & Fonts
Standard Icons & Fonts
WebDav
Font Awesome
Icons/image popup LOV
Lists
Hierarchy
LOVs
Definition Bug
Set 1-item LOV to Disabled
With Clause Errors
Modal LOV Plugin
HTML / CSS / JavaScript
Vertical Align
Legend CSS
Geolocation
Apex.confirm
Pie Charts
Codemirror
Theme Roller
Catching Key Strokes
Browser Cache
Locale
RequireJS
Collapsible Regions
Find JavaScript
Import / Export
Dynamic Translations
Translated Pages
APEXExport (java)
apex_export (pl/sql)
Component Settings
Charts
Translate Charts
[Reports] Bar Charts
Shuttles
Shuttle Sorting
Disable Shuttle Items
Menus
Accordion-Like
Scroll bug
Authorization
Session State
About Session State
Rollback & Commit
Performance of v()
Apex Clone Session
Request
Session State in Views
Collections
ORA-20101 & ORA-20104
ORA-00001
Max Row Count
(PL)SQL
(PL)SQL
External Tables
SQL Plus
Conditions
Long
ORDImage
Date & Timestamp
CGI environment
Sys_context
Rounding percentages
Apex_string.split in SQL
Dbms_metadata
Instr
Regular Expressions
Rollback to Savepoint
Use table aliases
(Pipelined) Bulk Collect
JSON
Source Code Search (PL/SQL)
Source Code Search (SQL)
Format Models
Pipelined Table Functions
Hint no_unnest
Listagg
DBA
DBA
Backup & Restore
Users
Export & Import
DBMS Jobs
Tablespaces
Table Size
Flush cache
Access Control List (ACL)
Locks
Java
Constraints
Object Dependencies
Package Dependencies 1
Package Dependencies 2
Grants
SQL History
Startup Errors
ORDS
Miscellaneous
Miscellaneous
Holidays
E-mail
NLExtract
Windows
VPN
VMware
Links
Google
Visualization Orgchart
Hide Search Results
Reverse Proxy
To-do List
Cytoscape
Graphics
Upscaling
Amazon Prices
Domoticz
DDoS
Hobbies
Hobbies
Motorcycles
'95 Kawasaki ZZR 600
'94 Kawasaki ZZR 1100
'91 Honda CBR 600 F2
'95 Kawasaki ZZR 1100
'99 Honda CBR 1100 XX
'00 Honda CBR 1100 XX
'02 Kawasaki ZX-12R (NL)
'05 Ducati 999 (NL)
'08 Honda Fireblade
'07 Suzuki Bandit 1250A
'18 Suzuki GSX-S 1000 F
MotoGP
Garfield
Lyrics
Skydive
Woodworking
Pantorouter
16 inch Bandsaw
Introduction
Frame
Wheels
Wheel mounts
Blade guides
Trunions and table
Enclosure
Alignment and more
Box Joint Jig
Foldable Sawhorses
Strip Sander XL
Photography
Sony RX10 IV
Yes Minister
WinAmp
Tables & Columns
Column Name
Table Name
Data Type
Comments
DISPOSITION
TEDSTRUIK.TED_MAIL_TEST_PARTS
VARCHAR2(100)
FILENAME
TEDSTRUIK.TED_MAIL_TEST_PARTS
VARCHAR2(100)
row(s) 1 - 2 of 2
Package Dependencies 1
Object Name
Object Type
Tc Table Name
Tc Mask
S Linenumbers
S Lines
TEDSTRUIK / TED_MAIL
PACKAGE BODY
TEDSTRUIK / TED_MAIL_TEST_PARTS
%disposition%
280, 283, 284, 285, 286, 287, 379, 388, 401, 418, 420, 516, 534, 574, 607, 608, 609, 610, 611, 622, 637, 638, 639, 640, 641, 663, 664, 684, 688, 698, 699, 700, 704
280: -- Content-Disposition 283: , header ( 'Content-Disposition', p_part.content_disposition 284: , 'filename' , p_part.content_disposition_filename 285: , 'size' , p_part.content_disposition_size 286: , 'creation-date' , p_part.content_disposition_cre_date 287: , 'modification-date' , p_part.content_disposition_mod_date 379: v_part_text_html.content_disposition := 'inline'; 388: if p_part_tab(i).content_disposition = 'inline' then 401: v_part_text_plain.content_disposition := 'inline'; 418: if p_part_tab(i).content_disposition = 'inline' then 420: elsif p_part_tab(i).content_disposition = 'attachment' then 516: if p_part_tab(i).content_disposition = 'inline' then 534: if p_part_tab(i).content_disposition = 'attachment' then 574: , p_disposition in varchar2 := 'attachment' -- 'attachment' or 'inline' 607: v_result.content_disposition := p_disposition; 608: v_result.content_disposition_filename := p_file_name; 609: v_result.content_disposition_size := trim( dbms_lob.getlength(p_blob_data)); 610: v_result.content_disposition_cre_date := null; 611: v_result.content_disposition_mod_date := null; 622: , p_disposition in varchar2 := 'attachment' -- 'attachment' or 'inline' 637: v_result.content_disposition := p_disposition; 638: v_result.content_disposition_filename := p_file_name; 639: v_result.content_disposition_size := trim( dbms_lob.getlength(p_blob_data)); 640: v_result.content_disposition_cre_date := null; 641: v_result.content_disposition_mod_date := null; 663: where ( t.disposition = 'inline' and upper(p_include_inline_yn) = 'Y' ) 664: or ( t.disposition = 'attachment' and upper(p_include_attachment_yn) = 'Y' ) 684: v_part_tab(c1_rec.r) := image_to_part(p_blob_data => c1_rec.data, p_content_id => c1_rec.id, p_file_name => c1_rec.filename, p_disposition => c1_rec.disposition); 688: v_part_tab(c1_rec.r) := pdf_to_part(p_blob_data => c1_rec.data, p_file_name => c1_rec.filename, p_disposition => c1_rec.disposition); 698: v_part_tab(c1_rec.r).content_disposition := c1_rec.disposition; 699: v_part_tab(c1_rec.r).content_disposition_filename := c1_rec.filename; 700: v_part_tab(c1_rec.r).content_disposition_size := dbms_lob.getlength(c1_rec.data); 704: if c1_rec.disposition = 'inline' then
TEDSTRUIK / TED_MAIL
PACKAGE BODY
TEDSTRUIK / TED_MAIL_TEST_PARTS
%filename%
203, 284, 573, 608, 638, 684, 688, 695, 699, 706
203: if p_parm_name not in ( 'filename', 'size' ) then 284: , 'filename' , p_part.content_disposition_filename 573: , p_file_type in varchar2 := null -- e.g. 'jpeg' or 'jpg' or 'gif' or 'png' (if null then extension of p_filename is used) 608: v_result.content_disposition_filename := p_file_name; 638: v_result.content_disposition_filename := p_file_name; 684: v_part_tab(c1_rec.r) := image_to_part(p_blob_data => c1_rec.data, p_content_id => c1_rec.id, p_file_name => c1_rec.filename, p_disposition => c1_rec.disposition); 688: v_part_tab(c1_rec.r) := pdf_to_part(p_blob_data => c1_rec.data, p_file_name => c1_rec.filename, p_disposition => c1_rec.disposition); 695: v_part_tab(c1_rec.r).content_type_name := c1_rec.filename; 699: v_part_tab(c1_rec.r).content_disposition_filename := c1_rec.filename; 706: || 'image: ' || c1_rec.filename || utl_tcp.crlf
TEDSTRUIK / TED_MAIL_OLD
PACKAGE BODY
TEDSTRUIK / TED_MAIL_TEST_PARTS
%disposition%
223, 226, 227, 228, 229, 230, 325, 329, 335, 337, 433, 451, 489, 522, 523, 524, 525, 526, 537, 552, 553, 554, 555, 556, 578, 579, 599, 603, 613, 614, 615, 619
223: -- Content-Disposition 226: , header ( 'Content-Disposition', p_part.content_disposition 227: , 'filename' , p_part.content_disposition_filename 228: , 'size' , p_part.content_disposition_size 229: , 'creation-date' , p_part.content_disposition_cre_date 230: , 'modification-date' , p_part.content_disposition_mod_date 325: v_part_text_plain.content_disposition := 'inline'; 329: v_part_text_html.content_disposition := 'inline'; 335: if p_part_tab(i).content_disposition = 'inline' then 337: elsif p_part_tab(i).content_disposition = 'attachment' then 433: if p_part_tab(i).content_disposition = 'inline' then 451: if p_part_tab(i).content_disposition = 'attachment' then 489: , p_disposition in varchar2 := 'attachment' -- 'attachment' or 'inline' 522: v_result.content_disposition := p_disposition; 523: v_result.content_disposition_filename := p_file_name; 524: v_result.content_disposition_size := trim( dbms_lob.getlength(p_blob_data)); 525: v_result.content_disposition_cre_date := null; 526: v_result.content_disposition_mod_date := null; 537: , p_disposition in varchar2 := 'attachment' -- 'attachment' or 'inline' 552: v_result.content_disposition := p_disposition; 553: v_result.content_disposition_filename := p_file_name; 554: v_result.content_disposition_size := trim( dbms_lob.getlength(p_blob_data)); 555: v_result.content_disposition_cre_date := null; 556: v_result.content_disposition_mod_date := null; 578: where ( t.disposition = 'inline' and upper(p_include_inline_yn) = 'Y' ) 579: or ( t.disposition = 'attachment' and upper(p_include_attachment_yn) = 'Y' ) 599: v_part_tab(c1_rec.r) := image_to_part(p_blob_data => c1_rec.data, p_content_id => c1_rec.id, p_file_name => c1_rec.filename, p_disposition => c1_rec.disposition); 603: v_part_tab(c1_rec.r) := pdf_to_part(p_blob_data => c1_rec.data, p_file_name => c1_rec.filename, p_disposition => c1_rec.disposition); 613: v_part_tab(c1_rec.r).content_disposition := c1_rec.disposition; 614: v_part_tab(c1_rec.r).content_disposition_filename := c1_rec.filename; 615: v_part_tab(c1_rec.r).content_disposition_size := dbms_lob.getlength(c1_rec.data); 619: if c1_rec.disposition = 'inline' then
TEDSTRUIK / TED_MAIL_OLD
PACKAGE BODY
TEDSTRUIK / TED_MAIL_TEST_PARTS
%filename%
146, 227, 488, 523, 553, 599, 603, 610, 614, 621
146: if p_parm_name not in ( 'filename', 'size' ) then 227: , 'filename' , p_part.content_disposition_filename 488: , p_file_type in varchar2 := null -- e.g. 'jpeg' or 'jpg' or 'gif' or 'png' (if null then extension of p_filename is used) 523: v_result.content_disposition_filename := p_file_name; 553: v_result.content_disposition_filename := p_file_name; 599: v_part_tab(c1_rec.r) := image_to_part(p_blob_data => c1_rec.data, p_content_id => c1_rec.id, p_file_name => c1_rec.filename, p_disposition => c1_rec.disposition); 603: v_part_tab(c1_rec.r) := pdf_to_part(p_blob_data => c1_rec.data, p_file_name => c1_rec.filename, p_disposition => c1_rec.disposition); 610: v_part_tab(c1_rec.r).content_type_name := c1_rec.filename; 614: v_part_tab(c1_rec.r).content_disposition_filename := c1_rec.filename; 621: || 'image: ' || c1_rec.filename || utl_tcp.crlf
1 - 4
Info
Packages and the tables & columns they reference, take 1. Click
here
for take 2.
A method to find out which packages reference which columns. It's not always perfect (because it uses text matching it tends to find too much), but I have found it to be very useful when trying to find out what impact a table/column change is likely to have.
See the package code for more details.
In this example, we're looking for packages that either reference columns named like '%employee_id%' or '%department_id%', or the 'disposition' or 'filename' columns in table 'ted_mail_test_parts'. You'll want to adjust the where clauses to your needs.
Either run this as sys/system, or give the user these privileges:
grant select on dba_dependencies to tedstruik; grant select on dba_source to tedstruik; grant select on dba_users to tedstruik; grant select on dba_col_comments to tedstruik; grant select on dba_tab_cols to tedstruik; grant select on dba_tables to tedstruik;
Code
Region
Identification
Sequence
10
Title
Tables & Columns
Type
Report
Source
Source Type
SQL_QUERY
Region Source
select tc.owner || '.' || tc.table_name as table_name , tc.column_name , tc.data_type || '(' || trim(tc.data_length) || ')' as data_type , tc.comments from table(ted_p1079.tab) tc order by 1,2
Region
Identification
Sequence
20
Title
Package Dependencies 1
Type
Report
Source
Source Type
SQL_QUERY
Region Source
select d.s_owner || ' / ' || d.s_name as object_name , d.s_type as object_type , d.tc_owner || ' / ' || d.tc_table_name as tc_table_name , d.tc_mask , d.s_linenumbers , apex_item.textarea(2,d.s_lines,5,60, 'class="codemirror-plsql"') as s_lines from table(ted_p1079.dep) d order by 1,2,3,4
Package
Package
Name
TED_P1079
Source
package ted_p1079 is type tab_rec is record ( owner varchar2( 100) , table_name varchar2( 100) , column_name varchar2( 100) , mask varchar2( 100) , data_type varchar2( 100) , data_length number , comments varchar2(4000) ) ; type tab_tab is table of tab_rec; type dep_rec is record ( s_owner varchar2( 100) , s_name varchar2( 100) , s_type varchar2( 100) , tc_owner varchar2( 100) , tc_table_name varchar2( 100) , tc_mask varchar2( 100) , s_linenumbers varchar2(4000) , s_lines clob , lvl number , path_text varchar2(4000) , d1 varchar2(4000) , d1_owner varchar2( 100) , d1_name varchar2( 100) , d1_type varchar2( 100) , d2 varchar2(4000) , d2_owner varchar2( 100) , d2_name varchar2( 100) , d2_type varchar2( 100) , n number ) ; type dep_tab is table of dep_rec; function tab return tab_tab pipelined ; function dep return dep_tab pipelined ; end ted_p1079;
Package Body
Package Body
Name
TED_P1079
Source
package body ted_p1079 is cursor c_tab is -- all the tables/columns you want to find dependencies for -- this is just an example to select some table/column rows, feel free to change this query select tc.owner , tc.table_name , tc.column_name , '%' || lower(tc.column_name) || '%' as mask , tc.data_type , tc.data_length , cc.comments from dba_tables t , dba_tab_cols tc , dba_col_comments cc where t.owner = tc.owner and t.table_name = tc.table_name and tc.owner = cc.owner and tc.table_name = cc.table_name and tc.column_name = cc.column_name -- and ( tc.column_name like '%EMPLOYEE_ID%' or tc.column_name like '%DEPARTMENT_ID%' or ( tc.table_name = 'TED_MAIL_TEST_PARTS' and tc.column_name in ('DISPOSITION', 'FILENAME') ) ) and tc.column_name not in ( 'SOMECOLUMNNAME' ) -- and tc.owner in ( 'TEDSTRUIK', 'HR' ) -- and tc.owner||'.'||tc.table_name not in ( 'TEDSTRUIK.SOMETABLE' ) and tc.table_name not like 'TMP%' and tc.table_name not like 'MDRT%' and tc.table_name not like 'EBA%' order by 1,2,3 ; cursor c_dep ( p_d2_owner in varchar2 , p_d2_name in varchar2 , p_d2_type in varchar2 , p_mask in varchar2 ) is with users as -- all relevant schemas ( select usr.username from dba_users usr where usr.username in ( 'TEDSTRUIK', 'HR' ) union all select 'PUBLIC' from dual ) , d as /* The dba_dependencies view describes all dependencies in the database between procedures, packages, functions, package bodies, and triggers, including dependencies on views created without any database links. */ ( select dpy.owner||'.'||dpy.name||'#'||dpy.type as d1 , dpy.owner as d1_owner , dpy.name as d1_name , dpy.type as d1_type , dpy.referenced_owner||'.'||dpy.referenced_name||'#'||dpy.referenced_type as d2 , dpy.referenced_owner as d2_owner , dpy.referenced_name as d2_name , dpy.referenced_type as d2_type from dba_dependencies dpy where dpy.owner in ( select username from users ) and dpy.type in ('SYNONYM', 'VIEW', 'TABLE', 'PACKAGE', 'PACKAGE BODY', 'FUNCTION', 'PROCEDURE', 'MATERIALIZED VIEW') and dpy.referenced_owner in ( select username from users ) and dpy.referenced_type not in ('NON-EXISTENT', 'TYPE', 'SEQUENCE') ) , dd as -- all dependencies with their startpoint and endpoint ( select level as lvl , sys_connect_by_path(d2, '->') || '->' || d1 as path_text , d1 , d1_owner , d1_name , d1_type , d2 , d2_owner , d2_name , d2_type from d -- exclude some objects if needed -- having these where clauses here makes the query much faster here than in the dpy part above where d1_name not like 'TMP%' and d1_name not like 'MDRT%' and d1_name not like 'EBA%' and d1_name not like 'BU%' start with d2_owner = p_d2_owner and d2_name = p_d2_name and d2_type = p_d2_type connect by nocycle prior d.d1 = d.d2 ) , s as ( select s2.owner , s2.name , s2.type , s2.d1_owner , s2.d1_name , s2.d1_type , to_char( rtrim(xmlagg(xmlelement(e,s2.line,', ').extract('//text()') order by s2.line).GetClobVal(),', ') ) as linenumbers , rtrim(xmlagg(xmlelement(e,s2.line || ': ' || s2.text,null).extract('//text()') order by s2.line).GetClobVal(),chr(10)||chr(13)) as lines from ( select distinct src.* , dd.d1_owner , dd.d1_name , dd.d1_type from dba_source src , dd where lower(src.text) like p_mask and src.owner = dd.d1_owner and src.name = dd.d1_name and src.type = dd.d1_type and src.type in ('PACKAGE', 'PACKAGE BODY') -- exclude some objects if needed and src.name not like 'TMP%' ) s2 group by s2.owner , s2.name , s2.type , s2.d1_owner , s2.d1_name , s2.d1_type ) select s.owner as s_owner , s.name as s_name , s.type as s_type , p_d2_owner as tc_owner , p_d2_name as tc_table_name , p_mask as tc_mask , s.linenumbers as s_linenumbers , dbms_xmlgen.convert(xmldata => s.lines, flag => 1) as s_lines , dd.* , count(*) over (partition by s.owner, s.name, s.type order by dd.path_text rows between unbounded preceding and current row) as n from dd , s where dd.d1_owner = s.d1_owner (+) and dd.d1_name = s.d1_name (+) and dd.d1_type = s.d1_type (+) ; function tab return tab_tab pipelined is begin for r_tab in c_tab loop pipe row(r_tab); end loop; return; end tab; function dep return dep_tab pipelined is begin for r_tab in c_tab loop for r_dep in c_dep ( p_d2_owner => r_tab.owner , p_d2_name => r_tab.table_name , p_d2_type => 'TABLE' , p_mask => r_tab.mask ) loop if r_dep.s_linenumbers is not null and r_dep.n = 1 -- only show distinct results then pipe row(r_dep); end if; end loop; end loop; return; end dep; end ted_p1079;