The following lines contain the word 'select', 'insert', 'update' or 'delete':
Line: 22
/* i) Insert top organization chain into the organization hierarchy table */
/* ii) Insert chain for all organizations in that organization hierarchy */
/* version making use of the data structure to avoid recalculating the */
/* same information twice */
/* */
/* 3) Global structures are used to: */
/* */
/* i) Bulk fetch the main loop */
/* ii) Bulk insert the chains into the hierarchy table */
/* iii) Store information about the current chain being processed */
/* iv) Keep a note of which chains have been processed on a particular */
/* date to avoid re-processing the same information */
/* v) Keep a note of the date each chain starts, so that the next time */
/* a chain is processed (on an earlier date) the end date is known */
/* vi) Store the terminated assignment status types so that it is quick to */
/* find out which are invalid at insert time */
/* */
/******************************************************************************/
/* Information to be held for each link in a chain */
TYPE g_link_record_type IS RECORD
(business_group_id PER_org_structure_elements.business_group_id%TYPE
,organization_id PER_org_structure_elements.organization_id_parent%TYPE
,last_chng_date DATE);
Line: 79
g_cs_rows_to_insert PLS_INTEGER; -- Number of CS rows to insert
Line: 92
/* Inserts row into concurrent program log when the g_conc_request_flag has */
/* been set to TRUE, otherwise does nothing */
/******************************************************************************/
PROCEDURE output(p_text VARCHAR2)
IS
BEGIN
/* Write to the concurrent request log if called from a concurrent request */
IF (g_conc_request_flag = TRUE) THEN
/* Put text to log file */
fnd_file.put_line(FND_FILE.log, p_text);
Line: 110
/* Recovers CS rows to insert when an exception occurs */
/******************************************************************************/
PROCEDURE recover_insert_cs_rows IS
BEGIN
-- loop through rows still to insert one at a time
FOR i IN 1..g_cs_rows_to_insert LOOP
-- Trap unique constraint errors
BEGIN
INSERT INTO /*+ PARALLEL(
/* Bulk inserts rows from global temporary table to CS database table */
/******************************************************************************/
PROCEDURE bulk_insert_cs_rows IS
BEGIN
-- insert chunk of rows
FORALL i IN 1..g_cs_rows_to_insert
INSERT INTO /*+ PARALLEL(
/* Inserts row into global CS temporary table */
/******************************************************************************/
PROCEDURE insert_cs_row( p_sup_organization_id IN NUMBER
, p_sup_level IN NUMBER
, p_sub_organization_id IN NUMBER
, p_sub_level IN NUMBER
, p_index IN NUMBER
, p_last_ptntl_change IN DATE ) IS
BEGIN
-- increment the index
g_cs_rows_to_insert := g_cs_rows_to_insert + 1;
/* Updates all organizations in the organization hierarchy version starting */
/* with the top organization. */
/******************************************************************************/
PROCEDURE calculate_chains( p_index IN NUMBER ) IS
/* Cursor picks out all organizations in the organization structure */
/* This cursor MUST return rows in the default order */
CURSOR organizations_csr IS
SELECT
hier.organization_id_child organization_id
,hier.last_update_date last_update_date
,LEVEL+1 actual_level
FROM (SELECT
ose.organization_id_child
,ose.organization_id_parent
,NVL(ose.last_update_date, g_start_of_time) last_update_date
FROM
PER_org_structure_elements ose
WHERE ose.org_structure_version_id = g_fetch_osv_id(p_index)) hier
START WITH hier.organization_id_parent = g_fetch_top_org_id(p_index)
CONNECT BY PRIOR hier.organization_id_child = organization_id_parent;
/* If the stored rows have reached a maximum, then insert them */
IF (g_cs_rows_to_insert > g_chunk_size) THEN
-- bulk insert rows processed so far
bulk_insert_cs_rows;
Line: 314
g_cs_rows_to_insert := 0;
Line: 342
SELECT /*+ use_NL(ost,osv)*/DISTINCT --Bug fix 3648736
ose.organization_id_parent
,osv.org_structure_version_id
,osv.organization_structure_id
,osv.version_number
,ost.primary_structure_flag
,osv.date_from
,NVL(osv.date_to,g_end_of_time)
,osv.business_group_id
FROM
PER_org_structure_elements ose
,PER_org_structure_versions osv
,PER_organization_structures ost
WHERE osv.org_structure_version_id = ose.org_structure_version_id
AND ost.organization_structure_id = osv.organization_structure_id
AND (ost.business_group_id=osv.business_group_id --Bug fix 3648736
or ost.business_group_id is null
or osv.business_group_id is null)
AND (osv.business_group_id=ose.business_group_id
or osv.business_group_id is null
or ose.business_group_id is null)
-- AND ost.primary_structure_flag = 'Y'
AND NOT EXISTS
(SELECT NULL
FROM PER_org_structure_elements ose2
WHERE ose2.org_structure_version_id = ose.org_structure_version_id
AND ose2.organization_id_child = ose.organization_id_parent);
Line: 376
g_cs_rows_to_insert := 0;
Line: 424
/* Insert any remaining stored rows */
IF (g_cs_rows_to_insert > 0) THEN
bulk_insert_cs_rows;
Line: 468
/* Insert new organization hierarchy records */
collect_org_structures;