Focal Point
[CLOSED]Report of Procedures used by Synonym

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/2707010086

December 29, 2015, 09:11 AM
RosieGilbert
[CLOSED]Report of Procedures used by Synonym
I am looking to identify which procedures use each Master file/Synonym. Similar to the impact analysis report. All of my procedures/.fex are in the repository. Has anyone produced a report like this or have any suggestions? Thank you!

This message has been edited. Last edited by: <Emily McAllister>,


WebFOCUS 8.2, Server 2008 R2, SQL 2014 data warehouse
December 29, 2015, 10:21 AM
CoolGuy
Look into the Resource Management add-on for the Reporting Console. It has that kind of report and more available.


8.2.02M (production), 8.2.02M (test), Windows 10, all outputs.
December 29, 2015, 02:45 PM
RosieGilbert
Yeah, I do have that add-in and there are helpful reports, although, I didn't see any reports that had procedures by synonym or anything close that I could work with. 'Change Impact for a Column' is sort of what I am looking for but I need it by the whole master not just a column. So I run the report 'Data Sources Never Used' but then I don't know how to see which procedures reference those data sources.


WebFOCUS 8.2, Server 2008 R2, SQL 2014 data warehouse
December 29, 2015, 06:21 PM
CoolGuy
You might consider creating masters of the tables generated from configuring the Resource Management add on, and then query for that information yourself?


8.2.02M (production), 8.2.02M (test), Windows 10, all outputs.
December 30, 2015, 08:51 PM
StuBouyer
We use this code to look for procedures that contain the name of any of our tables in a give database - we have developers that like to use SQL Pass thru so the impact analysis misses these:

 -DEFAULT &lower_name = '';

SQL SQLMSS PREPARE SQLOUT FOR
select lower(table_name) as lower_name
from information_schema.tables
where table_type = 'BASE TABLE'
and (lower(table_name) like 'dim_%' or  lower(table_name) like 'agg_%' or  lower(table_name) like 'fact_%')
END
-RUN
TABLE FILE SQLOUT
PRINT lower_name
BY lower_name NOPRINT
ON TABLE HOLD AS TABLIST FORMAT ALPHA
END

SET COMPOUND = OPEN

-SET &LOOPCNT = &LINES;
-REPEAT LOOP_END FOR &I FROM 1 TO &LOOPCNT;
-READFILE TABLIST
-SET &TAB_NAME = TRUNCATE(&lower_name);

ENGINE SQLMSS SET DEFAULT_CONNECTION REPOSITORY
SQL SQLMSS PREPARE SQLLOOP FOR
select t2.appname,t2.objname,t2.prt_path,t2.lastmodon,t2.lastmodby
from wf_content_revs t1
inner join wf_reposobj t2 on t1.obj_handle = t2.handle
where lower(cast(cast(t1.bcontent as varbinary(max)) as varchar(max))) like '%&TAB_NAME.EVAL.%'
END
-RUN
-IF &I LT &LOOPCNT THEN GOTO :NOTDONE;
SET COMPOUND = CLOSE
-:NOTDONE
TABLE FILE SQLLOOP
PRINT
	 prt_path AS 'Location'
BY objname AS 'Report Name'
HEADING
"TABLE: &TAB_NAME"
FOOTING
""
ON TABLE SET EMPTYREPORT ON
ON TABLE SET BYDISPLAY ON
ON TABLE PCHOLD AS TABLE_LIST FORMAT XLSX NOBREAK
END
-RUN

-LOOP_END 


You could do something similar by reading SYSTABLES rather than the database's information_schema.tables.

Cheers

Stu


WebFOCUS 8.2.03 (8.2.06 in testing)