Sorry for the delay. Here is a few snippets of code.
So here is the query that I would like to be able to run in SQL Optimizer to help get the stats back in a way that is much easier to digest.
SELECT /*+ FIRST_ROWS(100) */
vbugs.bug_id,
vbugs.bug_status,
vbugs.def_type,
vbugs.smr_state,
vbugs.reporter_disp_name,
vbugs.assigned_by_disp_name,
vbugs.assigned_disp_name,
vbugs.facility,
vbugs.version,
vbugs.product,
vbugs.peg_total,
vbugs.bus_total,
vbugs.gpeg,
vbugs.short_desc
FROM vbugs,
(SELECT COLUMN_VALUE watchid
FROM TABLE (hotquery.watch_issues (‘DBUSBY3’, 200))) watchs
WHERE vbugs.bug_id = watchs.watchid
So that low level query is the table function. And here is the code for the table function.
FUNCTION watch_issues (myldapid IN userpass.ldapalias%TYPE,
maxrows IN PLS_INTEGER:= hotquery.maxrecords)
RETURN issue_ids
IS
var_useralias userpass.ldapalias%TYPE
:= UPPER (watch_issues.myldapid) ;
datarows issue_ids;
CURSOR watching_cur (cursor_var_useralias IN userpass.ldapalias%TYPE)
IS
SELECT wi.bug_id
FROM watchissues wi
WHERE wi.ldapalias = cursor_var_useralias;
BEGIN
DBMS_APPLICATION_INFO.set_module (
module_name => ‘Oracle SWIFT Engine’,
Action_name => ‘HotQuery watch_issues’
);
OPEN watch_issues.watching_cur
(cursor_var_useralias => watch_issues.
var_useralias);
FETCH watch_issues.watching_cur
BULK COLLECT INTO watch_issues.datarows
LIMIT LEAST (watch_issues.maxrows, HOTQUERY.MAXRECORDS);
CLOSE watch_issues.watching_cur;
RETURN watch_issues.datarows;
END watch_issues;
Now if you need anything else please let me know or contact Bert Scalzo if you need to reach me as well.