74: begin
75: statement := 'ALTER PACKAGE '||schema_name ||'.' ||c1rec.object_name||
76: ' COMPILE SPECIFICATION';
77:
78: c := dbms_sql.open_cursor;
79: dbms_sql.parse(c, statement, dbms_sql.native);
80: rows_processed := dbms_sql.execute(c);
81: dbms_sql.close_cursor(c);
82: exception
75: statement := 'ALTER PACKAGE '||schema_name ||'.' ||c1rec.object_name||
76: ' COMPILE SPECIFICATION';
77:
78: c := dbms_sql.open_cursor;
79: dbms_sql.parse(c, statement, dbms_sql.native);
80: rows_processed := dbms_sql.execute(c);
81: dbms_sql.close_cursor(c);
82: exception
83: when success_with_comp_error then
76: ' COMPILE SPECIFICATION';
77:
78: c := dbms_sql.open_cursor;
79: dbms_sql.parse(c, statement, dbms_sql.native);
80: rows_processed := dbms_sql.execute(c);
81: dbms_sql.close_cursor(c);
82: exception
83: when success_with_comp_error then
84: --
77:
78: c := dbms_sql.open_cursor;
79: dbms_sql.parse(c, statement, dbms_sql.native);
80: rows_processed := dbms_sql.execute(c);
81: dbms_sql.close_cursor(c);
82: exception
83: when success_with_comp_error then
84: --
85: -- Trap and ignore ORA-24344: success with compilation error
84: --
85: -- Trap and ignore ORA-24344: success with compilation error
86: -- This only happens on ORACLE 8
87: --
88: dbms_sql.close_cursor(c);
89: when others then
90: dbms_sql.close_cursor(c);
91: raise;
92: end;
86: -- This only happens on ORACLE 8
87: --
88: dbms_sql.close_cursor(c);
89: when others then
90: dbms_sql.close_cursor(c);
91: raise;
92: end;
93:
94: end loop; -- loop over all invalid packages
97: -- for each invalid object compile
98: begin
99: statement := 'ALTER VIEW '||schema_name||'.'||c2rec.object_name||' COMPILE';
100:
101: c := dbms_sql.open_cursor;
102: dbms_sql.parse(c, statement, dbms_sql.native);
103: rows_processed := dbms_sql.execute(c);
104: dbms_sql.close_cursor(c);
105: exception
98: begin
99: statement := 'ALTER VIEW '||schema_name||'.'||c2rec.object_name||' COMPILE';
100:
101: c := dbms_sql.open_cursor;
102: dbms_sql.parse(c, statement, dbms_sql.native);
103: rows_processed := dbms_sql.execute(c);
104: dbms_sql.close_cursor(c);
105: exception
106: when success_with_comp_error then
99: statement := 'ALTER VIEW '||schema_name||'.'||c2rec.object_name||' COMPILE';
100:
101: c := dbms_sql.open_cursor;
102: dbms_sql.parse(c, statement, dbms_sql.native);
103: rows_processed := dbms_sql.execute(c);
104: dbms_sql.close_cursor(c);
105: exception
106: when success_with_comp_error then
107: dbms_sql.close_cursor(c);
100:
101: c := dbms_sql.open_cursor;
102: dbms_sql.parse(c, statement, dbms_sql.native);
103: rows_processed := dbms_sql.execute(c);
104: dbms_sql.close_cursor(c);
105: exception
106: when success_with_comp_error then
107: dbms_sql.close_cursor(c);
108: when others then
103: rows_processed := dbms_sql.execute(c);
104: dbms_sql.close_cursor(c);
105: exception
106: when success_with_comp_error then
107: dbms_sql.close_cursor(c);
108: when others then
109: dbms_sql.close_cursor(c);
110: raise;
111: end;
105: exception
106: when success_with_comp_error then
107: dbms_sql.close_cursor(c);
108: when others then
109: dbms_sql.close_cursor(c);
110: raise;
111: end;
112: end loop; -- loop over all invalid views
113: -- last, get all remaining invalid objects, which could be package bodies
135: statement := 'ALTER '||object_type1||' '||schema_name||'.'||c3rec.object_name||
136: ' COMPILE '||object_type2;
137:
138: if c3rec.object_type <> 'UNDEFINED' then
139: c := dbms_sql.open_cursor;
140: dbms_sql.parse(c, statement, dbms_sql.native);
141: rows_processed := dbms_sql.execute(c);
142: dbms_sql.close_cursor(c);
143: end if;
136: ' COMPILE '||object_type2;
137:
138: if c3rec.object_type <> 'UNDEFINED' then
139: c := dbms_sql.open_cursor;
140: dbms_sql.parse(c, statement, dbms_sql.native);
141: rows_processed := dbms_sql.execute(c);
142: dbms_sql.close_cursor(c);
143: end if;
144:
137:
138: if c3rec.object_type <> 'UNDEFINED' then
139: c := dbms_sql.open_cursor;
140: dbms_sql.parse(c, statement, dbms_sql.native);
141: rows_processed := dbms_sql.execute(c);
142: dbms_sql.close_cursor(c);
143: end if;
144:
145: exception
138: if c3rec.object_type <> 'UNDEFINED' then
139: c := dbms_sql.open_cursor;
140: dbms_sql.parse(c, statement, dbms_sql.native);
141: rows_processed := dbms_sql.execute(c);
142: dbms_sql.close_cursor(c);
143: end if;
144:
145: exception
146: when success_with_comp_error then
143: end if;
144:
145: exception
146: when success_with_comp_error then
147: dbms_sql.close_cursor(c);
148: when others then
149: dbms_sql.close_cursor(c);
150: raise;
151: end;
145: exception
146: when success_with_comp_error then
147: dbms_sql.close_cursor(c);
148: when others then
149: dbms_sql.close_cursor(c);
150: raise;
151: end;
152: end loop; -- loop over all remaining invalid objects
153: end compile_all_objects;
217: begin
218: statement := 'ALTER PACKAGE '||c1rec.object_name||
219: ' COMPILE SPECIFICATION';
220:
221: c := dbms_sql.open_cursor;
222: dbms_sql.parse(c, statement, dbms_sql.native);
223: rows_processed := dbms_sql.execute(c);
224: dbms_sql.close_cursor(c);
225: exception
218: statement := 'ALTER PACKAGE '||c1rec.object_name||
219: ' COMPILE SPECIFICATION';
220:
221: c := dbms_sql.open_cursor;
222: dbms_sql.parse(c, statement, dbms_sql.native);
223: rows_processed := dbms_sql.execute(c);
224: dbms_sql.close_cursor(c);
225: exception
226: when success_with_comp_error then
219: ' COMPILE SPECIFICATION';
220:
221: c := dbms_sql.open_cursor;
222: dbms_sql.parse(c, statement, dbms_sql.native);
223: rows_processed := dbms_sql.execute(c);
224: dbms_sql.close_cursor(c);
225: exception
226: when success_with_comp_error then
227: --
220:
221: c := dbms_sql.open_cursor;
222: dbms_sql.parse(c, statement, dbms_sql.native);
223: rows_processed := dbms_sql.execute(c);
224: dbms_sql.close_cursor(c);
225: exception
226: when success_with_comp_error then
227: --
228: -- Trap and ignore ORA-24344: success with compilation error
227: --
228: -- Trap and ignore ORA-24344: success with compilation error
229: -- This only happens on ORACLE 8
230: --
231: dbms_sql.close_cursor(c);
232: when others then
233: dbms_sql.close_cursor(c);
234: raise;
235: end;
229: -- This only happens on ORACLE 8
230: --
231: dbms_sql.close_cursor(c);
232: when others then
233: dbms_sql.close_cursor(c);
234: raise;
235: end;
236: end loop; -- loop over all invalid packages
237: -- next compile all invalid views
239: -- for each invalid object compile
240: begin
241: statement := 'ALTER VIEW '||c2rec.object_name||' COMPILE';
242:
243: c := dbms_sql.open_cursor;
244: dbms_sql.parse(c, statement, dbms_sql.native);
245: rows_processed := dbms_sql.execute(c);
246: dbms_sql.close_cursor(c);
247: exception
240: begin
241: statement := 'ALTER VIEW '||c2rec.object_name||' COMPILE';
242:
243: c := dbms_sql.open_cursor;
244: dbms_sql.parse(c, statement, dbms_sql.native);
245: rows_processed := dbms_sql.execute(c);
246: dbms_sql.close_cursor(c);
247: exception
248: when success_with_comp_error then
241: statement := 'ALTER VIEW '||c2rec.object_name||' COMPILE';
242:
243: c := dbms_sql.open_cursor;
244: dbms_sql.parse(c, statement, dbms_sql.native);
245: rows_processed := dbms_sql.execute(c);
246: dbms_sql.close_cursor(c);
247: exception
248: when success_with_comp_error then
249: dbms_sql.close_cursor(c);
242:
243: c := dbms_sql.open_cursor;
244: dbms_sql.parse(c, statement, dbms_sql.native);
245: rows_processed := dbms_sql.execute(c);
246: dbms_sql.close_cursor(c);
247: exception
248: when success_with_comp_error then
249: dbms_sql.close_cursor(c);
250: when others then
245: rows_processed := dbms_sql.execute(c);
246: dbms_sql.close_cursor(c);
247: exception
248: when success_with_comp_error then
249: dbms_sql.close_cursor(c);
250: when others then
251: dbms_sql.close_cursor(c);
252: raise;
253: end;
247: exception
248: when success_with_comp_error then
249: dbms_sql.close_cursor(c);
250: when others then
251: dbms_sql.close_cursor(c);
252: raise;
253: end;
254: end loop; -- loop over all invalid views
255: -- last, get all remaining invalid objects, which could be package bodies
277: statement := 'ALTER '||object_type1||' '||c3rec.object_name||
278: ' COMPILE '||object_type2;
279:
280: if c3rec.object_type <> 'UNDEFINED' then
281: c := dbms_sql.open_cursor;
282: dbms_sql.parse(c, statement, dbms_sql.native);
283: rows_processed := dbms_sql.execute(c);
284: dbms_sql.close_cursor(c);
285: end if;
278: ' COMPILE '||object_type2;
279:
280: if c3rec.object_type <> 'UNDEFINED' then
281: c := dbms_sql.open_cursor;
282: dbms_sql.parse(c, statement, dbms_sql.native);
283: rows_processed := dbms_sql.execute(c);
284: dbms_sql.close_cursor(c);
285: end if;
286:
279:
280: if c3rec.object_type <> 'UNDEFINED' then
281: c := dbms_sql.open_cursor;
282: dbms_sql.parse(c, statement, dbms_sql.native);
283: rows_processed := dbms_sql.execute(c);
284: dbms_sql.close_cursor(c);
285: end if;
286:
287: exception
280: if c3rec.object_type <> 'UNDEFINED' then
281: c := dbms_sql.open_cursor;
282: dbms_sql.parse(c, statement, dbms_sql.native);
283: rows_processed := dbms_sql.execute(c);
284: dbms_sql.close_cursor(c);
285: end if;
286:
287: exception
288: when success_with_comp_error then
285: end if;
286:
287: exception
288: when success_with_comp_error then
289: dbms_sql.close_cursor(c);
290: when others then
291: dbms_sql.close_cursor(c);
292: raise;
293: end;
287: exception
288: when success_with_comp_error then
289: dbms_sql.close_cursor(c);
290: when others then
291: dbms_sql.close_cursor(c);
292: raise;
293: end;
294: end loop; -- loop over all remaining invalid objects
295: end compile_all_objects;