The following lines contain the word 'select', 'insert', 'update' or 'delete':
p_update_where_str IN VARCHAR2,
p_delete IN BOOLEAN DEFAULT NULL
) IS
BEGIN
IF p_delete IS NULL OR p_delete=FALSE THEN
EXECUTE IMMEDIATE
'DECLARE ' ||
' TYPE pk_col1_tbl_type is table of '||p_pk_col1_type||' index by binary_integer; ' ||
' select '||p_pk_cols_str||' from '||p_table_name||' '||p_where||'; ' ||
' pk_col1_tbl.delete; pk_col2_tbl.delete; pk_col3_tbl.delete; pk_col4_tbl.delete; ' ||
' update '||p_table_name||' set deleted_flag = ''1'' where '||p_update_where_str||'; ' ||
' select '||p_pk_cols_str||' from '||p_table_name||' '||p_where||'; ' ||
' pk_col1_tbl.delete; pk_col2_tbl.delete; pk_col3_tbl.delete; pk_col4_tbl.delete; ' ||
' delete from '||p_table_name||' where '||p_update_where_str||'; ' ||
p_delete IN BOOLEAN DEFAULT NULL) IS
l_pk_cols_str VARCHAR2(32000);
l_update_where_str VARCHAR2(32000);
l_update_where_str := ' '||p_pk_col1||'=pk_col1_tbl(j) ';
l_update_where_str := l_update_where_str||' and '||p_pk_col2||'=pk_col2_tbl(j) ';
l_update_where_str := l_update_where_str||' and '||p_pk_col3||'=pk_col3_tbl(j) ';
l_update_where_str := l_update_where_str||' and '||p_pk_col4||'=pk_col4_tbl(j) ';
p_update_where_str => l_update_where_str,
p_delete => p_delete
);
insert into cz_db_logs (caller, message, logtime) values ('cz_base_mgr', 'exec_it failure: '|| p_table_name, sysdate);
p_delete IN BOOLEAN) IS
BEGIN
exec_it(
p_table_name => p_table_name,
p_where => p_where,
p_pk_col1 => p_pk_col1,
p_pk_col2 => p_pk_col2,
p_pk_col3 => p_pk_col3,
p_pk_col4 => p_pk_col4,
p_delete => p_delete);
p_delete IN BOOLEAN) IS
BEGIN
exec_it(
p_table_name => p_table_name,
p_where => p_where,
p_pk_col1 => p_pk_col1,
p_pk_col2 => p_pk_col2,
p_pk_col3 => p_pk_col3,
p_delete => p_delete);
p_delete IN BOOLEAN) IS
BEGIN
exec_it(
p_table_name => p_table_name,
p_where => p_where,
p_pk_col1 => p_pk_col1,
p_pk_col2 => p_pk_col2,
p_delete => p_delete);
p_delete IN BOOLEAN ) IS
BEGIN
exec_it(
p_table_name => p_table_name,
p_where => p_where,
p_pk_col1 => p_pk_col1,
p_delete => p_delete);
sqlText := 'select max(' ||PKeyName|| ') from ' || TableName || ' where object_type = ''FLD''';
sqlText := 'select max(' ||PKeyName|| ') from ' || TableName ;
select nvl(max(run_id), 0) into db_logs_run_id from cz_db_logs;
select * from user_constraints
where CONSTRAINT_TYPE='R' and table_name=par_name;
select value from CZ_DB_SETTINGS
where setting_id='OracleSequenceIncr' and section_name='SCHEMA';
Tables.Delete;
var_deleted_records integer;
l_where VARCHAR2(2000) := ' WHERE DELETED_FLAG=''1'' ';
SELECT column_name
FROM dba_cons_columns
WHERE table_name = p_table_name
AND owner='CZ'
AND constraint_name LIKE '%PK'
ORDER BY position;
SELECT column_name
FROM dba_ind_columns
WHERE table_name = p_table_name
AND table_owner='CZ'
AND index_name LIKE '%PK'
ORDER BY column_position;
select TO_NUMBER(VALUE) into CZ_BASE_MGR.BATCH_SIZE from CZ_DB_SETTINGS
where upper(setting_id)='BATCHSIZE';
exec('cz_ps_nodes', 'where deleted_flag = ''1'' and not exists (select 1 from '||
'cz_devl_projects where '||
'devl_project_id = cz_ps_nodes.devl_project_id and deleted_flag = ''0'')',
'ps_node_id', TRUE);
exec('delete from cz_ps_nodes a where a.deleted_flag = ''1'' and not exists (select NULL from cz_expression_nodes b where a.ps_node_id = b.ps_node_id '||
'and b.deleted_flag = ''0'') and a.deleted_flag = ''1'' and '||
' ps_node_id not in'||
'(select distinct ps_node_id from '||
' (select PRIMARY_OPT_ID as ps_node_id from CZ_DES_CHART_CELLS '||
' where deleted_flag=''0'' '||
' UNION '||
' select SECONDARY_OPT_ID as ps_node_id from CZ_DES_CHART_CELLS '||
' where deleted_flag=''0'' '||
' UNION '||
' select SECONDARY_FEAT_EXPL_ID as ps_node_id from CZ_DES_CHART_CELLS '||
' where deleted_flag=''0'' '||
' UNION '||
' select FEATURE_ID as ps_node_id from CZ_DES_CHART_FEATURES '||
' where deleted_flag=''0'' '||
' UNION '||
' select PS_NODE_ID as ps_node_id from CZ_GRID_CELLS '||
' where deleted_flag=''0''))');
for k in (select ps_node_id from CZ_EXPRESSION_NODES where deleted_flag='0') loop
update cz_ps_nodes set parent_id=0 where ps_node_id=k.ps_node_id and deleted_flag='1';
p_delete => TRUE);
p_delete => TRUE);
p_delete => TRUE);
p_delete => TRUE);
delete from CZ_PS_NODES where ps_node_id>0;
delete from CZ_DEVL_PROJECTS where devl_project_id>0;
dsql('DELETE FROM '||Tables(i).name);
dbms_sql.parse(cur,'select max(LAST_UPDATE_DATE) from '||Tables(i).name,dbms_sql.native);
select TABLE_OWNER into CZ_SCHEMA from user_synonyms
where SYNONYM_NAME='CZ_DEVL_PROJECTS';