Question : Oracle Materialized View refresh - Question

When I execute the following sql, it gets executed in 19 secs.

SELECT activity_information.ID,
       activity_pkg.get_activity_subject_areas
                                        (activity_information.ID) subject_area
FROM activity_information

1) activity_information is a table
2)   activity_pkg.get_activity_subject_areas is a procedure

The following is the code for the proc:
FUNCTION GET_ACTIVITY_SUBJECT_AREAS ( v_activity_id IN Number )
Return VARCHAR2 IS
   v_subject_area_id varchar2(4000);

   CURSOR  SUBJECT_AREA_CURSOR IS
      SELECT  DISTINCT TI_SUBJECT_AREA.ID
      FROM   ACTIVITY_CATEGORY,TI_CATEGORY, TI_SUBJECT_AREA
      WHERE  ( ACTIVITY_CATEGORY.CATEGORY_ID = TI_CATEGORY.ID ) and
           ( TI_CATEGORY.SUBJECT_AREA_ID = TI_SUBJECT_AREA.ID ) and
           ( ACTIVITY_CATEGORY.ACTIVITY_ID = v_activity_id );

BEGIN

  v_subject_area_id := '';
 
  FOR SUBJECT_AREA_REC IN SUBJECT_AREA_CURSOR
  LOOP
    v_subject_area_id := v_subject_area_id || ', "'||SUBJECT_AREA_REC.ID||'"';
  END LOOP;

 RETURN trim(substr(v_subject_area_id,2,length(v_subject_area_id)));
   EXCEPTION
     WHEN OTHERS THEN
   return '';
END GET_ACTIVITY_SUBJECT_AREAS;

Basically I am converting multiple rows into a single row with comma separated values using this proc.

Here is the issue:
when the same sql is used for the creation of MV, it takes 6 - 7 minutes to get refreshed.
I tried with the following refresh options:
refresh with rowid
refresh with pk
refresh fast with row id is not working as i am getting the error message - "ORA-12015: cannot create a fast refresh materialized view from a complex query"

Please let me know how to improve the refresh time.

Answer : Oracle Materialized View refresh - Question

This will  format all the hyperlinks in the body text.
1:
2:
3:
4:
5:
6:
7:
Sub FormatHyperlinkFont()
    Dim hyp As Hyperlink
    
    For Each hyp In ActiveDocument.Hyperlinks
        hyp.Range.Font.Bold = True
    Next hyp
End Sub
Random Solutions  
 
programming4us programming4us