DBA Data[Home] [Help]

APPS.CZ_PUB_MGR SQL Statements

The following lines contain the word 'select', 'insert', 'update' or 'delete':

Line: 52

procedure Propogate_DeletedFlag is

TYPE tPublTable IS TABLE OF CZ_MODEL_PUBLICATIONS.PUBLICATION_ID%TYPE INDEX BY BINARY_INTEGER;
Line: 64

deletedPublsTbl		tPublTable;
Line: 66

deletedPubl			CZ_MODEL_REF_EXPLS.COMPONENT_ID%TYPE;
Line: 73

/* All  deleted publications*/

CURSOR cDeletedPublication IS
	SELECT devl_project_id
	FROM cz_devl_projects
	WHERE deleted_flag = '0'
		AND devl_project_id NOT IN (SELECT object_id FROM cz_rp_entries
							WHERE object_type = 'PRJ'
							AND deleted_flag = '0');
Line: 84

	requiredModelTbl.DELETE;
Line: 85

	hashRequiredModels.DELETE;
Line: 87

	/* Get all published models, along with the child models that need to exist (undeleted models) */
	SELECT distinct component_id
	BULK COLLECT
	INTO requiredModelTbl
	FROM cz_model_ref_expls
	WHERE deleted_flag = '0'
	AND model_id IN (SELECT model_id FROM cz_model_publications
			WHERE source_target_flag = 'T'
			AND deleted_flag = '0')
	CONNECT BY PRIOR parent_expl_node_id = model_ref_expl_id
	ORDER BY component_id;
Line: 107

	/* Loop through all deleted models and check if it is not being referenced
	   by other publications. If so, then mark it for deletion */
	BEGIN
		open cDeletedPublication;
Line: 112

			FETCH cDeletedPublication into deletedPubl;
Line: 113

			EXIT WHEN cDeletedPublication%NOTFOUND;
Line: 115

			IF (NOT (hashRequiredModels.EXISTS(deletedPubl))) THEN
				BEGIN
					/* Logically delete model */
					UPDATE cz_devl_projects
					SET deleted_flag = '1'
					WHERE devl_project_id = deletedPubl;
Line: 127

		close cDeletedPublication;
Line: 153

    FOR i IN (SELECT object_id FROM CZ_RP_ENTRIES
              WHERE enclosing_folder=p_folder_id AND object_type='FLD')
    LOOP
      l_folders_exist := TRUE;
Line: 165

  PROCEDURE update_Objects_In_Folder(p_folder_id IN NUMBER,x_enclosing_folder OUT NOCOPY NUMBER) IS

    l_object_id_tbl   t_arr;
Line: 173

    SELECT object_id, object_type
    BULK COLLECT INTO l_object_id_tbl, l_object_type_tbl
    FROM CZ_RP_ENTRIES
    WHERE enclosing_folder=p_folder_id;
Line: 180

        DELETE FROM CZ_RP_ENTRIES
         WHERE object_id=l_object_id_tbl(i) AND object_type=l_object_type_tbl(i);
Line: 184

    DELETE FROM CZ_RP_ENTRIES
    WHERE object_id=p_folder_id AND object_type='FLD'
    RETURNING enclosing_folder INTO x_enclosing_folder;
Line: 188

  END update_Objects_In_Folder;
Line: 194

    update_Objects_In_Folder(p_folder_id, l_enclosing_folder);
Line: 196

    FOR i IN (SELECT object_id, enclosing_folder FROM CZ_RP_ENTRIES
              WHERE object_id=l_enclosing_folder AND object_type='FLD')
    LOOP
      -- we should stop on this folder
      IF i.object_id=p_subroot_folder_id THEN
        update_Objects_In_Folder(p_folder_id, l_enclosing_folder);
Line: 212

  FOR i IN(SELECT object_id FROM CZ_RP_ENTRIES
           WHERE object_type='FLD' AND deleted_flag='1')
  LOOP
    --
    -- array l_end_folder_ids_tbl will contain all subfolders
    -- of folder i.object_id which have no subfolders
    --
    l_end_folder_ids_tbl.DELETE;
Line: 241

   DELETE FROM CZ_RP_ENTRIES
   WHERE enclosing_folder=i.object_id;
Line: 244

   DELETE FROM CZ_RP_ENTRIES
    WHERE object_id=i.object_id AND object_type='FLD';
Line: 256

Propogate_DeletedFlag;
Line: 260

 delete from cz_pb_client_apps a
  where not exists ( select null from cz_model_publications b
  where b.publication_id = a.publication_id );
Line: 265

  delete from cz_pb_languages a
  where not exists ( select null from cz_model_publications b
  where b.publication_id = a.publication_id );
Line: 270

  delete from cz_publication_usages a
  where not exists ( select null from cz_model_publications b
  where b.publication_id = a.publication_id );
Line: 279

  for i in(select server_id,model_id,
                 max(export_id) as max_export_id
            from cz_pb_model_exports
            where status='OK'
            group by server_id,model_id)
  loop
    delete from cz_pb_model_exports
    where export_id<>i.max_export_id and model_id=i.model_id and
          server_id=i.server_id;