DBA Data[Home] [Help]

APPS.MTH_UTIL_PKG dependencies on MTH_RUN_LOG

Line 6: * Procedure :MTH_RUN_LOG_PRE_LOAD *

2: /*$Header: mthutilb.pls 120.8.12010000.6 2008/11/06 01:37:01 tkan ship $ */
3:
4:
5: /* *****************************************************************************
6: * Procedure :MTH_RUN_LOG_PRE_LOAD *
7: * Description :This procedure is used for the population of the *
8: * mth_run_log table for the initial and incremental load. The procedure is *
9: * called at the begenning of the mapping execution sequence to set the *
10: * boundary conditions for the ebs collection for the corresponding fact *

Line 8: * mth_run_log table for the initial and incremental load. The procedure is *

4:
5: /* *****************************************************************************
6: * Procedure :MTH_RUN_LOG_PRE_LOAD *
7: * Description :This procedure is used for the population of the *
8: * mth_run_log table for the initial and incremental load. The procedure is *
9: * called at the begenning of the mapping execution sequence to set the *
10: * boundary conditions for the ebs collection for the corresponding fact *
11: * or dimension. *
12: * File Name :MTHUTILB.PLS *

Line 26: PROCEDURE mth_run_log_pre_load( p_fact_table IN VARCHAR2,

22: * Ankit Goyal 31-May-2007 Initial Creation *
23: * Ankit Goyal 03-Jul-2007 Incorporated pushkala comments *
24: * Amrit Kaur 14-mar-2008 Commented apps_initilalize due to Bug 6737820 *
25: ***************************************************************************** */
26: PROCEDURE mth_run_log_pre_load( p_fact_table IN VARCHAR2,
27: p_db_global_name IN VARCHAR2,
28: p_run_mode IN VARCHAR2,
29: p_run_start_date IN DATE,
30: p_is_fact IN NUMBER,

Line 35: l_fact_table mth_run_log.fact_table%TYPE;--fact table name

31: p_to_date IN DATE)
32: IS
33: --local variable declation
34:
35: l_fact_table mth_run_log.fact_table%TYPE;--fact table name
36: l_ebs_organization_id mth_run_log.ebs_organization_id%TYPE;
37: l_ebs_organization_code mth_run_log.ebs_organization_code%TYPE;
38: l_from_date mth_run_log.from_date%TYPE;--from date of the run
39: l_to_date mth_run_log.to_date%TYPE;--to date of the run

Line 36: l_ebs_organization_id mth_run_log.ebs_organization_id%TYPE;

32: IS
33: --local variable declation
34:
35: l_fact_table mth_run_log.fact_table%TYPE;--fact table name
36: l_ebs_organization_id mth_run_log.ebs_organization_id%TYPE;
37: l_ebs_organization_code mth_run_log.ebs_organization_code%TYPE;
38: l_from_date mth_run_log.from_date%TYPE;--from date of the run
39: l_to_date mth_run_log.to_date%TYPE;--to date of the run
40: l_source mth_run_log.source%TYPE;--process or discrete. Not used currently

Line 37: l_ebs_organization_code mth_run_log.ebs_organization_code%TYPE;

33: --local variable declation
34:
35: l_fact_table mth_run_log.fact_table%TYPE;--fact table name
36: l_ebs_organization_id mth_run_log.ebs_organization_id%TYPE;
37: l_ebs_organization_code mth_run_log.ebs_organization_code%TYPE;
38: l_from_date mth_run_log.from_date%TYPE;--from date of the run
39: l_to_date mth_run_log.to_date%TYPE;--to date of the run
40: l_source mth_run_log.source%TYPE;--process or discrete. Not used currently
41: l_system_fk_key mth_systems_setup.system_pk_key%TYPE;

Line 38: l_from_date mth_run_log.from_date%TYPE;--from date of the run

34:
35: l_fact_table mth_run_log.fact_table%TYPE;--fact table name
36: l_ebs_organization_id mth_run_log.ebs_organization_id%TYPE;
37: l_ebs_organization_code mth_run_log.ebs_organization_code%TYPE;
38: l_from_date mth_run_log.from_date%TYPE;--from date of the run
39: l_to_date mth_run_log.to_date%TYPE;--to date of the run
40: l_source mth_run_log.source%TYPE;--process or discrete. Not used currently
41: l_system_fk_key mth_systems_setup.system_pk_key%TYPE;
42: l_creation_date mth_run_log.creation_date%TYPE;--who column

Line 39: l_to_date mth_run_log.to_date%TYPE;--to date of the run

35: l_fact_table mth_run_log.fact_table%TYPE;--fact table name
36: l_ebs_organization_id mth_run_log.ebs_organization_id%TYPE;
37: l_ebs_organization_code mth_run_log.ebs_organization_code%TYPE;
38: l_from_date mth_run_log.from_date%TYPE;--from date of the run
39: l_to_date mth_run_log.to_date%TYPE;--to date of the run
40: l_source mth_run_log.source%TYPE;--process or discrete. Not used currently
41: l_system_fk_key mth_systems_setup.system_pk_key%TYPE;
42: l_creation_date mth_run_log.creation_date%TYPE;--who column
43: l_last_update_date mth_run_log.last_update_date%TYPE;--who column

Line 40: l_source mth_run_log.source%TYPE;--process or discrete. Not used currently

36: l_ebs_organization_id mth_run_log.ebs_organization_id%TYPE;
37: l_ebs_organization_code mth_run_log.ebs_organization_code%TYPE;
38: l_from_date mth_run_log.from_date%TYPE;--from date of the run
39: l_to_date mth_run_log.to_date%TYPE;--to date of the run
40: l_source mth_run_log.source%TYPE;--process or discrete. Not used currently
41: l_system_fk_key mth_systems_setup.system_pk_key%TYPE;
42: l_creation_date mth_run_log.creation_date%TYPE;--who column
43: l_last_update_date mth_run_log.last_update_date%TYPE;--who column
44: l_creation_system_id mth_run_log.creation_system_id%TYPE;--who column

Line 42: l_creation_date mth_run_log.creation_date%TYPE;--who column

38: l_from_date mth_run_log.from_date%TYPE;--from date of the run
39: l_to_date mth_run_log.to_date%TYPE;--to date of the run
40: l_source mth_run_log.source%TYPE;--process or discrete. Not used currently
41: l_system_fk_key mth_systems_setup.system_pk_key%TYPE;
42: l_creation_date mth_run_log.creation_date%TYPE;--who column
43: l_last_update_date mth_run_log.last_update_date%TYPE;--who column
44: l_creation_system_id mth_run_log.creation_system_id%TYPE;--who column
45: l_last_update_system_id mth_run_log.last_update_system_id%TYPE;--who column
46: --l_sysdate to holding the current date

Line 43: l_last_update_date mth_run_log.last_update_date%TYPE;--who column

39: l_to_date mth_run_log.to_date%TYPE;--to date of the run
40: l_source mth_run_log.source%TYPE;--process or discrete. Not used currently
41: l_system_fk_key mth_systems_setup.system_pk_key%TYPE;
42: l_creation_date mth_run_log.creation_date%TYPE;--who column
43: l_last_update_date mth_run_log.last_update_date%TYPE;--who column
44: l_creation_system_id mth_run_log.creation_system_id%TYPE;--who column
45: l_last_update_system_id mth_run_log.last_update_system_id%TYPE;--who column
46: --l_sysdate to holding the current date
47: l_sysdate DATE := sysdate;--target system sysdate

Line 44: l_creation_system_id mth_run_log.creation_system_id%TYPE;--who column

40: l_source mth_run_log.source%TYPE;--process or discrete. Not used currently
41: l_system_fk_key mth_systems_setup.system_pk_key%TYPE;
42: l_creation_date mth_run_log.creation_date%TYPE;--who column
43: l_last_update_date mth_run_log.last_update_date%TYPE;--who column
44: l_creation_system_id mth_run_log.creation_system_id%TYPE;--who column
45: l_last_update_system_id mth_run_log.last_update_system_id%TYPE;--who column
46: --l_sysdate to holding the current date
47: l_sysdate DATE := sysdate;--target system sysdate
48: --l_mode is used to determine the run type , initial 0 or incremental 1

Line 45: l_last_update_system_id mth_run_log.last_update_system_id%TYPE;--who column

41: l_system_fk_key mth_systems_setup.system_pk_key%TYPE;
42: l_creation_date mth_run_log.creation_date%TYPE;--who column
43: l_last_update_date mth_run_log.last_update_date%TYPE;--who column
44: l_creation_system_id mth_run_log.creation_system_id%TYPE;--who column
45: l_last_update_system_id mth_run_log.last_update_system_id%TYPE;--who column
46: --l_sysdate to holding the current date
47: l_sysdate DATE := sysdate;--target system sysdate
48: --l_mode is used to determine the run type , initial 0 or incremental 1
49: l_mode NUMBER := 0;--initial default

Line 52: l_hub_organization_code mth_run_log.hub_organization_code%TYPE;

48: --l_mode is used to determine the run type , initial 0 or incremental 1
49: l_mode NUMBER := 0;--initial default
50: l_plant_start_date DATE; --Plant end date
51: --Hub organization code
52: l_hub_organization_code mth_run_log.hub_organization_code%TYPE;
53:
54: --cursor for iterating through the ebs organizations in mth_plants_d
55: --the rows in the mth_run_log will be at organization granularity
56: CURSOR c_ebs_orgs IS

Line 55: --the rows in the mth_run_log will be at organization granularity

51: --Hub organization code
52: l_hub_organization_code mth_run_log.hub_organization_code%TYPE;
53:
54: --cursor for iterating through the ebs organizations in mth_plants_d
55: --the rows in the mth_run_log will be at organization granularity
56: CURSOR c_ebs_orgs IS
57: SELECT ebs_organization_id,organization_code,
58: source,plant_pk,system_fk_key,from_date
59: FROM mth_plants_d, mth_systems_setup,mth_organizations_l

Line 68: DELETE FROM mth_run_log WHERE fact_table = p_fact_table;

64:
65: BEGIN
66: IF p_run_mode = 'INITIAL' THEN--Initial load
67: --delete the rows from run log
68: DELETE FROM mth_run_log WHERE fact_table = p_fact_table;
69:
70: END IF;
71: --initialize the local variables and who columns
72: l_fact_table := p_fact_table;

Line 106: FROM mth_run_log

102: /* We are dealing with non-ebs org configured to the passed system*/
103: /* Check if there are records for non-ebs organizations from same system and same fact and same plant */
104: SELECT COUNT(*)
105: INTO l_mode
106: FROM mth_run_log
107: WHERE fact_table = l_fact_table
108: AND db_global_name = p_db_global_name
109: AND hub_organization_code = l_orgs.plant_pk;
110:

Line 115: INSERT INTO mth_run_log (fact_table, ebs_organization_id,

111: IF l_mode = 0 OR UPPER(p_run_mode) = 'INITIAL' THEN /* Initial Load */
112:
113: --statement for insert
114:
115: INSERT INTO mth_run_log (fact_table, ebs_organization_id,
116: ebs_organization_code,from_date,to_date, source, db_global_name,
117: creation_date,last_update_date,creation_system_id,
118: last_update_system_id,plant_start_date,hub_organization_code)
119: VALUES(l_fact_table,l_ebs_organization_id,l_ebs_organization_code,

Line 129: UPDATE mth_run_log

125: /* update all non_ebs organizations from same system and plant with to_date as the passed date */
126: --Custom Logic for the time dimension
127: IF p_fact_table = 'MTH_WORKDAY_SHIFTS_D'
128: THEN
129: UPDATE mth_run_log
130: SET from_date = p_run_start_date
131: WHERE
132: fact_table = p_fact_table and db_global_name=p_db_global_name;
133: END IF ;

Line 136: UPDATE mth_run_log

132: fact_table = p_fact_table and db_global_name=p_db_global_name;
133: END IF ;
134:
135: --statment for update
136: UPDATE mth_run_log
137: SET TO_DATE = l_to_date,
138: LAST_UPDATE_DATE = l_last_update_date,
139: LAST_UPDATE_SYSTEM_ID =l_last_update_system_id
140: WHERE

Line 151: --determine if there are any rows in the mth_run_log for

147:
148: ELSE
149: /* We are dealing with EBS Organizations */
150:
151: --determine if there are any rows in the mth_run_log for
152: --the fact_table corresponding to the org
153: SELECT COUNT(*)
154: INTO l_mode
155: FROM mth_run_log

Line 155: FROM mth_run_log

151: --determine if there are any rows in the mth_run_log for
152: --the fact_table corresponding to the org
153: SELECT COUNT(*)
154: INTO l_mode
155: FROM mth_run_log
156: WHERE fact_table = l_fact_table
157: AND ebs_organization_id = l_orgs.ebs_organization_id
158: AND db_global_name = p_db_global_name
159: AND hub_organization_code = l_orgs.plant_pk;

Line 172: INSERT INTO mth_run_log (fact_table, ebs_organization_id,

168: l_creation_system_id := -1;
169:
170: --statement for insert
171:
172: INSERT INTO mth_run_log (fact_table, ebs_organization_id,
173: ebs_organization_code,from_date,to_date, source, db_global_name,
174: creation_date,last_update_date,creation_system_id,
175: last_update_system_id,plant_start_date,hub_organization_code)
176: VALUES(l_fact_table,l_ebs_organization_id,l_ebs_organization_code,

Line 189: UPDATE mth_run_log

185:
186: --Custom Logic for the time dimension
187: IF p_fact_table = 'MTH_WORKDAY_SHIFTS_D'
188: THEN
189: UPDATE mth_run_log
190: SET from_date = p_run_start_date
191: WHERE
192: fact_table = p_fact_table;
193: END IF ;

Line 195: UPDATE mth_run_log

191: WHERE
192: fact_table = p_fact_table;
193: END IF ;
194: --statment for update
195: UPDATE mth_run_log
196: SET TO_DATE = l_to_date,
197: LAST_UPDATE_DATE = l_last_update_date,
198: LAST_UPDATE_SYSTEM_ID =l_last_update_system_id
199: WHERE

Line 219: END mth_run_log_pre_load;

215: WHEN NO_DATA_FOUND THEN
216: RAISE_APPLICATION_ERROR (-20001,
217: 'Exception has occured');
218:
219: END mth_run_log_pre_load;
220:
221:
222: /* *****************************************************************************
223: * Procedure :MTH_RUN_LOG_POST_LOAD *

Line 223: * Procedure :MTH_RUN_LOG_POST_LOAD *

219: END mth_run_log_pre_load;
220:
221:
222: /* *****************************************************************************
223: * Procedure :MTH_RUN_LOG_POST_LOAD *
224: * Description :This procedure is used for the population of the *
225: * mth_run_log table for the initial and incremental load. The procedure is *
226: * called at the end of the mapping execution sequence to set the *
227: * boundary conditions for the ebs collection for the corresponding fact *

Line 225: * mth_run_log table for the initial and incremental load. The procedure is *

221:
222: /* *****************************************************************************
223: * Procedure :MTH_RUN_LOG_POST_LOAD *
224: * Description :This procedure is used for the population of the *
225: * mth_run_log table for the initial and incremental load. The procedure is *
226: * called at the end of the mapping execution sequence to set the *
227: * boundary conditions for the ebs collection for the corresponding fact *
228: * or dimension. *
229: * File Name : MTHUTILB.PLS *

Line 238: PROCEDURE mth_run_log_post_load(p_fact_table IN VARCHAR2,

234: * Author Date Change *
235: * Ankit Goyal 31-May-2007 Initial Creation *
236: * Ankit Goyal 03-Jul-2007 Incorporated pushkala's comments *
237: ***************************************************************************** */
238: PROCEDURE mth_run_log_post_load(p_fact_table IN VARCHAR2,
239: p_db_global_name IN VARCHAR2)
240:
241: IS
242:

Line 244: l_fact_table mth_run_log.fact_table%TYPE;--fact table

240:
241: IS
242:
243: --local variables initialization
244: l_fact_table mth_run_log.fact_table%TYPE;--fact table
245: l_sysdate DATE := sysdate;--variable for sysdate
246: l_last_update_system_id mth_run_log.last_update_system_id%TYPE;
247: l_last_update_date mth_run_log.last_update_date%TYPE;
248: l_system_fk_key mth_systems_setup.system_pk_key%TYPE;

Line 246: l_last_update_system_id mth_run_log.last_update_system_id%TYPE;

242:
243: --local variables initialization
244: l_fact_table mth_run_log.fact_table%TYPE;--fact table
245: l_sysdate DATE := sysdate;--variable for sysdate
246: l_last_update_system_id mth_run_log.last_update_system_id%TYPE;
247: l_last_update_date mth_run_log.last_update_date%TYPE;
248: l_system_fk_key mth_systems_setup.system_pk_key%TYPE;
249: l_to_date mth_run_log.to_date%TYPE;--variable for storing to_date
250: l_from_date mth_run_log.from_date%TYPE;--variable for storing from_date

Line 247: l_last_update_date mth_run_log.last_update_date%TYPE;

243: --local variables initialization
244: l_fact_table mth_run_log.fact_table%TYPE;--fact table
245: l_sysdate DATE := sysdate;--variable for sysdate
246: l_last_update_system_id mth_run_log.last_update_system_id%TYPE;
247: l_last_update_date mth_run_log.last_update_date%TYPE;
248: l_system_fk_key mth_systems_setup.system_pk_key%TYPE;
249: l_to_date mth_run_log.to_date%TYPE;--variable for storing to_date
250: l_from_date mth_run_log.from_date%TYPE;--variable for storing from_date
251: l_ebs_organization_id mth_run_log.ebs_organization_id%TYPE;

Line 249: l_to_date mth_run_log.to_date%TYPE;--variable for storing to_date

245: l_sysdate DATE := sysdate;--variable for sysdate
246: l_last_update_system_id mth_run_log.last_update_system_id%TYPE;
247: l_last_update_date mth_run_log.last_update_date%TYPE;
248: l_system_fk_key mth_systems_setup.system_pk_key%TYPE;
249: l_to_date mth_run_log.to_date%TYPE;--variable for storing to_date
250: l_from_date mth_run_log.from_date%TYPE;--variable for storing from_date
251: l_ebs_organization_id mth_run_log.ebs_organization_id%TYPE;
252: --Hub organization code
253: l_hub_organization_code mth_run_log.hub_organization_code%TYPE;

Line 250: l_from_date mth_run_log.from_date%TYPE;--variable for storing from_date

246: l_last_update_system_id mth_run_log.last_update_system_id%TYPE;
247: l_last_update_date mth_run_log.last_update_date%TYPE;
248: l_system_fk_key mth_systems_setup.system_pk_key%TYPE;
249: l_to_date mth_run_log.to_date%TYPE;--variable for storing to_date
250: l_from_date mth_run_log.from_date%TYPE;--variable for storing from_date
251: l_ebs_organization_id mth_run_log.ebs_organization_id%TYPE;
252: --Hub organization code
253: l_hub_organization_code mth_run_log.hub_organization_code%TYPE;
254:

Line 251: l_ebs_organization_id mth_run_log.ebs_organization_id%TYPE;

247: l_last_update_date mth_run_log.last_update_date%TYPE;
248: l_system_fk_key mth_systems_setup.system_pk_key%TYPE;
249: l_to_date mth_run_log.to_date%TYPE;--variable for storing to_date
250: l_from_date mth_run_log.from_date%TYPE;--variable for storing from_date
251: l_ebs_organization_id mth_run_log.ebs_organization_id%TYPE;
252: --Hub organization code
253: l_hub_organization_code mth_run_log.hub_organization_code%TYPE;
254:
255: --cursor for iterating through the ebs organizations in mth_plants_d

Line 253: l_hub_organization_code mth_run_log.hub_organization_code%TYPE;

249: l_to_date mth_run_log.to_date%TYPE;--variable for storing to_date
250: l_from_date mth_run_log.from_date%TYPE;--variable for storing from_date
251: l_ebs_organization_id mth_run_log.ebs_organization_id%TYPE;
252: --Hub organization code
253: l_hub_organization_code mth_run_log.hub_organization_code%TYPE;
254:
255: --cursor for iterating through the ebs organizations in mth_plants_d
256: --the rows in the mth_run_log will be at organization granularity
257:

Line 256: --the rows in the mth_run_log will be at organization granularity

252: --Hub organization code
253: l_hub_organization_code mth_run_log.hub_organization_code%TYPE;
254:
255: --cursor for iterating through the ebs organizations in mth_plants_d
256: --the rows in the mth_run_log will be at organization granularity
257:
258: CURSOR c_ebs_orgs
259: IS
260: SELECT ebs_organization_id,system_fk_key

Line 283: FROM mth_run_log

279: all organizations are populated with sysdate(source or target) as the to_date. So giving a generic update command here would work */
280:
281: SELECT min(to_date) --min is to avoid getting duplicate rows
282: INTO l_from_date--from date set to previous to_date
283: FROM mth_run_log
284: WHERE fact_table = l_fact_table
285: AND db_global_name = p_db_global_name;
286:
287: --if statement to restrict the accidental re run of the block

Line 289: --update the mth run log for next incremental run

285: AND db_global_name = p_db_global_name;
286:
287: --if statement to restrict the accidental re run of the block
288: IF l_from_date IS NOT NULL THEN
289: --update the mth run log for next incremental run
290:
291: UPDATE mth_run_log
292: SET from_date = l_from_date,--from date set to previous to_date
293: to_date = NULL,--to_date set to null for next run

Line 291: UPDATE mth_run_log

287: --if statement to restrict the accidental re run of the block
288: IF l_from_date IS NOT NULL THEN
289: --update the mth run log for next incremental run
290:
291: UPDATE mth_run_log
292: SET from_date = l_from_date,--from date set to previous to_date
293: to_date = NULL,--to_date set to null for next run
294: last_update_date = l_last_update_date
295: Where fact_table = l_fact_table

Line 312: FROM mth_run_log

308:
309: --select the next starting date into l_from_date
310: SELECT to_date
311: INTO l_from_date--from date set to previous to_date
312: FROM mth_run_log
313: WHERE fact_table = l_fact_table
314: AND db_global_name = p_db_global_name
315: AND ebs_organization_id = l_ebs_organization_id;
316:

Line 320: --update the mth run log for next incremental run

316:
317:
318: --if statement to restrict the accidental re run of the block
319: IF l_from_date IS NOT NULL THEN
320: --update the mth run log for next incremental run
321:
322: UPDATE mth_run_log
323: SET from_date = l_from_date,--from date set to previous to_date
324: to_date = NULL,--to_date set to null for next run

Line 322: UPDATE mth_run_log

318: --if statement to restrict the accidental re run of the block
319: IF l_from_date IS NOT NULL THEN
320: --update the mth run log for next incremental run
321:
322: UPDATE mth_run_log
323: SET from_date = l_from_date,--from date set to previous to_date
324: to_date = NULL,--to_date set to null for next run
325: last_update_date = l_last_update_date
326: Where fact_table = l_fact_table

Line 340: END mth_run_log_post_load;

336: EXCEPTION
337: WHEN NO_DATA_FOUND THEN
338: RAISE_APPLICATION_ERROR (-20001,
339: 'Exception has occured');
340: END mth_run_log_post_load;
341:
342:
343: /* *****************************************************************************
344: * Procedure :MTH_HRCHY_BALANCE_LOAD *

Line 875: * the p_key_table name as the key to look up the entry in mth_run_log *

871: /* ****************************************************************************
872: * Procedure :generate_new_time_range *
873: * Description :This procedure is used to generate a time range *
874: * starting from the last end date up to current time, sysdate, using *
875: * the p_key_table name as the key to look up the entry in mth_run_log *
876: * table. If the entry does not exist, create one and set the time range *
877: * to a hard-coded past time to current time. *
878: * File Name :MTHUTILB.PLS *
879: * Visibility :Public *

Line 882: * mth_run_log table. *

878: * File Name :MTHUTILB.PLS *
879: * Visibility :Public *
880: * Parameters *
881: * p_key_table : Name to uniquely identify one entry in the *
882: * mth_run_log table. *
883: * p_start_date : An output value that specifies the start time *
884: * of the new time period. *
885: * p_end_date : An output value that specifies the end time *
886: * of the new time period. *

Line 902: v_from_date mth_run_log.from_date%TYPE;

898: p_start_date OUT NOCOPY DATE,
899: p_end_date OUT NOCOPY DATE,
900: p_exclusive_lock IN NUMBER DEFAULT 1)
901: IS
902: v_from_date mth_run_log.from_date%TYPE;
903: v_to_date mth_run_log.to_date%TYPE;
904: v_is_new_entry BOOLEAN := FALSE;
905: v_default_start_date DATE := to_date('1950', 'YYYY');
906: v_sysdate DATE := sysdate;

Line 903: v_to_date mth_run_log.to_date%TYPE;

899: p_end_date OUT NOCOPY DATE,
900: p_exclusive_lock IN NUMBER DEFAULT 1)
901: IS
902: v_from_date mth_run_log.from_date%TYPE;
903: v_to_date mth_run_log.to_date%TYPE;
904: v_is_new_entry BOOLEAN := FALSE;
905: v_default_start_date DATE := to_date('1950', 'YYYY');
906: v_sysdate DATE := sysdate;
907: v_retval number := 0;

Line 911: FROM mth_run_log

907: v_retval number := 0;
908:
909: CURSOR c_lookup IS
910: SELECT to_date
911: FROM mth_run_log
912: WHERE fact_table = p_key_table and rownum=1;
913: BEGIN
914: -- 1. Validate the p_fact_table input value.
915: IF (p_key_table is not null) THEN

Line 941: INSERT INTO mth_run_log

937:
938: -- 4. Create a new entry if not exist. Otherwise, update the entry
939: IF v_is_new_entry THEN
940: v_from_date := v_default_start_date;
941: INSERT INTO mth_run_log
942: (fact_table, ebs_organization_id, ebs_organization_code, from_date,
943: to_date, source, db_global_name, creation_date, last_update_date,
944: creation_system_id, last_update_system_id, plant_start_date)
945: VALUES

Line 950: UPDATE mth_run_log

946: (p_key_table, -1, '-1', v_from_date,
947: v_to_date, -1, '-99999', v_sysdate, v_sysdate,
948: -1, -1, v_default_start_date);
949: ELSE
950: UPDATE mth_run_log
951: SET TO_DATE = v_to_date,
952: FROM_DATE = v_from_date,
953: LAST_UPDATE_DATE = v_sysdate
954: WHERE

Line 1137: * to_date column in MTH_RUN_LOG for MTH_ALL_MVS entry. *

1133: * - C , c or NULL indicates complete refresh. *
1134: * - R or r indicates resume refresh that has been *
1135: * started earlier. The MV will be refreshed if the *
1136: * refresh date is earlier than the date stored in *
1137: * to_date column in MTH_RUN_LOG for MTH_ALL_MVS entry. *
1138: * p_push_deferred_rpc : Used by updatable materialized views only. *
1139: * Modification log : *
1140: * Author Date Change *
1141: * Yong Feng 19-Aug-2008 Initial Creation *

Line 1172: -- First, find the refresh date in MTH_RUN_LOG in resume case

1168: -- Need to refresh in mode C
1169: v_bneed_refresh := TRUE;
1170: ELSE
1171: -- It is a resume operation
1172: -- First, find the refresh date in MTH_RUN_LOG in resume case
1173: SELECT max(to_date) into v_refresh_date_required
1174: FROM mth_run_log
1175: WHERE fact_table = 'MTH_ALL_MVS' AND db_global_name = v_unassigned_string;
1176: IF (v_refresh_date_required IS NULL) THEN

Line 1174: FROM mth_run_log

1170: ELSE
1171: -- It is a resume operation
1172: -- First, find the refresh date in MTH_RUN_LOG in resume case
1173: SELECT max(to_date) into v_refresh_date_required
1174: FROM mth_run_log
1175: WHERE fact_table = 'MTH_ALL_MVS' AND db_global_name = v_unassigned_string;
1176: IF (v_refresh_date_required IS NULL) THEN
1177: -- Refresh the MV if there is no entry found in MTH_RUN_LOG
1178: v_bneed_refresh := TRUE;

Line 1177: -- Refresh the MV if there is no entry found in MTH_RUN_LOG

1173: SELECT max(to_date) into v_refresh_date_required
1174: FROM mth_run_log
1175: WHERE fact_table = 'MTH_ALL_MVS' AND db_global_name = v_unassigned_string;
1176: IF (v_refresh_date_required IS NULL) THEN
1177: -- Refresh the MV if there is no entry found in MTH_RUN_LOG
1178: v_bneed_refresh := TRUE;
1179: ELSE
1180: -- First get the last refresh date of the MV
1181: -- Then, compare the last refresh date of the MV with the date from the MTH_RUN_LOG

Line 1181: -- Then, compare the last refresh date of the MV with the date from the MTH_RUN_LOG

1177: -- Refresh the MV if there is no entry found in MTH_RUN_LOG
1178: v_bneed_refresh := TRUE;
1179: ELSE
1180: -- First get the last refresh date of the MV
1181: -- Then, compare the last refresh date of the MV with the date from the MTH_RUN_LOG
1182: -- to decide whether the MV needs to be refreshed
1183: OPEN getRefreshDate ( v_mv_name);
1184: FETCH getRefreshDate INTO v_last_refresh_date;
1185: IF (getRefreshDate%FOUND) THEN