The following lines contain the word 'select', 'insert', 'update' or 'delete':
select 'Y' into l_exist from dual
where exists
( select null
from ad_zd_ddl_handler
where phase = x_phase
and dbms_lob.compare(sql_lob, x_sql_lob) = 0
and nvl(executed, 'N') <> 'S' );
select count(1) into l_failed_count
from ad_zd_ddl_handler
where (x_phase is null or phase = x_phase)
and executed in (c_job_status_failed, c_job_status_running)
and nvl(status, 'ERROR') <> c_job_status_warning_desc;
select executed into l_status
from ad_zd_ddl_handler
where ddl_id = x_ddl_id;
select count(1) into l_not_executed_count
from ad_zd_ddl_handler
where (x_phase is null or phase = x_phase)
and executed in (c_job_status_not_executed, c_job_status_running);
procedure UPDATE_STATUS_R_TO_N(X_PHASE varchar2)
is
C_MODULE varchar2(127) := c_package||'update_status_r_to_n';
update ad_zd_ddl_handler
set executed = c_job_status_not_executed,
execution_time = null
where (x_phase is null or phase= x_phase)
and executed = c_job_status_running;
end UPDATE_STATUS_R_TO_N;
( select owner, object_name
from dba_invalid_objects
where object_name like 'AD_ZD%'
and object_type like 'PACKAGE%' )
loop
log(c_module, 'STATEMENT', 'Recompiling '||obj.owner||'.'||obj.object_name);
procedure UPDATEJOB_STATUS(
X_DDL_ID number,
X_EXECUTED varchar2,
X_STATUS varchar2,
X_ERROR CLOB)
is
C_MODULE varchar2(127) := c_package||'updatejob_status';
update ad_zd_ddl_handler
set executed = x_executed,
status = nvl(x_status, c_job_status_success_desc),
execution_time =current_timestamp,
error = x_error
where ddl_id=x_ddl_id;
end UPDATEJOB_STATUS;
insert into ad_zd_ddl_handler(
phase ,
ddl_id ,
sql_lob ,
executed ,
status ,
error ,
edition_name ,
execution_time)
values(
x_phase,
l_ddl_id,
x_sql,
c_job_status_not_executed,
c_job_status_not_exec_desc,
null,
null,
null);
delete from ad_zd_ddl_handler
where ( x_phase is null or phase =x_phase );
select mod((rownum-1), x_max_workers)+1 worker_id,
row_id, ddl_id, sql_lob, edition_name, executed
from
( select rowid row_id, ddl_id, sql_lob, edition_name, executed
from ad_zd_ddl_handler
where phase=p_phase
order by ddl_id );
update ad_zd_ddl_handler
set executed = c_job_status_running
, status = c_job_status_running_desc
, execution_time = current_timestamp
, error = NULL
where rowid = job.row_id
and executed not in (c_job_status_running, c_job_status_succeeded);
update ad_zd_ddl_handler
set executed = c_job_status_succeeded
, status = c_job_status_success_desc
, execution_time = current_timestamp
, error = NULL
where rowid = job.row_id;
updatejob_status(job.ddl_id, c_job_status_failed, c_job_status_fatal_desc, l_error);
updatejob_status(job.ddl_id, c_job_status_failed, c_job_status_fatal_desc, l_error);
updatejob_status(job.ddl_id, c_job_status_succeeded, c_job_status_success_desc, l_error);
updatejob_status(job.ddl_id, c_job_status_failed, l_error_level, l_error);