1: package body PQH_GENERIC as
2: /* $Header: pqgnfnb.pkb 120.3 2006/05/02 03:04:19 ghshanka noship $ */
3: --
4: -- Created by : Sanej Nair (SCNair)
5: -- Version Date Author Comment
9: -- ---------------------------------------------------------------------------+
10: -- | Private Global Definitions |
11: -- ---------------------------------------------------------------------------+
12: --
13: g_package varchar2(33) := ' PQH_GENERIC.'; -- Global package name
14: -- added for the bug 5052820
15: --
16: l_eff_date date ;
17: upd_where varchar2(1) :='N';
131: and sat.ddf_column_name is not null
132: and att.enable_flag = 'Y'
133: and tca.select_flag = 'Y'
134: and sat.enable_flag = 'Y'
135: and sat.context = pqh_generic.g_gbl_context; --application_id
136: --and cet.context = sat.context; --application_id
137: --
138: -- Cursor for changeable attributes
139: --
137: --
138: -- Cursor for changeable attributes
139: --
140: cursor c_change(v_copy_entity_txn_id number, v_table_route_id number) is
141: select pqh_generic.get_alias(upper(att.column_name)) column_name
142: , upper(att.column_type) column_type
143: , upper(sat1.ddf_column_name) ddf_column_name
144: , sat1.context context
145: , sat.context context_s
160: and sat.enable_flag = 'Y'
161: and sat1.enable_flag = 'Y'
162: and cet.copy_entity_txn_id = v_copy_entity_txn_id
163: and sat.context = sat1.context -- application_id
164: and sat.context = pqh_generic.g_gbl_context
165: and sat1.ddf_column_name is not null ;
166: --
167: cursor c_status(v_status in varchar2) is
168: select status
187: and c.txn_category_attribute_id = s.txn_category_attribute_id
188: and a.enable_flag = 'Y'
189: and c.select_flag = 'Y'
190: and s.enable_flag = 'Y'
191: and s.context = pqh_generic.g_gbl_context
192: and s.attribute_type_cd in ('SELECT', 'PARAMETER','DISPLAY')
193: and a.column_name like 'DATETRACK%MODE%'
194: and s.ddf_column_name is not null
195: and rownum < 2;
330: l_effective_date := rec1.effective_date ;
331: --
332: l_context := rec1.context ;
333: --
334: pqh_generic.g_context := l_context ;
335: --
336: pqh_generic.g_txn_id := p_copy_entity_txn_id ;
337: --
338: pqh_generic.g_gbl_context := rec1.gbl_context ;
332: l_context := rec1.context ;
333: --
334: pqh_generic.g_context := l_context ;
335: --
336: pqh_generic.g_txn_id := p_copy_entity_txn_id ;
337: --
338: pqh_generic.g_gbl_context := rec1.gbl_context ;
339: l_dt_mode := rec1.dt_mode;
340: --
334: pqh_generic.g_context := l_context ;
335: --
336: pqh_generic.g_txn_id := p_copy_entity_txn_id ;
337: --
338: pqh_generic.g_gbl_context := rec1.gbl_context ;
339: l_dt_mode := rec1.dt_mode;
340: --
341: for i in c_dt loop
342: execute immediate 'update pqh_copy_entity_results set '||i.ddf_column_name||' = '''||rec1.dt_mode
395: update pqh_copy_entity_results
396: set status = 'COMPLETED'
397: where copy_entity_result_id = rec2.copy_entity_result_id ;
398: --
399: pqh_generic.g_result_id := rec2.copy_entity_result_id ;
400: l_reset_flag := 'Y' ;
401: --
402: pqh_process_batch_log.set_context_level (p_txn_id => rec2.src_copy_entity_result_id,
403: p_txn_table_route_id => l_cer1,-- trt for source
471: hr_utility.set_location(l_proc||' : after attribs', 111);
472: --
473: -- the following loop is only for debugging purposes
474: --
475: for i in nvl(PQH_GENERIC.g_source_pk_table.first,0)..nvl(PQH_GENERIC.g_source_pk_table.last,-1) loop
476: begin
477: hr_utility.set_location(i||'S- '||PQH_GENERIC.g_source_pk_table(i).column_name||'- '
478: || PQH_GENERIC.g_source_pk_table(i).column_type||'- '
479: || PQH_GENERIC.g_source_pk_table(i).value,11);
473: -- the following loop is only for debugging purposes
474: --
475: for i in nvl(PQH_GENERIC.g_source_pk_table.first,0)..nvl(PQH_GENERIC.g_source_pk_table.last,-1) loop
476: begin
477: hr_utility.set_location(i||'S- '||PQH_GENERIC.g_source_pk_table(i).column_name||'- '
478: || PQH_GENERIC.g_source_pk_table(i).column_type||'- '
479: || PQH_GENERIC.g_source_pk_table(i).value,11);
480: hr_utility.set_location(i||'T- '||PQH_GENERIC.g_target_pk_table(i).column_name||'- '
481: || PQH_GENERIC.g_target_pk_table(i).column_type||'- '
474: --
475: for i in nvl(PQH_GENERIC.g_source_pk_table.first,0)..nvl(PQH_GENERIC.g_source_pk_table.last,-1) loop
476: begin
477: hr_utility.set_location(i||'S- '||PQH_GENERIC.g_source_pk_table(i).column_name||'- '
478: || PQH_GENERIC.g_source_pk_table(i).column_type||'- '
479: || PQH_GENERIC.g_source_pk_table(i).value,11);
480: hr_utility.set_location(i||'T- '||PQH_GENERIC.g_target_pk_table(i).column_name||'- '
481: || PQH_GENERIC.g_target_pk_table(i).column_type||'- '
482: || PQH_GENERIC.g_target_pk_table(i).value,11);
475: for i in nvl(PQH_GENERIC.g_source_pk_table.first,0)..nvl(PQH_GENERIC.g_source_pk_table.last,-1) loop
476: begin
477: hr_utility.set_location(i||'S- '||PQH_GENERIC.g_source_pk_table(i).column_name||'- '
478: || PQH_GENERIC.g_source_pk_table(i).column_type||'- '
479: || PQH_GENERIC.g_source_pk_table(i).value,11);
480: hr_utility.set_location(i||'T- '||PQH_GENERIC.g_target_pk_table(i).column_name||'- '
481: || PQH_GENERIC.g_target_pk_table(i).column_type||'- '
482: || PQH_GENERIC.g_target_pk_table(i).value,11);
483: exception when others then null;
476: begin
477: hr_utility.set_location(i||'S- '||PQH_GENERIC.g_source_pk_table(i).column_name||'- '
478: || PQH_GENERIC.g_source_pk_table(i).column_type||'- '
479: || PQH_GENERIC.g_source_pk_table(i).value,11);
480: hr_utility.set_location(i||'T- '||PQH_GENERIC.g_target_pk_table(i).column_name||'- '
481: || PQH_GENERIC.g_target_pk_table(i).column_type||'- '
482: || PQH_GENERIC.g_target_pk_table(i).value,11);
483: exception when others then null;
484: end;
477: hr_utility.set_location(i||'S- '||PQH_GENERIC.g_source_pk_table(i).column_name||'- '
478: || PQH_GENERIC.g_source_pk_table(i).column_type||'- '
479: || PQH_GENERIC.g_source_pk_table(i).value,11);
480: hr_utility.set_location(i||'T- '||PQH_GENERIC.g_target_pk_table(i).column_name||'- '
481: || PQH_GENERIC.g_target_pk_table(i).column_type||'- '
482: || PQH_GENERIC.g_target_pk_table(i).value,11);
483: exception when others then null;
484: end;
485: end loop;
478: || PQH_GENERIC.g_source_pk_table(i).column_type||'- '
479: || PQH_GENERIC.g_source_pk_table(i).value,11);
480: hr_utility.set_location(i||'T- '||PQH_GENERIC.g_target_pk_table(i).column_name||'- '
481: || PQH_GENERIC.g_target_pk_table(i).column_type||'- '
482: || PQH_GENERIC.g_target_pk_table(i).value,11);
483: exception when others then null;
484: end;
485: end loop;
486: --
491: if p_master_required_flag = 'Y' then
492: hr_utility.set_location('on master '||p_master_required_flag, 5);
493: -- start of bug 5052820
494: --
495: if (pqh_generic.g_gbl_context ='Global Position Update'
496: and l_dt_mode ='UPDATE_CHANGE_INSERT') then
497: upd_where :='Y';
498: end if;
499: --
535: and status in ('COMPLETED','DPT_ERR') ;
536: exception
537: when others then
538: hr_utility.set_location('on master exception', 500);
539: pqh_generic.v_err := sqlerrm;
540: Raise_Error(p_copy_entity_result_id => rec2.copy_entity_result_id,
541: p_msg_code => 'ERR:');
542: end ;
543: exit; -- master record is always just one
701: begin
702: hr_utility.trace('Starting.. ');
703: hr_utility.trace(argument1);
704: --
705: pqh_generic.g_calling_mode := 'CONCURRENT' ;
706: pqh_generic.v_err := '';
707: g_conc_warn_flag := false;
708: --
709: generic_fn ( p_copy_entity_txn_id => argument1 );
702: hr_utility.trace('Starting.. ');
703: hr_utility.trace(argument1);
704: --
705: pqh_generic.g_calling_mode := 'CONCURRENT' ;
706: pqh_generic.v_err := '';
707: g_conc_warn_flag := false;
708: --
709: generic_fn ( p_copy_entity_txn_id => argument1 );
710: --
735: , argument2 => p_txn_short_name );
736: return (l_req);
737: end if;
738: --
739: pqh_generic.g_calling_mode := p_calling_mode ;
740: --
741: generic_fn ( p_copy_entity_txn_id => p_copy_entity_txn_id );
742: --
743: return (l_req);
800: and sat.attribute_type_cd = v_attrib_type --SELECT/PARAMETER/PRIMARY_KEY
801: and pa.enable_flag = 'Y'
802: and tca.select_flag = 'Y'
803: and sat.enable_flag = 'Y'
804: and sat.context = pqh_generic.g_gbl_context ;
805: begin
806: --
807: hr_utility.set_location('Entering:'||l_proc, 5);
808: --
860: --
861: -- loop to store values on the target table which would potentially affect the child records
862: --
863:
864: l_pk_val := 'if pqh_generic.g_level = 1 then PQH_GENERIC.g_target_pk_table.delete;'
865: || 'PQH_GENERIC.assign_value(p_column_name => ''L_EFFECTIVE_DATE'''
866: ||' , p_column_type => ''D'''
867: ||' , p_value => L_EFFECTIVE_DATE'
868: ||'); end if; ';
861: -- loop to store values on the target table which would potentially affect the child records
862: --
863:
864: l_pk_val := 'if pqh_generic.g_level = 1 then PQH_GENERIC.g_target_pk_table.delete;'
865: || 'PQH_GENERIC.assign_value(p_column_name => ''L_EFFECTIVE_DATE'''
866: ||' , p_column_type => ''D'''
867: ||' , p_value => L_EFFECTIVE_DATE'
868: ||'); end if; ';
869: --
868: ||'); end if; ';
869: --
870: for e_rec in c_attrib('PRIMARY_KEY') loop
871: l_pk_val := l_pk_val ||
872: ' PQH_GENERIC.assign_value(p_column_name => '''||e_rec.param ||''''
873: ||' , p_column_type => '''||e_rec.column_type ||''''
874: ||' , p_value => ' ||'L_' ||e_rec.param
875: ||'); ' ;
876: end loop; -- c_attrib
875: ||'); ' ;
876: end loop; -- c_attrib
877: --
878: for e_rec in c_attrib('ERROR_KEY') loop
879: l_log := ' pqh_generic.log_error(p_table_route_id => '||p_table_route_id||',p_err_key => L_'|| e_rec.param ||');';
880: --
881: end loop; -- c_attrib
882: --
883: hr_utility.set_location(' '||l_proc||' repl where', 10);
923: if (upd_where='N') then
924: l_set_session := 'declare v_eff_date date;'
925: ||'cursor c1 is select effective_date from fnd_sessions where session_id = userenv(''sessionid''); '
926: ||'begin '
927: ||'l_effective_date := pqh_generic.get_src_effective_date ; '
928: ||'if c1%isopen then close c1; end if; '
929: ||'open c1; fetch c1 into v_eff_date; '
930: ||'if c1%notfound then '
931: ||'insert into fnd_sessions(session_id, effective_date)'
939: else
940: l_set_session := 'declare v_eff_date date;'
941: ||'cursor c1 is select effective_date from fnd_sessions where session_id = userenv(''sessionid''); '
942: ||'begin '
943: ||'l_effective_date := pqh_generic.get_trg_effective_date ; '
944: ||'if c1%isopen then close c1; end if; '
945: ||'open c1; fetch c1 into v_eff_date; '
946: ||'if c1%notfound then '
947: ||'insert into fnd_sessions(session_id, effective_date)'
954:
955: end if;
956: -- bug 5052820 modified the above l_set_session by changing the call to get_trg_effective_date
957:
958: hr_utility.set_location(l_proc||' L_efffective_date: '||to_char(pqh_generic.get_src_effective_date,'MM/DD/RRRR'),51);
959: --
960: /**
961: * Bug Fix: 3032847
962: * Describe: to copy the work choice
983: || '; '
984: || l_pk_val
985: || 'exception '
986: || ' when others then '
987: || ' PQH_GENERIC.g_conc_warn_flag := true; '
988: || ' PQH_GENERIC.v_err := substr(sqlerrm, 1, 4000) ; '
989: || l_log
990: || 'end; '
991: || 'end loop; '
984: || l_pk_val
985: || 'exception '
986: || ' when others then '
987: || ' PQH_GENERIC.g_conc_warn_flag := true; '
988: || ' PQH_GENERIC.v_err := substr(sqlerrm, 1, 4000) ; '
989: || l_log
990: || 'end; '
991: || 'end loop; '
992: || 'end; ' ;
992: || 'end; ' ;
993: --
994: -- trace the dyn statement
995: --
996: hr_utility.trace('BEGIN SPOOL DYN STATEMENT-PQH_GENERIC ');
997:
998: hr_utility.trace(substr(l_l,1,2000 ));
999: hr_utility.trace(substr(l_l,2001,2000 ));
1000: hr_utility.trace(substr(l_l,4001,2000 ));
1011: hr_utility.trace(substr(l_l,26001,2000 ));
1012: hr_utility.trace(substr(l_l,28001,2000 ));
1013: hr_utility.trace(substr(l_l,30001,2000 ));
1014: --hr_utility.trace(' ');
1015: hr_utility.trace('END SPOOL DYN STATEMENT-PQH_GENERIC ');
1016: --
1017: --
1018: -- Build PL/SQL Statement
1019: --
1046: || '; '
1047: || l_pk_val
1048: || 'exception '
1049: || ' when others then '
1050: || ' PQH_GENERIC.v_err := substr(sqlerrm, 1, 4000) ; '
1051: || l_log
1052: || 'end; '
1053: || 'end loop; '
1054: || 'end; ' ;
1052: || 'end; '
1053: || 'end loop; '
1054: || 'end; ' ;
1055: */
1056: hr_utility.set_location(nvl(substr(PQH_GENERIC.v_err,1 ,100),'Completed...'),5);
1057: hr_utility.set_location(nvl(substr(PQH_GENERIC.v_err,100,100),'************'),5);
1058:
1059: end process_copy;
1060:
1053: || 'end loop; '
1054: || 'end; ' ;
1055: */
1056: hr_utility.set_location(nvl(substr(PQH_GENERIC.v_err,1 ,100),'Completed...'),5);
1057: hr_utility.set_location(nvl(substr(PQH_GENERIC.v_err,100,100),'************'),5);
1058:
1059: end process_copy;
1060:
1061: procedure populate_table
1070: --
1071: hr_utility.set_location('Entering :'||g_package||'populate_table ',25);
1072: pqh_refresh_data.g_refresh_tab.delete;
1073: --
1074: for i in nvl(PQH_GENERIC.g_source_pk_table.first,0)..nvl(PQH_GENERIC.g_source_pk_table.last,-1) loop
1075: --
1076: pqh_refresh_data.g_refresh_tab(i).column_name := upper(PQH_GENERIC.g_source_pk_table(i).column_name);
1077: --
1078: l_sr_type := substr(PQH_GENERIC.g_source_pk_table(i).column_type,1,1);
1072: pqh_refresh_data.g_refresh_tab.delete;
1073: --
1074: for i in nvl(PQH_GENERIC.g_source_pk_table.first,0)..nvl(PQH_GENERIC.g_source_pk_table.last,-1) loop
1075: --
1076: pqh_refresh_data.g_refresh_tab(i).column_name := upper(PQH_GENERIC.g_source_pk_table(i).column_name);
1077: --
1078: l_sr_type := substr(PQH_GENERIC.g_source_pk_table(i).column_type,1,1);
1079: --
1080: if l_sr_type = 'D' or l_sr_type = 'd' then
1074: for i in nvl(PQH_GENERIC.g_source_pk_table.first,0)..nvl(PQH_GENERIC.g_source_pk_table.last,-1) loop
1075: --
1076: pqh_refresh_data.g_refresh_tab(i).column_name := upper(PQH_GENERIC.g_source_pk_table(i).column_name);
1077: --
1078: l_sr_type := substr(PQH_GENERIC.g_source_pk_table(i).column_type,1,1);
1079: --
1080: if l_sr_type = 'D' or l_sr_type = 'd' then
1081: --
1082: l_tg_type := 'N';
1080: if l_sr_type = 'D' or l_sr_type = 'd' then
1081: --
1082: l_tg_type := 'N';
1083: --
1084: if length(PQH_GENERIC.g_source_pk_table(i).value) = 10 then
1085: l_tg_val := ' to_date('''||PQH_GENERIC.g_source_pk_table(i).value||''',''MM/DD/RRRR'') ';
1086: else
1087: l_tg_type := 'D';
1088: l_tg_val := PQH_GENERIC.g_source_pk_table(i).value ;
1081: --
1082: l_tg_type := 'N';
1083: --
1084: if length(PQH_GENERIC.g_source_pk_table(i).value) = 10 then
1085: l_tg_val := ' to_date('''||PQH_GENERIC.g_source_pk_table(i).value||''',''MM/DD/RRRR'') ';
1086: else
1087: l_tg_type := 'D';
1088: l_tg_val := PQH_GENERIC.g_source_pk_table(i).value ;
1089: end if; -- if length(g_source_pk_table)
1084: if length(PQH_GENERIC.g_source_pk_table(i).value) = 10 then
1085: l_tg_val := ' to_date('''||PQH_GENERIC.g_source_pk_table(i).value||''',''MM/DD/RRRR'') ';
1086: else
1087: l_tg_type := 'D';
1088: l_tg_val := PQH_GENERIC.g_source_pk_table(i).value ;
1089: end if; -- if length(g_source_pk_table)
1090: --
1091: elsif l_sr_type = 'V' or l_sr_type = 'v' then
1092: --
1090: --
1091: elsif l_sr_type = 'V' or l_sr_type = 'v' then
1092: --
1093: l_tg_type := 'V';
1094: l_tg_val := PQH_GENERIC.g_source_pk_table(i).value ;
1095: else
1096: --
1097: l_tg_type := 'N';
1098: l_tg_val := PQH_GENERIC.g_source_pk_table(i).value ;
1094: l_tg_val := PQH_GENERIC.g_source_pk_table(i).value ;
1095: else
1096: --
1097: l_tg_type := 'N';
1098: l_tg_val := PQH_GENERIC.g_source_pk_table(i).value ;
1099: end if; --if l_sr_type =
1100: --
1101: pqh_refresh_data.g_refresh_tab(i).column_type := l_tg_type;
1102: pqh_refresh_data.g_refresh_tab(i).txn_val := l_tg_val;
1104: pqh_refresh_data.g_refresh_tab(i).main_val := l_tg_val;
1105: pqh_refresh_data.g_refresh_tab(i).refresh_flag := 'N';
1106: pqh_refresh_data.g_refresh_tab(i).updt_flag := 'N';
1107: --
1108: end loop ; --for i in PQH_GENERIC.g_source_pk_table.first..PQH_GENERIC.g_source_pk_table.last loop
1109: hr_utility.set_location('Leaving :'||g_package||'populate_table ',25);
1110: end populate_table;
1111:
1112: procedure Raise_Error(p_copy_entity_result_id in number,
1117: -- update the status with error/warning message
1118: --
1119: rollback ;
1120: --
1121: hr_utility.set_location(pqh_generic.v_err,10);
1122: -- update pqh_copy_entity_results
1123: -- set status = substr(substr(p_msg_code,1,1)||replace(pqh_generic.v_err,'ORA'),1,30)
1124: -- ,number_of_copies = '0'
1125: -- where copy_entity_result_id = p_copy_entity_result_id;
1119: rollback ;
1120: --
1121: hr_utility.set_location(pqh_generic.v_err,10);
1122: -- update pqh_copy_entity_results
1123: -- set status = substr(substr(p_msg_code,1,1)||replace(pqh_generic.v_err,'ORA'),1,30)
1124: -- ,number_of_copies = '0'
1125: -- where copy_entity_result_id = p_copy_entity_result_id;
1126: -- commit;
1127: if pqh_generic.g_calling_mode = 'CONCURRENT' then
1123: -- set status = substr(substr(p_msg_code,1,1)||replace(pqh_generic.v_err,'ORA'),1,30)
1124: -- ,number_of_copies = '0'
1125: -- where copy_entity_result_id = p_copy_entity_result_id;
1126: -- commit;
1127: if pqh_generic.g_calling_mode = 'CONCURRENT' then
1128: fnd_file.new_line (fnd_file.log,1);
1129: fnd_file.put_line (fnd_file.log, p_msg_code);
1130: fnd_file.new_line (fnd_file.log,1);
1131: fnd_file.put_line (fnd_file.log, pqh_generic.v_err);
1127: if pqh_generic.g_calling_mode = 'CONCURRENT' then
1128: fnd_file.new_line (fnd_file.log,1);
1129: fnd_file.put_line (fnd_file.log, p_msg_code);
1130: fnd_file.new_line (fnd_file.log,1);
1131: fnd_file.put_line (fnd_file.log, pqh_generic.v_err);
1132: end if;
1133: pqh_generic.v_err := '';
1134: hr_utility.set_location('**********************',10);
1135: hr_utility.set_location(sqlerrm,10);
1129: fnd_file.put_line (fnd_file.log, p_msg_code);
1130: fnd_file.new_line (fnd_file.log,1);
1131: fnd_file.put_line (fnd_file.log, pqh_generic.v_err);
1132: end if;
1133: pqh_generic.v_err := '';
1134: hr_utility.set_location('**********************',10);
1135: hr_utility.set_location(sqlerrm,10);
1136: hr_utility.set_location('.......Oops..Error !!!',10);
1137: hr_utility.set_location('**********************',10);
1147: -- Assigning a variable with data selected from the database
1148: -- if the target global is populated with a value the same is used
1149: -- else the data from the selected source cursor is used.
1150: --
1151: for i in nvl(PQH_GENERIC.g_target_pk_table.first,0)..nvl(PQH_GENERIC.g_target_pk_table.last,-1) loop
1152: --
1153: -- if instr(upper(p_column_name),upper(PQH_GENERIC.g_target_pk_table(i).column_name)) > 0 then
1154: if upper(PQH_GENERIC.g_target_pk_table(i).column_name) = upper(p_column_name) then
1155: --
1149: -- else the data from the selected source cursor is used.
1150: --
1151: for i in nvl(PQH_GENERIC.g_target_pk_table.first,0)..nvl(PQH_GENERIC.g_target_pk_table.last,-1) loop
1152: --
1153: -- if instr(upper(p_column_name),upper(PQH_GENERIC.g_target_pk_table(i).column_name)) > 0 then
1154: if upper(PQH_GENERIC.g_target_pk_table(i).column_name) = upper(p_column_name) then
1155: --
1156: l_type := substr(PQH_GENERIC.g_target_pk_table(i).column_type,1,1);
1157: --
1150: --
1151: for i in nvl(PQH_GENERIC.g_target_pk_table.first,0)..nvl(PQH_GENERIC.g_target_pk_table.last,-1) loop
1152: --
1153: -- if instr(upper(p_column_name),upper(PQH_GENERIC.g_target_pk_table(i).column_name)) > 0 then
1154: if upper(PQH_GENERIC.g_target_pk_table(i).column_name) = upper(p_column_name) then
1155: --
1156: l_type := substr(PQH_GENERIC.g_target_pk_table(i).column_type,1,1);
1157: --
1158: if l_type = 'D' or l_type = 'd' then
1152: --
1153: -- if instr(upper(p_column_name),upper(PQH_GENERIC.g_target_pk_table(i).column_name)) > 0 then
1154: if upper(PQH_GENERIC.g_target_pk_table(i).column_name) = upper(p_column_name) then
1155: --
1156: l_type := substr(PQH_GENERIC.g_target_pk_table(i).column_type,1,1);
1157: --
1158: if l_type = 'D' or l_type = 'd' then
1159: --
1160: if length(PQH_GENERIC.g_target_pk_table(i).value) = 18 then
1156: l_type := substr(PQH_GENERIC.g_target_pk_table(i).column_type,1,1);
1157: --
1158: if l_type = 'D' or l_type = 'd' then
1159: --
1160: if length(PQH_GENERIC.g_target_pk_table(i).value) = 18 then
1161: l_val := ' to_date('''||PQH_GENERIC.g_target_pk_table(i).value||''',''RRRR/MM/DDHH24:MI:SS'') ';
1162: return('L_'||p_column_name||' := '||l_val||';' );
1163: elsif length(PQH_GENERIC.g_target_pk_table(i).value) = 19 then
1164: l_val := ' to_date('''||PQH_GENERIC.g_target_pk_table(i).value||''',''RRRR/MM/DD HH24:MI:SS'') ';
1157: --
1158: if l_type = 'D' or l_type = 'd' then
1159: --
1160: if length(PQH_GENERIC.g_target_pk_table(i).value) = 18 then
1161: l_val := ' to_date('''||PQH_GENERIC.g_target_pk_table(i).value||''',''RRRR/MM/DDHH24:MI:SS'') ';
1162: return('L_'||p_column_name||' := '||l_val||';' );
1163: elsif length(PQH_GENERIC.g_target_pk_table(i).value) = 19 then
1164: l_val := ' to_date('''||PQH_GENERIC.g_target_pk_table(i).value||''',''RRRR/MM/DD HH24:MI:SS'') ';
1165: return('L_'||p_column_name||' := '||l_val||';' );
1159: --
1160: if length(PQH_GENERIC.g_target_pk_table(i).value) = 18 then
1161: l_val := ' to_date('''||PQH_GENERIC.g_target_pk_table(i).value||''',''RRRR/MM/DDHH24:MI:SS'') ';
1162: return('L_'||p_column_name||' := '||l_val||';' );
1163: elsif length(PQH_GENERIC.g_target_pk_table(i).value) = 19 then
1164: l_val := ' to_date('''||PQH_GENERIC.g_target_pk_table(i).value||''',''RRRR/MM/DD HH24:MI:SS'') ';
1165: return('L_'||p_column_name||' := '||l_val||';' );
1166: elsif length(PQH_GENERIC.g_target_pk_table(i).value) = 10 then
1167: l_val := ' to_date('''||PQH_GENERIC.g_target_pk_table(i).value||''',''MM/DD/RRRR'') ';
1160: if length(PQH_GENERIC.g_target_pk_table(i).value) = 18 then
1161: l_val := ' to_date('''||PQH_GENERIC.g_target_pk_table(i).value||''',''RRRR/MM/DDHH24:MI:SS'') ';
1162: return('L_'||p_column_name||' := '||l_val||';' );
1163: elsif length(PQH_GENERIC.g_target_pk_table(i).value) = 19 then
1164: l_val := ' to_date('''||PQH_GENERIC.g_target_pk_table(i).value||''',''RRRR/MM/DD HH24:MI:SS'') ';
1165: return('L_'||p_column_name||' := '||l_val||';' );
1166: elsif length(PQH_GENERIC.g_target_pk_table(i).value) = 10 then
1167: l_val := ' to_date('''||PQH_GENERIC.g_target_pk_table(i).value||''',''MM/DD/RRRR'') ';
1168: return('L_'||p_column_name||' := '||l_val||';' );
1162: return('L_'||p_column_name||' := '||l_val||';' );
1163: elsif length(PQH_GENERIC.g_target_pk_table(i).value) = 19 then
1164: l_val := ' to_date('''||PQH_GENERIC.g_target_pk_table(i).value||''',''RRRR/MM/DD HH24:MI:SS'') ';
1165: return('L_'||p_column_name||' := '||l_val||';' );
1166: elsif length(PQH_GENERIC.g_target_pk_table(i).value) = 10 then
1167: l_val := ' to_date('''||PQH_GENERIC.g_target_pk_table(i).value||''',''MM/DD/RRRR'') ';
1168: return('L_'||p_column_name||' := '||l_val||';' );
1169: else
1170: l_val := PQH_GENERIC.g_target_pk_table(i).value ;
1163: elsif length(PQH_GENERIC.g_target_pk_table(i).value) = 19 then
1164: l_val := ' to_date('''||PQH_GENERIC.g_target_pk_table(i).value||''',''RRRR/MM/DD HH24:MI:SS'') ';
1165: return('L_'||p_column_name||' := '||l_val||';' );
1166: elsif length(PQH_GENERIC.g_target_pk_table(i).value) = 10 then
1167: l_val := ' to_date('''||PQH_GENERIC.g_target_pk_table(i).value||''',''MM/DD/RRRR'') ';
1168: return('L_'||p_column_name||' := '||l_val||';' );
1169: else
1170: l_val := PQH_GENERIC.g_target_pk_table(i).value ;
1171: return('L_'||p_column_name||' := '''||replace(l_val,'''','''''')||''';' );
1166: elsif length(PQH_GENERIC.g_target_pk_table(i).value) = 10 then
1167: l_val := ' to_date('''||PQH_GENERIC.g_target_pk_table(i).value||''',''MM/DD/RRRR'') ';
1168: return('L_'||p_column_name||' := '||l_val||';' );
1169: else
1170: l_val := PQH_GENERIC.g_target_pk_table(i).value ;
1171: return('L_'||p_column_name||' := '''||replace(l_val,'''','''''')||''';' );
1172: end if; -- if length(g_source_pk_table)
1173: --
1174: elsif (l_type = 'N' or l_type = 'n') and l_val is not null then
1173: --
1174: elsif (l_type = 'N' or l_type = 'n') and l_val is not null then
1175: -- addition of l_val is not null is vide bug 3373486
1176: --
1177: l_val := PQH_GENERIC.g_target_pk_table(i).value ;
1178: return('L_'||p_column_name||' := '||l_val||';' );
1179: --
1180: else
1181: --
1178: return('L_'||p_column_name||' := '||l_val||';' );
1179: --
1180: else
1181: --
1182: l_val := PQH_GENERIC.g_target_pk_table(i).value ;
1183: return('L_'||p_column_name||' := '''||replace(l_val,'''','''''')||''';' );
1184: end if; --if l_type =
1185: --
1186: hr_utility.set_location('assign :'||' := '''||l_val||'''',100);
1204: -- Assigning a variable with data selected from the database
1205: -- if the source global is populated with a value the same is used
1206: -- else the data from the selected source cursor is used.
1207: --
1208: for i in nvl(PQH_GENERIC.g_source_pk_table.first,0)..nvl(PQH_GENERIC.g_source_pk_table.last,-1) loop
1209: --
1210: if upper(PQH_GENERIC.g_source_pk_table(i).column_name) = 'EFFECTIVE_DATE' then
1211: --
1212: l_type := substr(PQH_GENERIC.g_source_pk_table(i).column_type,1,1);
1206: -- else the data from the selected source cursor is used.
1207: --
1208: for i in nvl(PQH_GENERIC.g_source_pk_table.first,0)..nvl(PQH_GENERIC.g_source_pk_table.last,-1) loop
1209: --
1210: if upper(PQH_GENERIC.g_source_pk_table(i).column_name) = 'EFFECTIVE_DATE' then
1211: --
1212: l_type := substr(PQH_GENERIC.g_source_pk_table(i).column_type,1,1);
1213: --
1214: if l_type = 'D' or l_type = 'd' then
1208: for i in nvl(PQH_GENERIC.g_source_pk_table.first,0)..nvl(PQH_GENERIC.g_source_pk_table.last,-1) loop
1209: --
1210: if upper(PQH_GENERIC.g_source_pk_table(i).column_name) = 'EFFECTIVE_DATE' then
1211: --
1212: l_type := substr(PQH_GENERIC.g_source_pk_table(i).column_type,1,1);
1213: --
1214: if l_type = 'D' or l_type = 'd' then
1215: --
1216: if length(PQH_GENERIC.g_source_pk_table(i).value) = 18 then
1212: l_type := substr(PQH_GENERIC.g_source_pk_table(i).column_type,1,1);
1213: --
1214: if l_type = 'D' or l_type = 'd' then
1215: --
1216: if length(PQH_GENERIC.g_source_pk_table(i).value) = 18 then
1217: l_val := to_date(PQH_GENERIC.g_source_pk_table(i).value,'RRRR/MM/DDHH24:MI:SS') ;
1218: return(l_val );
1219: elsif length(PQH_GENERIC.g_source_pk_table(i).value) = 19 then
1220: l_val := to_date(PQH_GENERIC.g_source_pk_table(i).value,'RRRR/MM/DD HH24:MI:SS');
1213: --
1214: if l_type = 'D' or l_type = 'd' then
1215: --
1216: if length(PQH_GENERIC.g_source_pk_table(i).value) = 18 then
1217: l_val := to_date(PQH_GENERIC.g_source_pk_table(i).value,'RRRR/MM/DDHH24:MI:SS') ;
1218: return(l_val );
1219: elsif length(PQH_GENERIC.g_source_pk_table(i).value) = 19 then
1220: l_val := to_date(PQH_GENERIC.g_source_pk_table(i).value,'RRRR/MM/DD HH24:MI:SS');
1221: return(l_val );
1215: --
1216: if length(PQH_GENERIC.g_source_pk_table(i).value) = 18 then
1217: l_val := to_date(PQH_GENERIC.g_source_pk_table(i).value,'RRRR/MM/DDHH24:MI:SS') ;
1218: return(l_val );
1219: elsif length(PQH_GENERIC.g_source_pk_table(i).value) = 19 then
1220: l_val := to_date(PQH_GENERIC.g_source_pk_table(i).value,'RRRR/MM/DD HH24:MI:SS');
1221: return(l_val );
1222: elsif length(PQH_GENERIC.g_source_pk_table(i).value) = 10 then
1223: l_val := to_date(PQH_GENERIC.g_source_pk_table(i).value,'MM/DD/RRRR') ;
1216: if length(PQH_GENERIC.g_source_pk_table(i).value) = 18 then
1217: l_val := to_date(PQH_GENERIC.g_source_pk_table(i).value,'RRRR/MM/DDHH24:MI:SS') ;
1218: return(l_val );
1219: elsif length(PQH_GENERIC.g_source_pk_table(i).value) = 19 then
1220: l_val := to_date(PQH_GENERIC.g_source_pk_table(i).value,'RRRR/MM/DD HH24:MI:SS');
1221: return(l_val );
1222: elsif length(PQH_GENERIC.g_source_pk_table(i).value) = 10 then
1223: l_val := to_date(PQH_GENERIC.g_source_pk_table(i).value,'MM/DD/RRRR') ;
1224: return(l_val );
1218: return(l_val );
1219: elsif length(PQH_GENERIC.g_source_pk_table(i).value) = 19 then
1220: l_val := to_date(PQH_GENERIC.g_source_pk_table(i).value,'RRRR/MM/DD HH24:MI:SS');
1221: return(l_val );
1222: elsif length(PQH_GENERIC.g_source_pk_table(i).value) = 10 then
1223: l_val := to_date(PQH_GENERIC.g_source_pk_table(i).value,'MM/DD/RRRR') ;
1224: return(l_val );
1225: else
1226: l_val := PQH_GENERIC.g_source_pk_table(i).value ;
1219: elsif length(PQH_GENERIC.g_source_pk_table(i).value) = 19 then
1220: l_val := to_date(PQH_GENERIC.g_source_pk_table(i).value,'RRRR/MM/DD HH24:MI:SS');
1221: return(l_val );
1222: elsif length(PQH_GENERIC.g_source_pk_table(i).value) = 10 then
1223: l_val := to_date(PQH_GENERIC.g_source_pk_table(i).value,'MM/DD/RRRR') ;
1224: return(l_val );
1225: else
1226: l_val := PQH_GENERIC.g_source_pk_table(i).value ;
1227: return(l_val );
1222: elsif length(PQH_GENERIC.g_source_pk_table(i).value) = 10 then
1223: l_val := to_date(PQH_GENERIC.g_source_pk_table(i).value,'MM/DD/RRRR') ;
1224: return(l_val );
1225: else
1226: l_val := PQH_GENERIC.g_source_pk_table(i).value ;
1227: return(l_val );
1228: end if; -- if length(g_source_pk_table)
1229: --
1230: else
1249: --
1250: IF ( l_eff_date IS NOT NULL ) THEN
1251: RETURN (l_eff_date);
1252: ELSE
1253: RETURN (pqh_generic.get_src_effective_date);
1254: end if;
1255: exception when others then
1256: return(l_val);
1257: end get_trg_effective_date ;
1278: --
1279: if upper(p_source_flag) = 'Y' then
1280: --
1281: if p_reset_flag = 'Y' then
1282: PQH_GENERIC.g_target_pk_table.delete;
1283: --
1284: end if; -- p_reset_flag = 'Y'
1285: --
1286: if nvl(PQH_GENERIC.g_source_pk_table.last,0) <> 0 then
1282: PQH_GENERIC.g_target_pk_table.delete;
1283: --
1284: end if; -- p_reset_flag = 'Y'
1285: --
1286: if nvl(PQH_GENERIC.g_source_pk_table.last,0) <> 0 then
1287: for i in PQH_GENERIC.g_source_pk_table.first..PQH_GENERIC.g_source_pk_table.last loop
1288: if PQH_GENERIC.g_source_pk_table(i).column_name = upper(p_column_name) then
1289: PQH_GENERIC.g_source_pk_table(i).column_name := upper(p_column_name) ;
1290: PQH_GENERIC.g_source_pk_table(i).column_type := upper(p_column_type) ;
1283: --
1284: end if; -- p_reset_flag = 'Y'
1285: --
1286: if nvl(PQH_GENERIC.g_source_pk_table.last,0) <> 0 then
1287: for i in PQH_GENERIC.g_source_pk_table.first..PQH_GENERIC.g_source_pk_table.last loop
1288: if PQH_GENERIC.g_source_pk_table(i).column_name = upper(p_column_name) then
1289: PQH_GENERIC.g_source_pk_table(i).column_name := upper(p_column_name) ;
1290: PQH_GENERIC.g_source_pk_table(i).column_type := upper(p_column_type) ;
1291: PQH_GENERIC.g_source_pk_table(i).value := p_value ;
1284: end if; -- p_reset_flag = 'Y'
1285: --
1286: if nvl(PQH_GENERIC.g_source_pk_table.last,0) <> 0 then
1287: for i in PQH_GENERIC.g_source_pk_table.first..PQH_GENERIC.g_source_pk_table.last loop
1288: if PQH_GENERIC.g_source_pk_table(i).column_name = upper(p_column_name) then
1289: PQH_GENERIC.g_source_pk_table(i).column_name := upper(p_column_name) ;
1290: PQH_GENERIC.g_source_pk_table(i).column_type := upper(p_column_type) ;
1291: PQH_GENERIC.g_source_pk_table(i).value := p_value ;
1292: l_check := false ;
1285: --
1286: if nvl(PQH_GENERIC.g_source_pk_table.last,0) <> 0 then
1287: for i in PQH_GENERIC.g_source_pk_table.first..PQH_GENERIC.g_source_pk_table.last loop
1288: if PQH_GENERIC.g_source_pk_table(i).column_name = upper(p_column_name) then
1289: PQH_GENERIC.g_source_pk_table(i).column_name := upper(p_column_name) ;
1290: PQH_GENERIC.g_source_pk_table(i).column_type := upper(p_column_type) ;
1291: PQH_GENERIC.g_source_pk_table(i).value := p_value ;
1292: l_check := false ;
1293: exit;
1286: if nvl(PQH_GENERIC.g_source_pk_table.last,0) <> 0 then
1287: for i in PQH_GENERIC.g_source_pk_table.first..PQH_GENERIC.g_source_pk_table.last loop
1288: if PQH_GENERIC.g_source_pk_table(i).column_name = upper(p_column_name) then
1289: PQH_GENERIC.g_source_pk_table(i).column_name := upper(p_column_name) ;
1290: PQH_GENERIC.g_source_pk_table(i).column_type := upper(p_column_type) ;
1291: PQH_GENERIC.g_source_pk_table(i).value := p_value ;
1292: l_check := false ;
1293: exit;
1294: end if; --PL Table Check
1287: for i in PQH_GENERIC.g_source_pk_table.first..PQH_GENERIC.g_source_pk_table.last loop
1288: if PQH_GENERIC.g_source_pk_table(i).column_name = upper(p_column_name) then
1289: PQH_GENERIC.g_source_pk_table(i).column_name := upper(p_column_name) ;
1290: PQH_GENERIC.g_source_pk_table(i).column_type := upper(p_column_type) ;
1291: PQH_GENERIC.g_source_pk_table(i).value := p_value ;
1292: l_check := false ;
1293: exit;
1294: end if; --PL Table Check
1295: end loop; -- source PL table loop
1295: end loop; -- source PL table loop
1296: end if;
1297: --
1298: if l_check then
1299: l_count := nvl(PQH_GENERIC.g_source_pk_table.last,0);
1300: PQH_GENERIC.g_source_pk_table(l_count+1).column_name := upper(p_column_name) ;
1301: PQH_GENERIC.g_source_pk_table(l_count+1).column_type := upper(p_column_type) ;
1302: PQH_GENERIC.g_source_pk_table(l_count+1).value := p_value ;
1303: end if; -- l_check
1296: end if;
1297: --
1298: if l_check then
1299: l_count := nvl(PQH_GENERIC.g_source_pk_table.last,0);
1300: PQH_GENERIC.g_source_pk_table(l_count+1).column_name := upper(p_column_name) ;
1301: PQH_GENERIC.g_source_pk_table(l_count+1).column_type := upper(p_column_type) ;
1302: PQH_GENERIC.g_source_pk_table(l_count+1).value := p_value ;
1303: end if; -- l_check
1304: else
1297: --
1298: if l_check then
1299: l_count := nvl(PQH_GENERIC.g_source_pk_table.last,0);
1300: PQH_GENERIC.g_source_pk_table(l_count+1).column_name := upper(p_column_name) ;
1301: PQH_GENERIC.g_source_pk_table(l_count+1).column_type := upper(p_column_type) ;
1302: PQH_GENERIC.g_source_pk_table(l_count+1).value := p_value ;
1303: end if; -- l_check
1304: else
1305: --
1298: if l_check then
1299: l_count := nvl(PQH_GENERIC.g_source_pk_table.last,0);
1300: PQH_GENERIC.g_source_pk_table(l_count+1).column_name := upper(p_column_name) ;
1301: PQH_GENERIC.g_source_pk_table(l_count+1).column_type := upper(p_column_type) ;
1302: PQH_GENERIC.g_source_pk_table(l_count+1).value := p_value ;
1303: end if; -- l_check
1304: else
1305: --
1306: -- start of the bug 5052820
1310: end if;
1311: --
1312: -- end of the bug 5052820
1313: if p_reset_flag = 'Y' then
1314: PQH_GENERIC.g_target_pk_table.delete;
1315: --
1316: end if; -- p_reset_flag = 'Y'
1317: --
1318: if nvl(PQH_GENERIC.g_target_pk_table.last,0) <> 0 then
1314: PQH_GENERIC.g_target_pk_table.delete;
1315: --
1316: end if; -- p_reset_flag = 'Y'
1317: --
1318: if nvl(PQH_GENERIC.g_target_pk_table.last,0) <> 0 then
1319: for i in PQH_GENERIC.g_target_pk_table.first..PQH_GENERIC.g_target_pk_table.last loop
1320: if PQH_GENERIC.g_target_pk_table(i).column_name = upper(p_column_name) then
1321: PQH_GENERIC.g_target_pk_table(i).column_name := upper(p_column_name) ;
1322: PQH_GENERIC.g_target_pk_table(i).column_type := upper(p_column_type) ;
1315: --
1316: end if; -- p_reset_flag = 'Y'
1317: --
1318: if nvl(PQH_GENERIC.g_target_pk_table.last,0) <> 0 then
1319: for i in PQH_GENERIC.g_target_pk_table.first..PQH_GENERIC.g_target_pk_table.last loop
1320: if PQH_GENERIC.g_target_pk_table(i).column_name = upper(p_column_name) then
1321: PQH_GENERIC.g_target_pk_table(i).column_name := upper(p_column_name) ;
1322: PQH_GENERIC.g_target_pk_table(i).column_type := upper(p_column_type) ;
1323: PQH_GENERIC.g_target_pk_table(i).value := p_value ;
1316: end if; -- p_reset_flag = 'Y'
1317: --
1318: if nvl(PQH_GENERIC.g_target_pk_table.last,0) <> 0 then
1319: for i in PQH_GENERIC.g_target_pk_table.first..PQH_GENERIC.g_target_pk_table.last loop
1320: if PQH_GENERIC.g_target_pk_table(i).column_name = upper(p_column_name) then
1321: PQH_GENERIC.g_target_pk_table(i).column_name := upper(p_column_name) ;
1322: PQH_GENERIC.g_target_pk_table(i).column_type := upper(p_column_type) ;
1323: PQH_GENERIC.g_target_pk_table(i).value := p_value ;
1324: l_check := false ;
1317: --
1318: if nvl(PQH_GENERIC.g_target_pk_table.last,0) <> 0 then
1319: for i in PQH_GENERIC.g_target_pk_table.first..PQH_GENERIC.g_target_pk_table.last loop
1320: if PQH_GENERIC.g_target_pk_table(i).column_name = upper(p_column_name) then
1321: PQH_GENERIC.g_target_pk_table(i).column_name := upper(p_column_name) ;
1322: PQH_GENERIC.g_target_pk_table(i).column_type := upper(p_column_type) ;
1323: PQH_GENERIC.g_target_pk_table(i).value := p_value ;
1324: l_check := false ;
1325: exit;
1318: if nvl(PQH_GENERIC.g_target_pk_table.last,0) <> 0 then
1319: for i in PQH_GENERIC.g_target_pk_table.first..PQH_GENERIC.g_target_pk_table.last loop
1320: if PQH_GENERIC.g_target_pk_table(i).column_name = upper(p_column_name) then
1321: PQH_GENERIC.g_target_pk_table(i).column_name := upper(p_column_name) ;
1322: PQH_GENERIC.g_target_pk_table(i).column_type := upper(p_column_type) ;
1323: PQH_GENERIC.g_target_pk_table(i).value := p_value ;
1324: l_check := false ;
1325: exit;
1326: end if; --PL Table Check
1319: for i in PQH_GENERIC.g_target_pk_table.first..PQH_GENERIC.g_target_pk_table.last loop
1320: if PQH_GENERIC.g_target_pk_table(i).column_name = upper(p_column_name) then
1321: PQH_GENERIC.g_target_pk_table(i).column_name := upper(p_column_name) ;
1322: PQH_GENERIC.g_target_pk_table(i).column_type := upper(p_column_type) ;
1323: PQH_GENERIC.g_target_pk_table(i).value := p_value ;
1324: l_check := false ;
1325: exit;
1326: end if; --PL Table Check
1327: end loop; --target PL table loop
1327: end loop; --target PL table loop
1328: end if;
1329: --
1330: if l_check then
1331: l_count := nvl(PQH_GENERIC.g_target_pk_table.last,0);
1332: PQH_GENERIC.g_target_pk_table(l_count+1).column_name := upper(p_column_name) ;
1333: PQH_GENERIC.g_target_pk_table(l_count+1).column_type := upper(p_column_type) ;
1334: PQH_GENERIC.g_target_pk_table(l_count+1).value := p_value ;
1335: end if; --l_check
1328: end if;
1329: --
1330: if l_check then
1331: l_count := nvl(PQH_GENERIC.g_target_pk_table.last,0);
1332: PQH_GENERIC.g_target_pk_table(l_count+1).column_name := upper(p_column_name) ;
1333: PQH_GENERIC.g_target_pk_table(l_count+1).column_type := upper(p_column_type) ;
1334: PQH_GENERIC.g_target_pk_table(l_count+1).value := p_value ;
1335: end if; --l_check
1336: end if; -- p_source_flag = 'Y'
1329: --
1330: if l_check then
1331: l_count := nvl(PQH_GENERIC.g_target_pk_table.last,0);
1332: PQH_GENERIC.g_target_pk_table(l_count+1).column_name := upper(p_column_name) ;
1333: PQH_GENERIC.g_target_pk_table(l_count+1).column_type := upper(p_column_type) ;
1334: PQH_GENERIC.g_target_pk_table(l_count+1).value := p_value ;
1335: end if; --l_check
1336: end if; -- p_source_flag = 'Y'
1337: --
1330: if l_check then
1331: l_count := nvl(PQH_GENERIC.g_target_pk_table.last,0);
1332: PQH_GENERIC.g_target_pk_table(l_count+1).column_name := upper(p_column_name) ;
1333: PQH_GENERIC.g_target_pk_table(l_count+1).column_type := upper(p_column_type) ;
1334: PQH_GENERIC.g_target_pk_table(l_count+1).value := p_value ;
1335: end if; --l_check
1336: end if; -- p_source_flag = 'Y'
1337: --
1338: hr_utility.set_location('Leaving : '||g_package||'assign_value ',15);
1359: || 'where cer.copy_entity_result_id = '||p_copy_entity_result_id ||' '
1360: || 'and cer.copy_entity_txn_id = '||p_copy_entity_txn_id ||'; '
1361: || 'begin '
1362: || 'for i in c1 loop '
1363: || 'pqh_generic.assign_value( p_column_name => '''|| p_column_name ||''''
1364: || ',p_column_type => '''|| p_column_type ||''''
1365: || ',p_value => i.value '
1366: || ',p_reset_flag => '''|| p_reset_flag ||''''
1367: || ',p_source_flag => '''|| p_source_flag ||''' ); '
1442: --
1443: procedure log_error (p_table_route_id in varchar2 ,
1444: p_err_key in varchar2 ) is
1445: --
1446: l_calling_mode varchar2(60) := pqh_generic.g_calling_mode;
1447: l_copy_entity_result_id number := nvl(pqh_generic.g_result_id,-999.00);
1448: l_src_copy_entity_result_id number ;
1449: l_status varchar2(30) ;
1450: --
1443: procedure log_error (p_table_route_id in varchar2 ,
1444: p_err_key in varchar2 ) is
1445: --
1446: l_calling_mode varchar2(60) := pqh_generic.g_calling_mode;
1447: l_copy_entity_result_id number := nvl(pqh_generic.g_result_id,-999.00);
1448: l_src_copy_entity_result_id number ;
1449: l_status varchar2(30) ;
1450: --
1451: cursor c_tgt is
1475: hr_utility.trace('Err :'||substr(v_err,1,255));
1476: hr_utility.trace('Err :'||substr(v_err,255,255));
1477: hr_utility.trace('Err :'||substr(v_err,510,255));
1478: --
1479: if nvl(pqh_generic.g_level,1) = 2 then
1480: pqh_process_batch_log.set_context_level (p_txn_id => nvl(p_err_key, l_copy_entity_result_id),
1481: p_txn_table_route_id => p_table_route_id,
1482: p_level => 3,
1483: p_log_context => p_err_key);
1482: p_level => 3,
1483: p_log_context => p_err_key);
1484: --
1485: pqh_process_batch_log.insert_log ( p_message_type_cd => 'ERROR',
1486: p_message_text => pqh_generic.v_err );
1487: --
1488: l_status := 'DPT_ERR' ;
1489: update pqh_copy_entity_results
1490: set status = 'DPT_ERR',
1498: -- p_level => 2,
1499: -- p_log_context => l_copy_entity_result_id );
1500: --
1501: pqh_process_batch_log.insert_log ( p_message_type_cd => 'ERROR',
1502: p_message_text => pqh_generic.v_err );
1503: --
1504: l_status := 'TGT_ERR' ;
1505: update pqh_copy_entity_results
1506: set status = 'TGT_ERR'
1524: and status <> 'TGT_ERR';
1525: --
1526: end loop;
1527: --
1528: pqh_generic.v_err := '';
1529: --
1530: end log_error;
1531: --
1532: end PQH_GENERIC;
1528: pqh_generic.v_err := '';
1529: --
1530: end log_error;
1531: --
1532: end PQH_GENERIC;