40:
41: iRow_count NUMBER := p_source_tbl.count;
42: iDebug NUMBER := 0;
43: BEGIN
44: EC_DEBUG.PUSH('ece_extract_utils_pub.select_clause');
45: if EC_DEBUG.G_debug_level >= 2 then
46: EC_DEBUG.PL(3, 'cTransaction_Type : ',cTransaction_Type);
47: EC_DEBUG.PL(3, 'cCommunication_Method: ',cCommunication_Method);
48: end if;
41: iRow_count NUMBER := p_source_tbl.count;
42: iDebug NUMBER := 0;
43: BEGIN
44: EC_DEBUG.PUSH('ece_extract_utils_pub.select_clause');
45: if EC_DEBUG.G_debug_level >= 2 then
46: EC_DEBUG.PL(3, 'cTransaction_Type : ',cTransaction_Type);
47: EC_DEBUG.PL(3, 'cCommunication_Method: ',cCommunication_Method);
48: end if;
49:
42: iDebug NUMBER := 0;
43: BEGIN
44: EC_DEBUG.PUSH('ece_extract_utils_pub.select_clause');
45: if EC_DEBUG.G_debug_level >= 2 then
46: EC_DEBUG.PL(3, 'cTransaction_Type : ',cTransaction_Type);
47: EC_DEBUG.PL(3, 'cCommunication_Method: ',cCommunication_Method);
48: end if;
49:
50: xProgress := 'EXTUB-10-1020';
43: BEGIN
44: EC_DEBUG.PUSH('ece_extract_utils_pub.select_clause');
45: if EC_DEBUG.G_debug_level >= 2 then
46: EC_DEBUG.PL(3, 'cTransaction_Type : ',cTransaction_Type);
47: EC_DEBUG.PL(3, 'cCommunication_Method: ',cCommunication_Method);
48: end if;
49:
50: xProgress := 'EXTUB-10-1020';
51: For i in 1..iRow_count loop
61: if 'DATE' = p_source_tbl(i).data_type Then
62: xProgress := 'EXTUB-10-1050';
63: cWord1 := cTO_CHAR;
64: cWord2 := cDATE;
65: if EC_DEBUG.G_debug_level >= 2 then
66: EC_DEBUG.PL(3, 'cWord1: ',cWord1);
67: EC_DEBUG.PL(3, 'cWord2: ',cWord2);
68: end if;
69: elsif 'NUMBER' = p_source_tbl(i).data_type Then
62: xProgress := 'EXTUB-10-1050';
63: cWord1 := cTO_CHAR;
64: cWord2 := cDATE;
65: if EC_DEBUG.G_debug_level >= 2 then
66: EC_DEBUG.PL(3, 'cWord1: ',cWord1);
67: EC_DEBUG.PL(3, 'cWord2: ',cWord2);
68: end if;
69: elsif 'NUMBER' = p_source_tbl(i).data_type Then
70: xProgress := 'EXTUB-10-1060';
63: cWord1 := cTO_CHAR;
64: cWord2 := cDATE;
65: if EC_DEBUG.G_debug_level >= 2 then
66: EC_DEBUG.PL(3, 'cWord1: ',cWord1);
67: EC_DEBUG.PL(3, 'cWord2: ',cWord2);
68: end if;
69: elsif 'NUMBER' = p_source_tbl(i).data_type Then
70: xProgress := 'EXTUB-10-1060';
71: cWord1 := cTO_CHAR;
69: elsif 'NUMBER' = p_source_tbl(i).data_type Then
70: xProgress := 'EXTUB-10-1060';
71: cWord1 := cTO_CHAR;
72: cWord2 := ')';
73: if EC_DEBUG.G_debug_level >= 2 then
74: EC_DEBUG.PL(3, 'cWord1: ',cWord1);
75: EC_DEBUG.PL(3, 'cWord2: ',cWord2);
76: end if;
77: else
70: xProgress := 'EXTUB-10-1060';
71: cWord1 := cTO_CHAR;
72: cWord2 := ')';
73: if EC_DEBUG.G_debug_level >= 2 then
74: EC_DEBUG.PL(3, 'cWord1: ',cWord1);
75: EC_DEBUG.PL(3, 'cWord2: ',cWord2);
76: end if;
77: else
78: xProgress := 'EXTUB-10-1070';
71: cWord1 := cTO_CHAR;
72: cWord2 := ')';
73: if EC_DEBUG.G_debug_level >= 2 then
74: EC_DEBUG.PL(3, 'cWord1: ',cWord1);
75: EC_DEBUG.PL(3, 'cWord2: ',cWord2);
76: end if;
77: else
78: xProgress := 'EXTUB-10-1070';
79: cWord1 := NULL;
82:
83: -- build SELECT statement
84: xProgress := 'EXTUB-10-1080';
85: cSelect_stmt := cSelect_stmt || ' ' || cWord1 || nvl(p_source_tbl(i).base_column_Name,'NULL') || cWord2 || ',';
86: if EC_DEBUG.G_debug_level >= 2 then
87: ec_debug.pl(3,'Counter'||i,p_source_tbl(i).interface_column_name);
88: end if;
89: End Loop;
90:
83: -- build SELECT statement
84: xProgress := 'EXTUB-10-1080';
85: cSelect_stmt := cSelect_stmt || ' ' || cWord1 || nvl(p_source_tbl(i).base_column_Name,'NULL') || cWord2 || ',';
86: if EC_DEBUG.G_debug_level >= 2 then
87: ec_debug.pl(3,'Counter'||i,p_source_tbl(i).interface_column_name);
88: end if;
89: End Loop;
90:
91: -- build FROM, WHERE statements
115: stmt_1 varchar2(2000) := substrb(RTRIM(cSelect_stmt, ','), 1, 2000);
116: stmt_2 varchar2(2000) := substrb(RTRIM(cSelect_stmt, ','), 2001, 2000);
117: stmt_3 varchar2(2000) := substrb(RTRIM(cSelect_stmt, ','), 4001, 2000);
118: begin
119: if EC_DEBUG.G_debug_level >= 2 then
120: EC_DEBUG.PL(3, 'stmt_1: ',stmt_1);
121: EC_DEBUG.PL(3, 'stmt_2: ',stmt_2);
122: EC_DEBUG.PL(3, 'stmt_3: ',stmt_3);
123: end if;
116: stmt_2 varchar2(2000) := substrb(RTRIM(cSelect_stmt, ','), 2001, 2000);
117: stmt_3 varchar2(2000) := substrb(RTRIM(cSelect_stmt, ','), 4001, 2000);
118: begin
119: if EC_DEBUG.G_debug_level >= 2 then
120: EC_DEBUG.PL(3, 'stmt_1: ',stmt_1);
121: EC_DEBUG.PL(3, 'stmt_2: ',stmt_2);
122: EC_DEBUG.PL(3, 'stmt_3: ',stmt_3);
123: end if;
124: insert into ece_error (creation_date, run_id, line_id, text)
117: stmt_3 varchar2(2000) := substrb(RTRIM(cSelect_stmt, ','), 4001, 2000);
118: begin
119: if EC_DEBUG.G_debug_level >= 2 then
120: EC_DEBUG.PL(3, 'stmt_1: ',stmt_1);
121: EC_DEBUG.PL(3, 'stmt_2: ',stmt_2);
122: EC_DEBUG.PL(3, 'stmt_3: ',stmt_3);
123: end if;
124: insert into ece_error (creation_date, run_id, line_id, text)
125: values( sysdate, 76451, ece_error_s.nextval, stmt_1);
118: begin
119: if EC_DEBUG.G_debug_level >= 2 then
120: EC_DEBUG.PL(3, 'stmt_1: ',stmt_1);
121: EC_DEBUG.PL(3, 'stmt_2: ',stmt_2);
122: EC_DEBUG.PL(3, 'stmt_3: ',stmt_3);
123: end if;
124: insert into ece_error (creation_date, run_id, line_id, text)
125: values( sysdate, 76451, ece_error_s.nextval, stmt_1);
126: insert into ece_error (creation_date, run_id, line_id, text)
129: values( sysdate, 76451, ece_error_s.nextval, stmt_3);
130: end;
131: end if;
132:
133: EC_DEBUG.POP('ece_extract_utils_pub.select_clause');
134: exception
135: when others then
136: EC_DEBUG.PL(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL','ECE_EXTRACT_UTILS_PUB.Select_Clause');
137: EC_DEBUG.PL(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL','xProgress');
132:
133: EC_DEBUG.POP('ece_extract_utils_pub.select_clause');
134: exception
135: when others then
136: EC_DEBUG.PL(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL','ECE_EXTRACT_UTILS_PUB.Select_Clause');
137: EC_DEBUG.PL(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL','xProgress');
138: EC_DEBUG.PL(0,'EC','ECE_ERROR_CODE','ERROR_CODE',SQLCODE);
139: EC_DEBUG.PL(0,'EC','ECE_ERROR_MESSAGE','ERROR_MESSAGE',SQLERRM);
140:
133: EC_DEBUG.POP('ece_extract_utils_pub.select_clause');
134: exception
135: when others then
136: EC_DEBUG.PL(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL','ECE_EXTRACT_UTILS_PUB.Select_Clause');
137: EC_DEBUG.PL(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL','xProgress');
138: EC_DEBUG.PL(0,'EC','ECE_ERROR_CODE','ERROR_CODE',SQLCODE);
139: EC_DEBUG.PL(0,'EC','ECE_ERROR_MESSAGE','ERROR_MESSAGE',SQLERRM);
140:
141: EC_DEBUG.PL(0,'EC','ECE_PLSQL_POS_NOT_FOUND','COLUMN_NAME', 'to_char(g_error_count)');
134: exception
135: when others then
136: EC_DEBUG.PL(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL','ECE_EXTRACT_UTILS_PUB.Select_Clause');
137: EC_DEBUG.PL(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL','xProgress');
138: EC_DEBUG.PL(0,'EC','ECE_ERROR_CODE','ERROR_CODE',SQLCODE);
139: EC_DEBUG.PL(0,'EC','ECE_ERROR_MESSAGE','ERROR_MESSAGE',SQLERRM);
140:
141: EC_DEBUG.PL(0,'EC','ECE_PLSQL_POS_NOT_FOUND','COLUMN_NAME', 'to_char(g_error_count)');
142:
135: when others then
136: EC_DEBUG.PL(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL','ECE_EXTRACT_UTILS_PUB.Select_Clause');
137: EC_DEBUG.PL(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL','xProgress');
138: EC_DEBUG.PL(0,'EC','ECE_ERROR_CODE','ERROR_CODE',SQLCODE);
139: EC_DEBUG.PL(0,'EC','ECE_ERROR_MESSAGE','ERROR_MESSAGE',SQLERRM);
140:
141: EC_DEBUG.PL(0,'EC','ECE_PLSQL_POS_NOT_FOUND','COLUMN_NAME', 'to_char(g_error_count)');
142:
143: if g_error_count > 0 then
137: EC_DEBUG.PL(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL','xProgress');
138: EC_DEBUG.PL(0,'EC','ECE_ERROR_CODE','ERROR_CODE',SQLCODE);
139: EC_DEBUG.PL(0,'EC','ECE_ERROR_MESSAGE','ERROR_MESSAGE',SQLERRM);
140:
141: EC_DEBUG.PL(0,'EC','ECE_PLSQL_POS_NOT_FOUND','COLUMN_NAME', 'to_char(g_error_count)');
142:
143: if g_error_count > 0 then
144: EC_DEBUG.PL(0,'EC','ECE_PLSQL_VALUE','VALUE', 'p_apps_tbl(g_error_count).value');
145:
140:
141: EC_DEBUG.PL(0,'EC','ECE_PLSQL_POS_NOT_FOUND','COLUMN_NAME', 'to_char(g_error_count)');
142:
143: if g_error_count > 0 then
144: EC_DEBUG.PL(0,'EC','ECE_PLSQL_VALUE','VALUE', 'p_apps_tbl(g_error_count).value');
145:
146: EC_DEBUG.PL(0,'EC','ECE_PLSQL_DATA_TYPE','DATA_TYPE', 'p_apps_tbl(g_error_count).data_type');
147:
148:
142:
143: if g_error_count > 0 then
144: EC_DEBUG.PL(0,'EC','ECE_PLSQL_VALUE','VALUE', 'p_apps_tbl(g_error_count).value');
145:
146: EC_DEBUG.PL(0,'EC','ECE_PLSQL_DATA_TYPE','DATA_TYPE', 'p_apps_tbl(g_error_count).data_type');
147:
148:
149: EC_DEBUG.PL(0,'EC','ECE_PLSQL_COLUMN_NAME','COLUMN_NAME', 'to_char(g_error_count).base_column_name');
150:
145:
146: EC_DEBUG.PL(0,'EC','ECE_PLSQL_DATA_TYPE','DATA_TYPE', 'p_apps_tbl(g_error_count).data_type');
147:
148:
149: EC_DEBUG.PL(0,'EC','ECE_PLSQL_COLUMN_NAME','COLUMN_NAME', 'to_char(g_error_count).base_column_name');
150:
151: end if;
152: app_exception.raise_exception;
153:
218: cColumn_val CharTable;
219:
220: BEGIN
221:
222: if EC_DEBUG.G_debug_level >= 2 then
223: EC_DEBUG.PUSH('ece_extract_utils_pub.insert_into_interface_tbl');
224: EC_DEBUG.PL(3, 'iRun_id : ',iRun_id);
225: EC_DEBUG.PL(3, 'cTransaction_Type: ',cTransaction_Type);
226: EC_DEBUG.PL(3, 'cCommunication_Method: ',cCommunication_Method);
219:
220: BEGIN
221:
222: if EC_DEBUG.G_debug_level >= 2 then
223: EC_DEBUG.PUSH('ece_extract_utils_pub.insert_into_interface_tbl');
224: EC_DEBUG.PL(3, 'iRun_id : ',iRun_id);
225: EC_DEBUG.PL(3, 'cTransaction_Type: ',cTransaction_Type);
226: EC_DEBUG.PL(3, 'cCommunication_Method: ',cCommunication_Method);
227: EC_DEBUG.PL(3, 'cInterface_Table: ',cInterface_Table);
220: BEGIN
221:
222: if EC_DEBUG.G_debug_level >= 2 then
223: EC_DEBUG.PUSH('ece_extract_utils_pub.insert_into_interface_tbl');
224: EC_DEBUG.PL(3, 'iRun_id : ',iRun_id);
225: EC_DEBUG.PL(3, 'cTransaction_Type: ',cTransaction_Type);
226: EC_DEBUG.PL(3, 'cCommunication_Method: ',cCommunication_Method);
227: EC_DEBUG.PL(3, 'cInterface_Table: ',cInterface_Table);
228: EC_DEBUG.PL(3, 'p_foreign_key: ',p_foreign_key);
221:
222: if EC_DEBUG.G_debug_level >= 2 then
223: EC_DEBUG.PUSH('ece_extract_utils_pub.insert_into_interface_tbl');
224: EC_DEBUG.PL(3, 'iRun_id : ',iRun_id);
225: EC_DEBUG.PL(3, 'cTransaction_Type: ',cTransaction_Type);
226: EC_DEBUG.PL(3, 'cCommunication_Method: ',cCommunication_Method);
227: EC_DEBUG.PL(3, 'cInterface_Table: ',cInterface_Table);
228: EC_DEBUG.PL(3, 'p_foreign_key: ',p_foreign_key);
229: end if;
222: if EC_DEBUG.G_debug_level >= 2 then
223: EC_DEBUG.PUSH('ece_extract_utils_pub.insert_into_interface_tbl');
224: EC_DEBUG.PL(3, 'iRun_id : ',iRun_id);
225: EC_DEBUG.PL(3, 'cTransaction_Type: ',cTransaction_Type);
226: EC_DEBUG.PL(3, 'cCommunication_Method: ',cCommunication_Method);
227: EC_DEBUG.PL(3, 'cInterface_Table: ',cInterface_Table);
228: EC_DEBUG.PL(3, 'p_foreign_key: ',p_foreign_key);
229: end if;
230: xProgress := 'EXTUB-20-1020';
223: EC_DEBUG.PUSH('ece_extract_utils_pub.insert_into_interface_tbl');
224: EC_DEBUG.PL(3, 'iRun_id : ',iRun_id);
225: EC_DEBUG.PL(3, 'cTransaction_Type: ',cTransaction_Type);
226: EC_DEBUG.PL(3, 'cCommunication_Method: ',cCommunication_Method);
227: EC_DEBUG.PL(3, 'cInterface_Table: ',cInterface_Table);
228: EC_DEBUG.PL(3, 'p_foreign_key: ',p_foreign_key);
229: end if;
230: xProgress := 'EXTUB-20-1020';
231: cInsert_stmt := cInsert_stmt || ' ' || cInterface_Table || '( ';
224: EC_DEBUG.PL(3, 'iRun_id : ',iRun_id);
225: EC_DEBUG.PL(3, 'cTransaction_Type: ',cTransaction_Type);
226: EC_DEBUG.PL(3, 'cCommunication_Method: ',cCommunication_Method);
227: EC_DEBUG.PL(3, 'cInterface_Table: ',cInterface_Table);
228: EC_DEBUG.PL(3, 'p_foreign_key: ',p_foreign_key);
229: end if;
230: xProgress := 'EXTUB-20-1020';
231: cInsert_stmt := cInsert_stmt || ' ' || cInterface_Table || '( ';
232: if EC_DEBUG.G_debug_level >= 2 then
228: EC_DEBUG.PL(3, 'p_foreign_key: ',p_foreign_key);
229: end if;
230: xProgress := 'EXTUB-20-1020';
231: cInsert_stmt := cInsert_stmt || ' ' || cInterface_Table || '( ';
232: if EC_DEBUG.G_debug_level >= 2 then
233: EC_DEBUG.PL(3, 'cInsert_stmt: ',cInsert_stmt);
234: end if;
235:
236: xProgress := 'EXTUB-20-1030';
229: end if;
230: xProgress := 'EXTUB-20-1020';
231: cInsert_stmt := cInsert_stmt || ' ' || cInterface_Table || '( ';
232: if EC_DEBUG.G_debug_level >= 2 then
233: EC_DEBUG.PL(3, 'cInsert_stmt: ',cInsert_stmt);
234: end if;
235:
236: xProgress := 'EXTUB-20-1030';
237: l_Row_count := p_source_tbl.count;
234: end if;
235:
236: xProgress := 'EXTUB-20-1030';
237: l_Row_count := p_source_tbl.count;
238: if EC_DEBUG.G_debug_level >= 2 then
239: EC_DEBUG.PL(3, 'l_Row_count: ',l_Row_count);
240: end if;
241:
242: --Bug 2198707
235:
236: xProgress := 'EXTUB-20-1030';
237: l_Row_count := p_source_tbl.count;
238: if EC_DEBUG.G_debug_level >= 2 then
239: EC_DEBUG.PL(3, 'l_Row_count: ',l_Row_count);
240: end if;
241:
242: --Bug 2198707
243: xProgress := 'EXTUB-20-1040';
258: cValue_stmt := RTRIM(cValue_stmt, ',') ||')';
259:
260: xProgress := 'EXTUB-20-1070';
261: cInsert_stmt := cInsert_stmt || cValue_stmt;
262: if EC_DEBUG.G_debug_level = 3 then
263: EC_DEBUG.PL(3, 'cInsert_stmt: ',cInsert_stmt);
264: end if;
265:
266: xProgress := 'EXTUB-20-1080';
259:
260: xProgress := 'EXTUB-20-1070';
261: cInsert_stmt := cInsert_stmt || cValue_stmt;
262: if EC_DEBUG.G_debug_level = 3 then
263: EC_DEBUG.PL(3, 'cInsert_stmt: ',cInsert_stmt);
264: end if;
265:
266: xProgress := 'EXTUB-20-1080';
267: c_Insert_cur := dbms_sql.open_cursor;
264: end if;
265:
266: xProgress := 'EXTUB-20-1080';
267: c_Insert_cur := dbms_sql.open_cursor;
268: if EC_DEBUG.G_debug_level = 3 then
269: EC_DEBUG.PL(3, 'c_Insert_cur: ',c_Insert_cur);
270: end if;
271:
272: xProgress := 'EXTUB-20-1090';
265:
266: xProgress := 'EXTUB-20-1080';
267: c_Insert_cur := dbms_sql.open_cursor;
268: if EC_DEBUG.G_debug_level = 3 then
269: EC_DEBUG.PL(3, 'c_Insert_cur: ',c_Insert_cur);
270: end if;
271:
272: xProgress := 'EXTUB-20-1090';
273: dbms_sql.parse(c_Insert_cur, cInsert_stmt, dbms_sql.native);
363: then
364: xProgress := 'EXTUB-20-1090';
365: cWord1 := cTO_DATE;
366: cWord2 := cDATE;
367: if EC_DEBUG.G_debug_level >= 2 then
368: EC_DEBUG.PL(3, 'cWord1: ',cWord1);
369: EC_DEBUG.PL(3, 'cWord2: ',cWord2);
370: end if;
371: else
364: xProgress := 'EXTUB-20-1090';
365: cWord1 := cTO_DATE;
366: cWord2 := cDATE;
367: if EC_DEBUG.G_debug_level >= 2 then
368: EC_DEBUG.PL(3, 'cWord1: ',cWord1);
369: EC_DEBUG.PL(3, 'cWord2: ',cWord2);
370: end if;
371: else
372: xProgress := 'EXTUB-20-1100';
365: cWord1 := cTO_DATE;
366: cWord2 := cDATE;
367: if EC_DEBUG.G_debug_level >= 2 then
368: EC_DEBUG.PL(3, 'cWord1: ',cWord1);
369: EC_DEBUG.PL(3, 'cWord2: ',cWord2);
370: end if;
371: else
372: xProgress := 'EXTUB-20-1100';
373: cWord1 := cQuote;
371: else
372: xProgress := 'EXTUB-20-1100';
373: cWord1 := cQuote;
374: cWord2 := cQuote;
375: if EC_DEBUG.G_debug_level >= 2 then
376: EC_DEBUG.PL(3, 'cWord1: ',cWord1);
377: EC_DEBUG.PL(3, 'cWord2: ',cWord2);
378: end if;
379: end if;
372: xProgress := 'EXTUB-20-1100';
373: cWord1 := cQuote;
374: cWord2 := cQuote;
375: if EC_DEBUG.G_debug_level >= 2 then
376: EC_DEBUG.PL(3, 'cWord1: ',cWord1);
377: EC_DEBUG.PL(3, 'cWord2: ',cWord2);
378: end if;
379: end if;
380: elsif 'NUMBER' = p_source_tbl(i).data_type
373: cWord1 := cQuote;
374: cWord2 := cQuote;
375: if EC_DEBUG.G_debug_level >= 2 then
376: EC_DEBUG.PL(3, 'cWord1: ',cWord1);
377: EC_DEBUG.PL(3, 'cWord2: ',cWord2);
378: end if;
379: end if;
380: elsif 'NUMBER' = p_source_tbl(i).data_type
381: Then
384: then
385: xProgress := 'EXTUB-20-1120';
386: cWord1 := cTO_NUM;
387: cWord2 := ''')';
388: if EC_DEBUG.G_debug_level >= 2 then
389: EC_DEBUG.PL(3, 'cWord1: ',cWord1);
390: EC_DEBUG.PL(3, 'cWord2: ',cWord2);
391: end if;
392: else
385: xProgress := 'EXTUB-20-1120';
386: cWord1 := cTO_NUM;
387: cWord2 := ''')';
388: if EC_DEBUG.G_debug_level >= 2 then
389: EC_DEBUG.PL(3, 'cWord1: ',cWord1);
390: EC_DEBUG.PL(3, 'cWord2: ',cWord2);
391: end if;
392: else
393: xProgress := 'EXTUB-20-1130';
386: cWord1 := cTO_NUM;
387: cWord2 := ''')';
388: if EC_DEBUG.G_debug_level >= 2 then
389: EC_DEBUG.PL(3, 'cWord1: ',cWord1);
390: EC_DEBUG.PL(3, 'cWord2: ',cWord2);
391: end if;
392: else
393: xProgress := 'EXTUB-20-1130';
394: cWord1 := cQuote;
392: else
393: xProgress := 'EXTUB-20-1130';
394: cWord1 := cQuote;
395: cWord2 := cQuote;
396: if EC_DEBUG.G_debug_level >= 2 then
397: EC_DEBUG.PL(3, 'cWord1: ',cWord1);
398: EC_DEBUG.PL(3, 'cWord2: ',cWord2);
399: end if;
400: end if;
393: xProgress := 'EXTUB-20-1130';
394: cWord1 := cQuote;
395: cWord2 := cQuote;
396: if EC_DEBUG.G_debug_level >= 2 then
397: EC_DEBUG.PL(3, 'cWord1: ',cWord1);
398: EC_DEBUG.PL(3, 'cWord2: ',cWord2);
399: end if;
400: end if;
401:
394: cWord1 := cQuote;
395: cWord2 := cQuote;
396: if EC_DEBUG.G_debug_level >= 2 then
397: EC_DEBUG.PL(3, 'cWord1: ',cWord1);
398: EC_DEBUG.PL(3, 'cWord2: ',cWord2);
399: end if;
400: end if;
401:
402: else
402: else
403: xProgress := 'EXTUB-20-1140';
404: cWord1 := cQuote;
405: cWord2 := cQuote;
406: if EC_DEBUG.G_debug_level >= 2 then
407: EC_DEBUG.PL(3, 'cWord1: ',cWord1);
408: EC_DEBUG.PL(3, 'cWord2: ',cWord2);
409: end if;
410: END if; -- if DATE
403: xProgress := 'EXTUB-20-1140';
404: cWord1 := cQuote;
405: cWord2 := cQuote;
406: if EC_DEBUG.G_debug_level >= 2 then
407: EC_DEBUG.PL(3, 'cWord1: ',cWord1);
408: EC_DEBUG.PL(3, 'cWord2: ',cWord2);
409: end if;
410: END if; -- if DATE
411:
404: cWord1 := cQuote;
405: cWord2 := cQuote;
406: if EC_DEBUG.G_debug_level >= 2 then
407: EC_DEBUG.PL(3, 'cWord1: ',cWord1);
408: EC_DEBUG.PL(3, 'cWord2: ',cWord2);
409: end if;
410: END if; -- if DATE
411:
412: xProgress := 'EXTUB-20-1150';
413: if p_source_tbl(i).Interface_Column_Name = 'RUN_ID' then
414:
415: xProgress := 'EXTUB-20-1160';
416: cValue := to_char(iRun_id);
417: if EC_DEBUG.G_debug_level >= 2 then
418: EC_DEBUG.PL(3, 'cValue: ',cValue);
419: end if;
420: elsif p_source_tbl(i).Interface_Column_Name
421: = 'TRANSACTION_RECORD_ID' then
414:
415: xProgress := 'EXTUB-20-1160';
416: cValue := to_char(iRun_id);
417: if EC_DEBUG.G_debug_level >= 2 then
418: EC_DEBUG.PL(3, 'cValue: ',cValue);
419: end if;
420: elsif p_source_tbl(i).Interface_Column_Name
421: = 'TRANSACTION_RECORD_ID' then
422:
421: = 'TRANSACTION_RECORD_ID' then
422:
423: xProgress := 'EXTUB-20-1170';
424: cValue := to_char(p_foreign_key);
425: if EC_DEBUG.G_debug_level >= 2 then
426: EC_DEBUG.PL(3, 'cValue: ',cValue);
427: end if;
428: else
429:
422:
423: xProgress := 'EXTUB-20-1170';
424: cValue := to_char(p_foreign_key);
425: if EC_DEBUG.G_debug_level >= 2 then
426: EC_DEBUG.PL(3, 'cValue: ',cValue);
427: end if;
428: else
429:
430: xProgress := 'EXTUB-20-1180';
434: replace(cSrc_tbl_val_wo_newl, c_local_chr_13,'');
435: cSrc_tbl_val_wo_tab :=
436: replace(cSrc_tbl_val_wo_frmf, c_local_chr_9,'');
437: cValue := replace(cSrc_tbl_val_wo_tab,'''','''''');
438: if EC_DEBUG.G_debug_level >= 2 then
439: EC_DEBUG.PL(3, 'cValue: ',cValue);
440: end if;
441: end if;
442:
435: cSrc_tbl_val_wo_tab :=
436: replace(cSrc_tbl_val_wo_frmf, c_local_chr_9,'');
437: cValue := replace(cSrc_tbl_val_wo_tab,'''','''''');
438: if EC_DEBUG.G_debug_level >= 2 then
439: EC_DEBUG.PL(3, 'cValue: ',cValue);
440: end if;
441: end if;
442:
443: -- build INSERT statement
459: cValue_stmt := RTRIM(cValue_stmt, ',') ||')';
460:
461: xProgress := 'EXTUB-20-1230';
462: cInsert_stmt := cInsert_stmt || cValue_stmt;
463: if EC_DEBUG.G_debug_level >= 2 then
464: EC_DEBUG.PL(3, 'cInsert_stmt: ',cInsert_stmt);
465: end if;
466: xProgress := 'EXTUB-20-1240';
467: c_Insert_cur := dbms_sql.open_cursor;
460:
461: xProgress := 'EXTUB-20-1230';
462: cInsert_stmt := cInsert_stmt || cValue_stmt;
463: if EC_DEBUG.G_debug_level >= 2 then
464: EC_DEBUG.PL(3, 'cInsert_stmt: ',cInsert_stmt);
465: end if;
466: xProgress := 'EXTUB-20-1240';
467: c_Insert_cur := dbms_sql.open_cursor;
468: if EC_DEBUG.G_debug_level >= 2 then
464: EC_DEBUG.PL(3, 'cInsert_stmt: ',cInsert_stmt);
465: end if;
466: xProgress := 'EXTUB-20-1240';
467: c_Insert_cur := dbms_sql.open_cursor;
468: if EC_DEBUG.G_debug_level >= 2 then
469: EC_DEBUG.PL(3, 'c_Insert_cur: ',c_Insert_cur);
470: end if;
471: xProgress := 'EXTUB-20-1250';
472: dbms_sql.parse(c_Insert_cur, cInsert_stmt, dbms_sql.native);
465: end if;
466: xProgress := 'EXTUB-20-1240';
467: c_Insert_cur := dbms_sql.open_cursor;
468: if EC_DEBUG.G_debug_level >= 2 then
469: EC_DEBUG.PL(3, 'c_Insert_cur: ',c_Insert_cur);
470: end if;
471: xProgress := 'EXTUB-20-1250';
472: dbms_sql.parse(c_Insert_cur, cInsert_stmt, dbms_sql.native);
473: */
473: */
474:
475: xProgress := 'EXTUB-20-1220';
476: dummy := dbms_sql.execute(c_Insert_cur);
477: if EC_DEBUG.G_debug_level >= 2 then
478: EC_DEBUG.PL(3, 'dummy: ',dummy);
479: end if;
480: if (debug_mode_on_insert)
481: then
474:
475: xProgress := 'EXTUB-20-1220';
476: dummy := dbms_sql.execute(c_Insert_cur);
477: if EC_DEBUG.G_debug_level >= 2 then
478: EC_DEBUG.PL(3, 'dummy: ',dummy);
479: end if;
480: if (debug_mode_on_insert)
481: then
482: declare
485: stmt_3 varchar2(2000) := substrb(cInsert_stmt, 4001, 2000);
486: stmt_4 varchar2(2000) := substrb(cInsert_stmt, 6001, 2000);
487: stmt_5 varchar2(2000) := substrb(cInsert_stmt, 8001, 2000);
488: begin
489: if EC_DEBUG.G_debug_level >= 2 then
490: EC_DEBUG.PL(3, 'stmt_1: ',stmt_1);
491: EC_DEBUG.PL(3, 'stmt_2: ',stmt_2);
492: EC_DEBUG.PL(3, 'stmt_3: ',stmt_3);
493: EC_DEBUG.PL(3, 'stmt_4: ',stmt_4);
486: stmt_4 varchar2(2000) := substrb(cInsert_stmt, 6001, 2000);
487: stmt_5 varchar2(2000) := substrb(cInsert_stmt, 8001, 2000);
488: begin
489: if EC_DEBUG.G_debug_level >= 2 then
490: EC_DEBUG.PL(3, 'stmt_1: ',stmt_1);
491: EC_DEBUG.PL(3, 'stmt_2: ',stmt_2);
492: EC_DEBUG.PL(3, 'stmt_3: ',stmt_3);
493: EC_DEBUG.PL(3, 'stmt_4: ',stmt_4);
494: EC_DEBUG.PL(3, 'stmt_5: ',stmt_5);
487: stmt_5 varchar2(2000) := substrb(cInsert_stmt, 8001, 2000);
488: begin
489: if EC_DEBUG.G_debug_level >= 2 then
490: EC_DEBUG.PL(3, 'stmt_1: ',stmt_1);
491: EC_DEBUG.PL(3, 'stmt_2: ',stmt_2);
492: EC_DEBUG.PL(3, 'stmt_3: ',stmt_3);
493: EC_DEBUG.PL(3, 'stmt_4: ',stmt_4);
494: EC_DEBUG.PL(3, 'stmt_5: ',stmt_5);
495: end if;
488: begin
489: if EC_DEBUG.G_debug_level >= 2 then
490: EC_DEBUG.PL(3, 'stmt_1: ',stmt_1);
491: EC_DEBUG.PL(3, 'stmt_2: ',stmt_2);
492: EC_DEBUG.PL(3, 'stmt_3: ',stmt_3);
493: EC_DEBUG.PL(3, 'stmt_4: ',stmt_4);
494: EC_DEBUG.PL(3, 'stmt_5: ',stmt_5);
495: end if;
496: insert into ece_error (run_id, line_id, text) values( 478, ece_error_s.nextval, stmt_1);
489: if EC_DEBUG.G_debug_level >= 2 then
490: EC_DEBUG.PL(3, 'stmt_1: ',stmt_1);
491: EC_DEBUG.PL(3, 'stmt_2: ',stmt_2);
492: EC_DEBUG.PL(3, 'stmt_3: ',stmt_3);
493: EC_DEBUG.PL(3, 'stmt_4: ',stmt_4);
494: EC_DEBUG.PL(3, 'stmt_5: ',stmt_5);
495: end if;
496: insert into ece_error (run_id, line_id, text) values( 478, ece_error_s.nextval, stmt_1);
497: insert into ece_error (run_id, line_id, text) values( 478, ece_error_s.nextval, stmt_2);
490: EC_DEBUG.PL(3, 'stmt_1: ',stmt_1);
491: EC_DEBUG.PL(3, 'stmt_2: ',stmt_2);
492: EC_DEBUG.PL(3, 'stmt_3: ',stmt_3);
493: EC_DEBUG.PL(3, 'stmt_4: ',stmt_4);
494: EC_DEBUG.PL(3, 'stmt_5: ',stmt_5);
495: end if;
496: insert into ece_error (run_id, line_id, text) values( 478, ece_error_s.nextval, stmt_1);
497: insert into ece_error (run_id, line_id, text) values( 478, ece_error_s.nextval, stmt_2);
498: insert into ece_error (run_id, line_id, text) values( 478, ece_error_s.nextval, stmt_3);
504:
505: xProgress := 'EXTUB-20-1230';
506: dbms_sql.close_cursor(c_Insert_cur);
507:
508: if EC_DEBUG.G_debug_level >= 2 then
509: EC_DEBUG.POP('ece_extract_utils_pub.insert_into_interface_tbl');
510: end if;
511: exception
512: when others
505: xProgress := 'EXTUB-20-1230';
506: dbms_sql.close_cursor(c_Insert_cur);
507:
508: if EC_DEBUG.G_debug_level >= 2 then
509: EC_DEBUG.POP('ece_extract_utils_pub.insert_into_interface_tbl');
510: end if;
511: exception
512: when others
513: then
510: end if;
511: exception
512: when others
513: then
514: EC_DEBUG.PL(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL','ECE_EXTRACT_UTILS_PUB.Insert_into_Interface_tbl');
515: EC_DEBUG.PL(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL','xProgress');
516: EC_DEBUG.PL(0,'EC','ECE_ERROR_CODE','ERROR_CODE',SQLCODE);
517: EC_DEBUG.PL(0,'EC','ECE_ERROR_MESSAGE','ERROR_MESSAGE',SQLERRM);
518:
511: exception
512: when others
513: then
514: EC_DEBUG.PL(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL','ECE_EXTRACT_UTILS_PUB.Insert_into_Interface_tbl');
515: EC_DEBUG.PL(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL','xProgress');
516: EC_DEBUG.PL(0,'EC','ECE_ERROR_CODE','ERROR_CODE',SQLCODE);
517: EC_DEBUG.PL(0,'EC','ECE_ERROR_MESSAGE','ERROR_MESSAGE',SQLERRM);
518:
519: EC_DEBUG.PL(0,'EC','ECE_PLSQL_POS_NOT_FOUND','COLUMN_NAME', 'to_char(g_error_count)');
512: when others
513: then
514: EC_DEBUG.PL(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL','ECE_EXTRACT_UTILS_PUB.Insert_into_Interface_tbl');
515: EC_DEBUG.PL(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL','xProgress');
516: EC_DEBUG.PL(0,'EC','ECE_ERROR_CODE','ERROR_CODE',SQLCODE);
517: EC_DEBUG.PL(0,'EC','ECE_ERROR_MESSAGE','ERROR_MESSAGE',SQLERRM);
518:
519: EC_DEBUG.PL(0,'EC','ECE_PLSQL_POS_NOT_FOUND','COLUMN_NAME', 'to_char(g_error_count)');
520:
513: then
514: EC_DEBUG.PL(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL','ECE_EXTRACT_UTILS_PUB.Insert_into_Interface_tbl');
515: EC_DEBUG.PL(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL','xProgress');
516: EC_DEBUG.PL(0,'EC','ECE_ERROR_CODE','ERROR_CODE',SQLCODE);
517: EC_DEBUG.PL(0,'EC','ECE_ERROR_MESSAGE','ERROR_MESSAGE',SQLERRM);
518:
519: EC_DEBUG.PL(0,'EC','ECE_PLSQL_POS_NOT_FOUND','COLUMN_NAME', 'to_char(g_error_count)');
520:
521: if g_error_count > 0 then
515: EC_DEBUG.PL(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL','xProgress');
516: EC_DEBUG.PL(0,'EC','ECE_ERROR_CODE','ERROR_CODE',SQLCODE);
517: EC_DEBUG.PL(0,'EC','ECE_ERROR_MESSAGE','ERROR_MESSAGE',SQLERRM);
518:
519: EC_DEBUG.PL(0,'EC','ECE_PLSQL_POS_NOT_FOUND','COLUMN_NAME', 'to_char(g_error_count)');
520:
521: if g_error_count > 0 then
522: EC_DEBUG.PL(0,'EC','ECE_PLSQL_VALUE','VALUE', 'p_apps_tbl(g_error_count).value');
523:
518:
519: EC_DEBUG.PL(0,'EC','ECE_PLSQL_POS_NOT_FOUND','COLUMN_NAME', 'to_char(g_error_count)');
520:
521: if g_error_count > 0 then
522: EC_DEBUG.PL(0,'EC','ECE_PLSQL_VALUE','VALUE', 'p_apps_tbl(g_error_count).value');
523:
524: EC_DEBUG.PL(0,'EC','ECE_PLSQL_DATA_TYPE','DATA_TYPE', 'p_apps_tbl(g_error_count).data_type');
525:
526:
520:
521: if g_error_count > 0 then
522: EC_DEBUG.PL(0,'EC','ECE_PLSQL_VALUE','VALUE', 'p_apps_tbl(g_error_count).value');
523:
524: EC_DEBUG.PL(0,'EC','ECE_PLSQL_DATA_TYPE','DATA_TYPE', 'p_apps_tbl(g_error_count).data_type');
525:
526:
527: EC_DEBUG.PL(0,'EC','ECE_PLSQL_COLUMN_NAME','COLUMN_NAME', 'to_char(g_error_count).base_column_name');
528:
523:
524: EC_DEBUG.PL(0,'EC','ECE_PLSQL_DATA_TYPE','DATA_TYPE', 'p_apps_tbl(g_error_count).data_type');
525:
526:
527: EC_DEBUG.PL(0,'EC','ECE_PLSQL_COLUMN_NAME','COLUMN_NAME', 'to_char(g_error_count).base_column_name');
528:
529: end if;
530: app_exception.raise_exception;
531:
708: xProgress := 'EXTUB-30-1280';
709: dummy := dbms_sql.execute(p_Insert_cur);
710: exception
711: when others then
712: EC_DEBUG.PL(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL','ECE_EXTRACT_UTILS_PUB.insert_into_prod_interface');
713: EC_DEBUG.PL(0,'EC','ECE_ERROR_CODE','ERROR_CODE',SQLCODE);
714: EC_DEBUG.PL(0,'EC','ECE_ERROR_MESSAGE','ERROR_MESSAGE',SQLERRM);
715: EC_DEBUG.PL(0,'EC','ECE_PLSQL_POS_NOT_FOUND','COLUMN_NAME', g_error_count);
716:
709: dummy := dbms_sql.execute(p_Insert_cur);
710: exception
711: when others then
712: EC_DEBUG.PL(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL','ECE_EXTRACT_UTILS_PUB.insert_into_prod_interface');
713: EC_DEBUG.PL(0,'EC','ECE_ERROR_CODE','ERROR_CODE',SQLCODE);
714: EC_DEBUG.PL(0,'EC','ECE_ERROR_MESSAGE','ERROR_MESSAGE',SQLERRM);
715: EC_DEBUG.PL(0,'EC','ECE_PLSQL_POS_NOT_FOUND','COLUMN_NAME', g_error_count);
716:
717: if g_error_count > 0 then
710: exception
711: when others then
712: EC_DEBUG.PL(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL','ECE_EXTRACT_UTILS_PUB.insert_into_prod_interface');
713: EC_DEBUG.PL(0,'EC','ECE_ERROR_CODE','ERROR_CODE',SQLCODE);
714: EC_DEBUG.PL(0,'EC','ECE_ERROR_MESSAGE','ERROR_MESSAGE',SQLERRM);
715: EC_DEBUG.PL(0,'EC','ECE_PLSQL_POS_NOT_FOUND','COLUMN_NAME', g_error_count);
716:
717: if g_error_count > 0 then
718: EC_DEBUG.PL(0,'EC','ECE_PLSQL_VALUE','VALUE', p_apps_tbl(g_error_count).value);
711: when others then
712: EC_DEBUG.PL(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL','ECE_EXTRACT_UTILS_PUB.insert_into_prod_interface');
713: EC_DEBUG.PL(0,'EC','ECE_ERROR_CODE','ERROR_CODE',SQLCODE);
714: EC_DEBUG.PL(0,'EC','ECE_ERROR_MESSAGE','ERROR_MESSAGE',SQLERRM);
715: EC_DEBUG.PL(0,'EC','ECE_PLSQL_POS_NOT_FOUND','COLUMN_NAME', g_error_count);
716:
717: if g_error_count > 0 then
718: EC_DEBUG.PL(0,'EC','ECE_PLSQL_VALUE','VALUE', p_apps_tbl(g_error_count).value);
719:
714: EC_DEBUG.PL(0,'EC','ECE_ERROR_MESSAGE','ERROR_MESSAGE',SQLERRM);
715: EC_DEBUG.PL(0,'EC','ECE_PLSQL_POS_NOT_FOUND','COLUMN_NAME', g_error_count);
716:
717: if g_error_count > 0 then
718: EC_DEBUG.PL(0,'EC','ECE_PLSQL_VALUE','VALUE', p_apps_tbl(g_error_count).value);
719:
720: EC_DEBUG.PL(0,'EC','ECE_PLSQL_DATA_TYPE','DATA_TYPE', p_apps_tbl(g_error_count).data_type);
721:
722:
716:
717: if g_error_count > 0 then
718: EC_DEBUG.PL(0,'EC','ECE_PLSQL_VALUE','VALUE', p_apps_tbl(g_error_count).value);
719:
720: EC_DEBUG.PL(0,'EC','ECE_PLSQL_DATA_TYPE','DATA_TYPE', p_apps_tbl(g_error_count).data_type);
721:
722:
723: EC_DEBUG.PL(0,'EC','ECE_PLSQL_COLUMN_NAME','COLUMN_NAME', p_apps_tbl(g_error_count).base_column_name);
724: end if;
719:
720: EC_DEBUG.PL(0,'EC','ECE_PLSQL_DATA_TYPE','DATA_TYPE', p_apps_tbl(g_error_count).data_type);
721:
722:
723: EC_DEBUG.PL(0,'EC','ECE_PLSQL_COLUMN_NAME','COLUMN_NAME', p_apps_tbl(g_error_count).base_column_name);
724: end if;
725: raise;
726: end;
727:
781: n_number NUMBER;
782: c_count NUMBER;
783:
784: BEGIN
785: EC_DEBUG.PUSH('ece_extract_utils_pub.insert_into_prod_interface_pvt');
786: if EC_DEBUG.G_debug_level >= 2 then
787: EC_DEBUG.PL(3, 'p_api_version_number : ',p_api_version_number);
788: EC_DEBUG.PL(3, 'p_init_msg_list: ',p_init_msg_list);
789: EC_DEBUG.PL(3, 'p_simulate: ',p_simulate);
782: c_count NUMBER;
783:
784: BEGIN
785: EC_DEBUG.PUSH('ece_extract_utils_pub.insert_into_prod_interface_pvt');
786: if EC_DEBUG.G_debug_level >= 2 then
787: EC_DEBUG.PL(3, 'p_api_version_number : ',p_api_version_number);
788: EC_DEBUG.PL(3, 'p_init_msg_list: ',p_init_msg_list);
789: EC_DEBUG.PL(3, 'p_simulate: ',p_simulate);
790: EC_DEBUG.PL(3, 'p_commit: ',p_commit);
783:
784: BEGIN
785: EC_DEBUG.PUSH('ece_extract_utils_pub.insert_into_prod_interface_pvt');
786: if EC_DEBUG.G_debug_level >= 2 then
787: EC_DEBUG.PL(3, 'p_api_version_number : ',p_api_version_number);
788: EC_DEBUG.PL(3, 'p_init_msg_list: ',p_init_msg_list);
789: EC_DEBUG.PL(3, 'p_simulate: ',p_simulate);
790: EC_DEBUG.PL(3, 'p_commit: ',p_commit);
791: EC_DEBUG.PL(3, 'p_validation_level: ',p_validation_level);
784: BEGIN
785: EC_DEBUG.PUSH('ece_extract_utils_pub.insert_into_prod_interface_pvt');
786: if EC_DEBUG.G_debug_level >= 2 then
787: EC_DEBUG.PL(3, 'p_api_version_number : ',p_api_version_number);
788: EC_DEBUG.PL(3, 'p_init_msg_list: ',p_init_msg_list);
789: EC_DEBUG.PL(3, 'p_simulate: ',p_simulate);
790: EC_DEBUG.PL(3, 'p_commit: ',p_commit);
791: EC_DEBUG.PL(3, 'p_validation_level: ',p_validation_level);
792: EC_DEBUG.PL(3, 'p_interface_table: ',p_interface_table);
785: EC_DEBUG.PUSH('ece_extract_utils_pub.insert_into_prod_interface_pvt');
786: if EC_DEBUG.G_debug_level >= 2 then
787: EC_DEBUG.PL(3, 'p_api_version_number : ',p_api_version_number);
788: EC_DEBUG.PL(3, 'p_init_msg_list: ',p_init_msg_list);
789: EC_DEBUG.PL(3, 'p_simulate: ',p_simulate);
790: EC_DEBUG.PL(3, 'p_commit: ',p_commit);
791: EC_DEBUG.PL(3, 'p_validation_level: ',p_validation_level);
792: EC_DEBUG.PL(3, 'p_interface_table: ',p_interface_table);
793: EC_DEBUG.PL(3, 'p_insert_cur: ',p_insert_cur);
786: if EC_DEBUG.G_debug_level >= 2 then
787: EC_DEBUG.PL(3, 'p_api_version_number : ',p_api_version_number);
788: EC_DEBUG.PL(3, 'p_init_msg_list: ',p_init_msg_list);
789: EC_DEBUG.PL(3, 'p_simulate: ',p_simulate);
790: EC_DEBUG.PL(3, 'p_commit: ',p_commit);
791: EC_DEBUG.PL(3, 'p_validation_level: ',p_validation_level);
792: EC_DEBUG.PL(3, 'p_interface_table: ',p_interface_table);
793: EC_DEBUG.PL(3, 'p_insert_cur: ',p_insert_cur);
794: end if;
787: EC_DEBUG.PL(3, 'p_api_version_number : ',p_api_version_number);
788: EC_DEBUG.PL(3, 'p_init_msg_list: ',p_init_msg_list);
789: EC_DEBUG.PL(3, 'p_simulate: ',p_simulate);
790: EC_DEBUG.PL(3, 'p_commit: ',p_commit);
791: EC_DEBUG.PL(3, 'p_validation_level: ',p_validation_level);
792: EC_DEBUG.PL(3, 'p_interface_table: ',p_interface_table);
793: EC_DEBUG.PL(3, 'p_insert_cur: ',p_insert_cur);
794: end if;
795: -- Standard Start of API savepoint
788: EC_DEBUG.PL(3, 'p_init_msg_list: ',p_init_msg_list);
789: EC_DEBUG.PL(3, 'p_simulate: ',p_simulate);
790: EC_DEBUG.PL(3, 'p_commit: ',p_commit);
791: EC_DEBUG.PL(3, 'p_validation_level: ',p_validation_level);
792: EC_DEBUG.PL(3, 'p_interface_table: ',p_interface_table);
793: EC_DEBUG.PL(3, 'p_insert_cur: ',p_insert_cur);
794: end if;
795: -- Standard Start of API savepoint
796: SAVEPOINT insert_into_prod_interface_pvt;
789: EC_DEBUG.PL(3, 'p_simulate: ',p_simulate);
790: EC_DEBUG.PL(3, 'p_commit: ',p_commit);
791: EC_DEBUG.PL(3, 'p_validation_level: ',p_validation_level);
792: EC_DEBUG.PL(3, 'p_interface_table: ',p_interface_table);
793: EC_DEBUG.PL(3, 'p_insert_cur: ',p_insert_cur);
794: end if;
795: -- Standard Start of API savepoint
796: SAVEPOINT insert_into_prod_interface_pvt;
797:
810: END IF;
811:
812: -- Initialize API return status to success
813: x_return_status := fnd_api.g_ret_sts_success;
814: if EC_DEBUG.G_debug_level >= 2 then
815: EC_DEBUG.PL(3, 'x_return_status: ',x_return_status);
816: end if;
817: IF p_insert_cur = 0 THEN
818: xProgress := 'EXTUB-30-1020';
811:
812: -- Initialize API return status to success
813: x_return_status := fnd_api.g_ret_sts_success;
814: if EC_DEBUG.G_debug_level >= 2 then
815: EC_DEBUG.PL(3, 'x_return_status: ',x_return_status);
816: end if;
817: IF p_insert_cur = 0 THEN
818: xProgress := 'EXTUB-30-1020';
819: p_insert_cur := -911;
822: xProgress := 'EXTUB-30-1030';
823: IF p_insert_cur < 0 THEN
824: xProgress := 'EXTUB-30-1040';
825: cInsert_stmt := cInsert_stmt || ' ' || p_Interface_Table || '(';
826: if EC_DEBUG.G_debug_level >= 2 then
827: EC_DEBUG.PL(3, 'cInsert_stmt: ',cInsert_stmt);
828: end if;
829: xProgress := 'EXTUB-30-1050';
830: FOR i IN 1..p_apps_tbl.COUNT LOOP
823: IF p_insert_cur < 0 THEN
824: xProgress := 'EXTUB-30-1040';
825: cInsert_stmt := cInsert_stmt || ' ' || p_Interface_Table || '(';
826: if EC_DEBUG.G_debug_level >= 2 then
827: EC_DEBUG.PL(3, 'cInsert_stmt: ',cInsert_stmt);
828: end if;
829: xProgress := 'EXTUB-30-1050';
830: FOR i IN 1..p_apps_tbl.COUNT LOOP
831:
841: IF p_apps_tbl(i).base_column_name IS NOT NULL THEN
842: -- build INSERT statement
843: xProgress := 'EXTUB-30-1070';
844: cInsert_stmt := cInsert_stmt || ' ' || p_apps_tbl(i).base_column_name || ',';
845: if EC_DEBUG.G_debug_level >= 2 then
846: EC_DEBUG.PL(3, 'cInsert_stmt: ',cInsert_stmt);
847: end if;
848: xProgress := 'EXTUB-30-1080';
849: cValue_stmt := cValue_stmt || ':b' || i || ',';
842: -- build INSERT statement
843: xProgress := 'EXTUB-30-1070';
844: cInsert_stmt := cInsert_stmt || ' ' || p_apps_tbl(i).base_column_name || ',';
845: if EC_DEBUG.G_debug_level >= 2 then
846: EC_DEBUG.PL(3, 'cInsert_stmt: ',cInsert_stmt);
847: end if;
848: xProgress := 'EXTUB-30-1080';
849: cValue_stmt := cValue_stmt || ':b' || i || ',';
850: if EC_DEBUG.G_debug_level >= 2 then
846: EC_DEBUG.PL(3, 'cInsert_stmt: ',cInsert_stmt);
847: end if;
848: xProgress := 'EXTUB-30-1080';
849: cValue_stmt := cValue_stmt || ':b' || i || ',';
850: if EC_DEBUG.G_debug_level >= 2 then
851: EC_DEBUG.PL(3, 'cValue_stmt: ',cValue_stmt);
852: end if;
853: END IF;
854: END LOOP;
847: end if;
848: xProgress := 'EXTUB-30-1080';
849: cValue_stmt := cValue_stmt || ':b' || i || ',';
850: if EC_DEBUG.G_debug_level >= 2 then
851: EC_DEBUG.PL(3, 'cValue_stmt: ',cValue_stmt);
852: end if;
853: END IF;
854: END LOOP;
855:
854: END LOOP;
855:
856: xProgress := 'EXTUB-30-1090';
857: cInsert_stmt := RTRIM(cInsert_stmt,',') || ') ';
858: if EC_DEBUG.G_debug_level >= 2 then
859: EC_DEBUG.PL(3, 'cInsert_stmt: ',cInsert_stmt);
860: end if;
861: xProgress := 'EXTUB-30-1100';
862: cValue_stmt := RTRIM(cValue_stmt,',') || ')';
855:
856: xProgress := 'EXTUB-30-1090';
857: cInsert_stmt := RTRIM(cInsert_stmt,',') || ') ';
858: if EC_DEBUG.G_debug_level >= 2 then
859: EC_DEBUG.PL(3, 'cInsert_stmt: ',cInsert_stmt);
860: end if;
861: xProgress := 'EXTUB-30-1100';
862: cValue_stmt := RTRIM(cValue_stmt,',') || ')';
863: if EC_DEBUG.G_debug_level >= 2 then
859: EC_DEBUG.PL(3, 'cInsert_stmt: ',cInsert_stmt);
860: end if;
861: xProgress := 'EXTUB-30-1100';
862: cValue_stmt := RTRIM(cValue_stmt,',') || ')';
863: if EC_DEBUG.G_debug_level >= 2 then
864: EC_DEBUG.PL(3, 'cValue_stmt: ',cValue_stmt);
865: end if;
866: xProgress := 'EXTUB-30-1110';
867: cInsert_stmt := cInsert_stmt || cValue_stmt;
860: end if;
861: xProgress := 'EXTUB-30-1100';
862: cValue_stmt := RTRIM(cValue_stmt,',') || ')';
863: if EC_DEBUG.G_debug_level >= 2 then
864: EC_DEBUG.PL(3, 'cValue_stmt: ',cValue_stmt);
865: end if;
866: xProgress := 'EXTUB-30-1110';
867: cInsert_stmt := cInsert_stmt || cValue_stmt;
868: if EC_DEBUG.G_debug_level >= 2 then
864: EC_DEBUG.PL(3, 'cValue_stmt: ',cValue_stmt);
865: end if;
866: xProgress := 'EXTUB-30-1110';
867: cInsert_stmt := cInsert_stmt || cValue_stmt;
868: if EC_DEBUG.G_debug_level >= 2 then
869: EC_DEBUG.PL(3, 'cInsert_stmt: ',cInsert_stmt);
870: end if;
871: xProgress := 'EXTUB-30-1110';
872: p_Insert_cur := dbms_sql.open_cursor;
865: end if;
866: xProgress := 'EXTUB-30-1110';
867: cInsert_stmt := cInsert_stmt || cValue_stmt;
868: if EC_DEBUG.G_debug_level >= 2 then
869: EC_DEBUG.PL(3, 'cInsert_stmt: ',cInsert_stmt);
870: end if;
871: xProgress := 'EXTUB-30-1110';
872: p_Insert_cur := dbms_sql.open_cursor;
873: if EC_DEBUG.G_debug_level >= 2 then
869: EC_DEBUG.PL(3, 'cInsert_stmt: ',cInsert_stmt);
870: end if;
871: xProgress := 'EXTUB-30-1110';
872: p_Insert_cur := dbms_sql.open_cursor;
873: if EC_DEBUG.G_debug_level >= 2 then
874: EC_DEBUG.PL(3, 'p_Insert_cur: ',p_Insert_cur);
875: end if;
876: xProgress := 'EXTUB-30-1120';
877: IF debug_mode_on_prod THEN
870: end if;
871: xProgress := 'EXTUB-30-1110';
872: p_Insert_cur := dbms_sql.open_cursor;
873: if EC_DEBUG.G_debug_level >= 2 then
874: EC_DEBUG.PL(3, 'p_Insert_cur: ',p_Insert_cur);
875: end if;
876: xProgress := 'EXTUB-30-1120';
877: IF debug_mode_on_prod THEN
878: DECLARE
882: stmt_4 VARCHAR2(2000) := SUBSTR(cInsert_stmt,6001,2000);
883: stmt_5 VARCHAR2(2000) := SUBSTR(cInsert_stmt,8001,2000);
884:
885: BEGIN
886: if EC_DEBUG.G_debug_level >= 2 then
887: EC_DEBUG.PL(3, 'stmt_1: ',stmt_1);
888: EC_DEBUG.PL(3, 'stmt_2: ',stmt_2);
889: EC_DEBUG.PL(3, 'stmt_3: ',stmt_3);
890: EC_DEBUG.PL(3, 'stmt_4: ',stmt_4);
883: stmt_5 VARCHAR2(2000) := SUBSTR(cInsert_stmt,8001,2000);
884:
885: BEGIN
886: if EC_DEBUG.G_debug_level >= 2 then
887: EC_DEBUG.PL(3, 'stmt_1: ',stmt_1);
888: EC_DEBUG.PL(3, 'stmt_2: ',stmt_2);
889: EC_DEBUG.PL(3, 'stmt_3: ',stmt_3);
890: EC_DEBUG.PL(3, 'stmt_4: ',stmt_4);
891: EC_DEBUG.PL(3, 'stmt_5: ',stmt_5);
884:
885: BEGIN
886: if EC_DEBUG.G_debug_level >= 2 then
887: EC_DEBUG.PL(3, 'stmt_1: ',stmt_1);
888: EC_DEBUG.PL(3, 'stmt_2: ',stmt_2);
889: EC_DEBUG.PL(3, 'stmt_3: ',stmt_3);
890: EC_DEBUG.PL(3, 'stmt_4: ',stmt_4);
891: EC_DEBUG.PL(3, 'stmt_5: ',stmt_5);
892: end if;
885: BEGIN
886: if EC_DEBUG.G_debug_level >= 2 then
887: EC_DEBUG.PL(3, 'stmt_1: ',stmt_1);
888: EC_DEBUG.PL(3, 'stmt_2: ',stmt_2);
889: EC_DEBUG.PL(3, 'stmt_3: ',stmt_3);
890: EC_DEBUG.PL(3, 'stmt_4: ',stmt_4);
891: EC_DEBUG.PL(3, 'stmt_5: ',stmt_5);
892: end if;
893: INSERT INTO ece_error(run_id,line_id,text) VALUES(78,ece_error_s.NEXTVAL,stmt_1);
886: if EC_DEBUG.G_debug_level >= 2 then
887: EC_DEBUG.PL(3, 'stmt_1: ',stmt_1);
888: EC_DEBUG.PL(3, 'stmt_2: ',stmt_2);
889: EC_DEBUG.PL(3, 'stmt_3: ',stmt_3);
890: EC_DEBUG.PL(3, 'stmt_4: ',stmt_4);
891: EC_DEBUG.PL(3, 'stmt_5: ',stmt_5);
892: end if;
893: INSERT INTO ece_error(run_id,line_id,text) VALUES(78,ece_error_s.NEXTVAL,stmt_1);
894: INSERT INTO ece_error(run_id,line_id,text) VALUES(78,ece_error_s.NEXTVAL,stmt_2);
887: EC_DEBUG.PL(3, 'stmt_1: ',stmt_1);
888: EC_DEBUG.PL(3, 'stmt_2: ',stmt_2);
889: EC_DEBUG.PL(3, 'stmt_3: ',stmt_3);
890: EC_DEBUG.PL(3, 'stmt_4: ',stmt_4);
891: EC_DEBUG.PL(3, 'stmt_5: ',stmt_5);
892: end if;
893: INSERT INTO ece_error(run_id,line_id,text) VALUES(78,ece_error_s.NEXTVAL,stmt_1);
894: INSERT INTO ece_error(run_id,line_id,text) VALUES(78,ece_error_s.NEXTVAL,stmt_2);
895: INSERT INTO ece_error(run_id,line_id,text) VALUES(78,ece_error_s.NEXTVAL,stmt_3);
923: xProgress := 'EXTUB-30-1150';
924: FOR k IN 1..p_apps_tbl.COUNT LOOP
925: xProgress := 'EXTUB-30-1160';
926: g_error_count := k;
927: if EC_DEBUG.G_debug_level >= 2 then
928: EC_DEBUG.PL(3, 'g_error_count: ',g_error_count);
929: end if;
930: xProgress := 'EXTUB-30-1170';
931: IF p_apps_tbl(k).base_column_name IS NOT NULL THEN
924: FOR k IN 1..p_apps_tbl.COUNT LOOP
925: xProgress := 'EXTUB-30-1160';
926: g_error_count := k;
927: if EC_DEBUG.G_debug_level >= 2 then
928: EC_DEBUG.PL(3, 'g_error_count: ',g_error_count);
929: end if;
930: xProgress := 'EXTUB-30-1170';
931: IF p_apps_tbl(k).base_column_name IS NOT NULL THEN
932: xProgress := 'EXTUB-30-1180';
934: xProgress := 'EXTUB-30-1190';
935: IF p_apps_tbl(k).value IS NOT NULL THEN
936: xProgress := 'EXTUB-30-1200';
937: d_date := TO_DATE(p_apps_tbl(k).value,'YYYYMMDD HH24MISS');
938: if EC_DEBUG.G_debug_level >= 2 then
939: EC_DEBUG.PL(3, 'd_date: ',d_date);
940: end if;
941: ELSE
942: xProgress := 'EXTUB-30-1210';
935: IF p_apps_tbl(k).value IS NOT NULL THEN
936: xProgress := 'EXTUB-30-1200';
937: d_date := TO_DATE(p_apps_tbl(k).value,'YYYYMMDD HH24MISS');
938: if EC_DEBUG.G_debug_level >= 2 then
939: EC_DEBUG.PL(3, 'd_date: ',d_date);
940: end if;
941: ELSE
942: xProgress := 'EXTUB-30-1210';
943: d_date := NULL;
953: xProgress := 'EXTUB-30-1230';
954: IF p_apps_tbl(k).value IS NOT NULL THEN
955: xProgress := 'EXTUB-30-1240';
956: n_number := TO_NUMBER(p_apps_tbl(k).value);
957: if EC_DEBUG.G_debug_level >= 2 then
958: EC_DEBUG.PL(3, 'n_number: ',n_number);
959: end if;
960: ELSE
961: xProgress := 'EXTUB-30-1250';
954: IF p_apps_tbl(k).value IS NOT NULL THEN
955: xProgress := 'EXTUB-30-1240';
956: n_number := TO_NUMBER(p_apps_tbl(k).value);
957: if EC_DEBUG.G_debug_level >= 2 then
958: EC_DEBUG.PL(3, 'n_number: ',n_number);
959: end if;
960: ELSE
961: xProgress := 'EXTUB-30-1250';
962: n_number := NULL;
985: dummy := dbms_sql.execute(p_Insert_cur);
986:
987: EXCEPTION
988: WHEN OTHERS THEN
989: EC_DEBUG.PL(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL','ECE_EXTRACT_UTILS_PUB.insert_into_prod_interface_pvt');
990: EC_DEBUG.PL(0,'EC','ECE_ERROR_CODE','ERROR_CODE',SQLCODE);
991: EC_DEBUG.PL(0,'EC','ECE_ERROR_MESSAGE','ERROR_MESSAGE',SQLERRM);
992:
993: EC_DEBUG.PL(0,'EC','ECE_PLSQL_POS_NOT_FOUND','COLUMN_NAME', 'to_char(g_error_count)');
986:
987: EXCEPTION
988: WHEN OTHERS THEN
989: EC_DEBUG.PL(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL','ECE_EXTRACT_UTILS_PUB.insert_into_prod_interface_pvt');
990: EC_DEBUG.PL(0,'EC','ECE_ERROR_CODE','ERROR_CODE',SQLCODE);
991: EC_DEBUG.PL(0,'EC','ECE_ERROR_MESSAGE','ERROR_MESSAGE',SQLERRM);
992:
993: EC_DEBUG.PL(0,'EC','ECE_PLSQL_POS_NOT_FOUND','COLUMN_NAME', 'to_char(g_error_count)');
994:
987: EXCEPTION
988: WHEN OTHERS THEN
989: EC_DEBUG.PL(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL','ECE_EXTRACT_UTILS_PUB.insert_into_prod_interface_pvt');
990: EC_DEBUG.PL(0,'EC','ECE_ERROR_CODE','ERROR_CODE',SQLCODE);
991: EC_DEBUG.PL(0,'EC','ECE_ERROR_MESSAGE','ERROR_MESSAGE',SQLERRM);
992:
993: EC_DEBUG.PL(0,'EC','ECE_PLSQL_POS_NOT_FOUND','COLUMN_NAME', 'to_char(g_error_count)');
994:
995: IF g_error_count > 0 THEN
989: EC_DEBUG.PL(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL','ECE_EXTRACT_UTILS_PUB.insert_into_prod_interface_pvt');
990: EC_DEBUG.PL(0,'EC','ECE_ERROR_CODE','ERROR_CODE',SQLCODE);
991: EC_DEBUG.PL(0,'EC','ECE_ERROR_MESSAGE','ERROR_MESSAGE',SQLERRM);
992:
993: EC_DEBUG.PL(0,'EC','ECE_PLSQL_POS_NOT_FOUND','COLUMN_NAME', 'to_char(g_error_count)');
994:
995: IF g_error_count > 0 THEN
996: EC_DEBUG.PL(0,'EC','ECE_PLSQL_VALUE','VALUE', 'p_apps_tbl(g_error_count).value');
997:
992:
993: EC_DEBUG.PL(0,'EC','ECE_PLSQL_POS_NOT_FOUND','COLUMN_NAME', 'to_char(g_error_count)');
994:
995: IF g_error_count > 0 THEN
996: EC_DEBUG.PL(0,'EC','ECE_PLSQL_VALUE','VALUE', 'p_apps_tbl(g_error_count).value');
997:
998: EC_DEBUG.PL(0,'EC','ECE_PLSQL_DATA_TYPE','DATA_TYPE', 'p_apps_tbl(g_error_count).data_type');
999:
1000:
994:
995: IF g_error_count > 0 THEN
996: EC_DEBUG.PL(0,'EC','ECE_PLSQL_VALUE','VALUE', 'p_apps_tbl(g_error_count).value');
997:
998: EC_DEBUG.PL(0,'EC','ECE_PLSQL_DATA_TYPE','DATA_TYPE', 'p_apps_tbl(g_error_count).data_type');
999:
1000:
1001: EC_DEBUG.PL(0,'EC','ECE_PLSQL_COLUMN_NAME','COLUMN_NAME', 'to_char(g_error_count).base_column_name');
1002: END IF;
997:
998: EC_DEBUG.PL(0,'EC','ECE_PLSQL_DATA_TYPE','DATA_TYPE', 'p_apps_tbl(g_error_count).data_type');
999:
1000:
1001: EC_DEBUG.PL(0,'EC','ECE_PLSQL_COLUMN_NAME','COLUMN_NAME', 'to_char(g_error_count).base_column_name');
1002: END IF;
1003:
1004: app_exception.raise_exception;
1005: RAISE;
1027: -- Standard call to get message count and if count is 1, get message info.
1028: fnd_msg_pub.count_and_get(
1029: p_count => x_msg_count,
1030: p_data => x_msg_data);
1031: EC_DEBUG.POP('ece_extract_utils_pub.insert_into_prod_interface_pvt');
1032:
1033: EXCEPTION
1034: WHEN fnd_api.g_exc_error THEN
1035: ROLLBACK TO insert_into_prod_interface_pvt;
1076: pos_not_found EXCEPTION;
1077: cOutput_path VARCHAR2(120);
1078:
1079: BEGIN
1080: ec_debug.push('ECE_EXTRACT_UTILS_PUB.FIND_POS');
1081: if EC_DEBUG.G_debug_level >= 2 then
1082: ec_debug.pl(3,'p_in_text: ',p_in_text);
1083: end if;
1084: FOR k IN 1..l_row_count LOOP
1077: cOutput_path VARCHAR2(120);
1078:
1079: BEGIN
1080: ec_debug.push('ECE_EXTRACT_UTILS_PUB.FIND_POS');
1081: if EC_DEBUG.G_debug_level >= 2 then
1082: ec_debug.pl(3,'p_in_text: ',p_in_text);
1083: end if;
1084: FOR k IN 1..l_row_count LOOP
1085: IF UPPER(NVL(p_source_tbl(k).base_column_name,'NULL')) = cIn_string THEN
1078:
1079: BEGIN
1080: ec_debug.push('ECE_EXTRACT_UTILS_PUB.FIND_POS');
1081: if EC_DEBUG.G_debug_level >= 2 then
1082: ec_debug.pl(3,'p_in_text: ',p_in_text);
1083: end if;
1084: FOR k IN 1..l_row_count LOOP
1085: IF UPPER(NVL(p_source_tbl(k).base_column_name,'NULL')) = cIn_string THEN
1086: p_Pos := k;
1084: FOR k IN 1..l_row_count LOOP
1085: IF UPPER(NVL(p_source_tbl(k).base_column_name,'NULL')) = cIn_string THEN
1086: p_Pos := k;
1087: b_found := TRUE;
1088: if EC_DEBUG.G_debug_level >= 2 then
1089: ec_debug.pl(3,'p_pos: ',p_pos);
1090: end if;
1091: EXIT;
1092: END IF;
1085: IF UPPER(NVL(p_source_tbl(k).base_column_name,'NULL')) = cIn_string THEN
1086: p_Pos := k;
1087: b_found := TRUE;
1088: if EC_DEBUG.G_debug_level >= 2 then
1089: ec_debug.pl(3,'p_pos: ',p_pos);
1090: end if;
1091: EXIT;
1092: END IF;
1093: END LOOP;
1095: IF NOT b_found THEN
1096: RAISE pos_not_found;
1097: END IF;
1098:
1099: ec_debug.pop('ECE_EXTRACT_UTILS_PUB.FIND_POS');
1100:
1101: EXCEPTION
1102: WHEN pos_not_found THEN
1103: ec_debug.pl(0,'EC','ECE_PLSQL_POS_NOT_FOUND','COLUMN_NAME',cIn_string);
1099: ec_debug.pop('ECE_EXTRACT_UTILS_PUB.FIND_POS');
1100:
1101: EXCEPTION
1102: WHEN pos_not_found THEN
1103: ec_debug.pl(0,'EC','ECE_PLSQL_POS_NOT_FOUND','COLUMN_NAME',cIn_string);
1104: app_exception.raise_exception;
1105:
1106: WHEN OTHERS THEN
1107: ec_debug.pl(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL','ECE_EXTRACT_UTILS_PUB.FIND_POS');
1103: ec_debug.pl(0,'EC','ECE_PLSQL_POS_NOT_FOUND','COLUMN_NAME',cIn_string);
1104: app_exception.raise_exception;
1105:
1106: WHEN OTHERS THEN
1107: ec_debug.pl(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL','ECE_EXTRACT_UTILS_PUB.FIND_POS');
1108: ec_debug.pl(0,'EC','ECE_ERROR_CODE','ERROR_CODE',SQLCODE);
1109: ec_debug.pl(0,'EC','ECE_ERROR_MESSAGE','ERROR_MESSAGE',SQLERRM);
1110: app_exception.raise_exception;
1111:
1104: app_exception.raise_exception;
1105:
1106: WHEN OTHERS THEN
1107: ec_debug.pl(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL','ECE_EXTRACT_UTILS_PUB.FIND_POS');
1108: ec_debug.pl(0,'EC','ECE_ERROR_CODE','ERROR_CODE',SQLCODE);
1109: ec_debug.pl(0,'EC','ECE_ERROR_MESSAGE','ERROR_MESSAGE',SQLERRM);
1110: app_exception.raise_exception;
1111:
1112: END find_pos;
1105:
1106: WHEN OTHERS THEN
1107: ec_debug.pl(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL','ECE_EXTRACT_UTILS_PUB.FIND_POS');
1108: ec_debug.pl(0,'EC','ECE_ERROR_CODE','ERROR_CODE',SQLCODE);
1109: ec_debug.pl(0,'EC','ECE_ERROR_MESSAGE','ERROR_MESSAGE',SQLERRM);
1110: app_exception.raise_exception;
1111:
1112: END find_pos;
1113:
1119: b_found BOOLEAN := FALSE;
1120: pos_not_found EXCEPTION;
1121: cOutput_path VARCHAR2(120);
1122: BEGIN
1123: EC_DEBUG.PUSH('ece_extract_utils_pub.POS_OF');
1124: if EC_DEBUG.G_debug_level >= 2 then
1125: EC_DEBUG.PL(3, 'cCol_name: ',cCol_name);
1126: end if;
1127:
1120: pos_not_found EXCEPTION;
1121: cOutput_path VARCHAR2(120);
1122: BEGIN
1123: EC_DEBUG.PUSH('ece_extract_utils_pub.POS_OF');
1124: if EC_DEBUG.G_debug_level >= 2 then
1125: EC_DEBUG.PL(3, 'cCol_name: ',cCol_name);
1126: end if;
1127:
1128: For k in 1..l_Row_count loop
1121: cOutput_path VARCHAR2(120);
1122: BEGIN
1123: EC_DEBUG.PUSH('ece_extract_utils_pub.POS_OF');
1124: if EC_DEBUG.G_debug_level >= 2 then
1125: EC_DEBUG.PL(3, 'cCol_name: ',cCol_name);
1126: end if;
1127:
1128: For k in 1..l_Row_count loop
1129: if UPPER(nvl(pInterface_tbl(k).base_column_name, 'NULL')) = UPPER(cCol_name) then
1127:
1128: For k in 1..l_Row_count loop
1129: if UPPER(nvl(pInterface_tbl(k).base_column_name, 'NULL')) = UPPER(cCol_name) then
1130: b_found := TRUE;
1131: if EC_DEBUG.G_debug_level >= 2 then
1132: EC_DEBUG.PL(3, 'k: ',k);
1133: end if;
1134: EC_DEBUG.POP('ece_extract_utils_pub.POS_OF');
1135: return(k);
1128: For k in 1..l_Row_count loop
1129: if UPPER(nvl(pInterface_tbl(k).base_column_name, 'NULL')) = UPPER(cCol_name) then
1130: b_found := TRUE;
1131: if EC_DEBUG.G_debug_level >= 2 then
1132: EC_DEBUG.PL(3, 'k: ',k);
1133: end if;
1134: EC_DEBUG.POP('ece_extract_utils_pub.POS_OF');
1135: return(k);
1136: exit;
1130: b_found := TRUE;
1131: if EC_DEBUG.G_debug_level >= 2 then
1132: EC_DEBUG.PL(3, 'k: ',k);
1133: end if;
1134: EC_DEBUG.POP('ece_extract_utils_pub.POS_OF');
1135: return(k);
1136: exit;
1137: end if;
1138: end loop;
1143: end if;
1144:
1145: EXCEPTION
1146: WHEN pos_not_found THEN
1147: EC_DEBUG.PL(0,'EC','ECE_PLSQL_POS_NOT_FOUND','COLUMN_NAME', 'upper(cCol_name)');
1148: app_exception.raise_exception;
1149: WHEN OTHERS THEN
1150: EC_DEBUG.PL(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL','ECE_EXTRACT_UTILS_PUB.POS_OF');
1151: EC_DEBUG.PL(0,'EC','ECE_ERROR_CODE','ERROR_CODE',SQLCODE);
1146: WHEN pos_not_found THEN
1147: EC_DEBUG.PL(0,'EC','ECE_PLSQL_POS_NOT_FOUND','COLUMN_NAME', 'upper(cCol_name)');
1148: app_exception.raise_exception;
1149: WHEN OTHERS THEN
1150: EC_DEBUG.PL(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL','ECE_EXTRACT_UTILS_PUB.POS_OF');
1151: EC_DEBUG.PL(0,'EC','ECE_ERROR_CODE','ERROR_CODE',SQLCODE);
1152: EC_DEBUG.PL(0,'EC','ECE_ERROR_MESSAGE','ERROR_MESSAGE',SQLERRM);
1153: app_exception.raise_exception;
1154: END pos_of;
1147: EC_DEBUG.PL(0,'EC','ECE_PLSQL_POS_NOT_FOUND','COLUMN_NAME', 'upper(cCol_name)');
1148: app_exception.raise_exception;
1149: WHEN OTHERS THEN
1150: EC_DEBUG.PL(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL','ECE_EXTRACT_UTILS_PUB.POS_OF');
1151: EC_DEBUG.PL(0,'EC','ECE_ERROR_CODE','ERROR_CODE',SQLCODE);
1152: EC_DEBUG.PL(0,'EC','ECE_ERROR_MESSAGE','ERROR_MESSAGE',SQLERRM);
1153: app_exception.raise_exception;
1154: END pos_of;
1155:
1148: app_exception.raise_exception;
1149: WHEN OTHERS THEN
1150: EC_DEBUG.PL(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL','ECE_EXTRACT_UTILS_PUB.POS_OF');
1151: EC_DEBUG.PL(0,'EC','ECE_ERROR_CODE','ERROR_CODE',SQLCODE);
1152: EC_DEBUG.PL(0,'EC','ECE_ERROR_MESSAGE','ERROR_MESSAGE',SQLERRM);
1153: app_exception.raise_exception;
1154: END pos_of;
1155:
1156: -- 2823215
1166: pos_not_found EXCEPTION;
1167: cOutput_path VARCHAR2(120);
1168:
1169: BEGIN
1170: if EC_DEBUG.G_debug_level >= 2 then
1171: ec_debug.push('ECE_EXTRACT_UTILS_PUB.EXT_GET_VALUE');
1172: ec_debug.pl(3,'p_in_text: ',p_in_text);
1173: end if;
1174: FOR k IN 1..l_row_count LOOP
1167: cOutput_path VARCHAR2(120);
1168:
1169: BEGIN
1170: if EC_DEBUG.G_debug_level >= 2 then
1171: ec_debug.push('ECE_EXTRACT_UTILS_PUB.EXT_GET_VALUE');
1172: ec_debug.pl(3,'p_in_text: ',p_in_text);
1173: end if;
1174: FOR k IN 1..l_row_count LOOP
1175: IF UPPER(NVL(l_plsql_tbl(k).ext_column_name,'NULL')) = cIn_string THEN
1168:
1169: BEGIN
1170: if EC_DEBUG.G_debug_level >= 2 then
1171: ec_debug.push('ECE_EXTRACT_UTILS_PUB.EXT_GET_VALUE');
1172: ec_debug.pl(3,'p_in_text: ',p_in_text);
1173: end if;
1174: FOR k IN 1..l_row_count LOOP
1175: IF UPPER(NVL(l_plsql_tbl(k).ext_column_name,'NULL')) = cIn_string THEN
1176: p_Position := k;
1183: IF NOT b_found THEN
1184: RAISE pos_not_found;
1185: END IF;
1186:
1187: if EC_DEBUG.G_debug_level >= 2 then
1188: ec_debug.pl(3,'p_position: ',p_position);
1189: ec_debug.pl(3,'o_value: ',o_value);
1190: ec_debug.pop('ECE_EXTRACT_UTILS_PUB.EXT_GET_VALUE');
1191: end if;
1184: RAISE pos_not_found;
1185: END IF;
1186:
1187: if EC_DEBUG.G_debug_level >= 2 then
1188: ec_debug.pl(3,'p_position: ',p_position);
1189: ec_debug.pl(3,'o_value: ',o_value);
1190: ec_debug.pop('ECE_EXTRACT_UTILS_PUB.EXT_GET_VALUE');
1191: end if;
1192:
1185: END IF;
1186:
1187: if EC_DEBUG.G_debug_level >= 2 then
1188: ec_debug.pl(3,'p_position: ',p_position);
1189: ec_debug.pl(3,'o_value: ',o_value);
1190: ec_debug.pop('ECE_EXTRACT_UTILS_PUB.EXT_GET_VALUE');
1191: end if;
1192:
1193: EXCEPTION
1186:
1187: if EC_DEBUG.G_debug_level >= 2 then
1188: ec_debug.pl(3,'p_position: ',p_position);
1189: ec_debug.pl(3,'o_value: ',o_value);
1190: ec_debug.pop('ECE_EXTRACT_UTILS_PUB.EXT_GET_VALUE');
1191: end if;
1192:
1193: EXCEPTION
1194: WHEN pos_not_found THEN
1191: end if;
1192:
1193: EXCEPTION
1194: WHEN pos_not_found THEN
1195: ec_debug.pl(0,'EC','ECE_PLSQL_POS_NOT_FOUND','COLUMN_NAME',cIn_string);
1196: app_exception.raise_exception;
1197:
1198: WHEN OTHERS THEN
1199: ec_debug.pl(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL','ECE_EXTRACT_UTILS_PUB.EXT_GET_VALUE');
1195: ec_debug.pl(0,'EC','ECE_PLSQL_POS_NOT_FOUND','COLUMN_NAME',cIn_string);
1196: app_exception.raise_exception;
1197:
1198: WHEN OTHERS THEN
1199: ec_debug.pl(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL','ECE_EXTRACT_UTILS_PUB.EXT_GET_VALUE');
1200: ec_debug.pl(0,'EC','ECE_ERROR_CODE','ERROR_CODE',SQLCODE);
1201: ec_debug.pl(0,'EC','ECE_ERROR_MESSAGE','ERROR_MESSAGE',SQLERRM);
1202: app_exception.raise_exception;
1203: END ext_get_value;
1196: app_exception.raise_exception;
1197:
1198: WHEN OTHERS THEN
1199: ec_debug.pl(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL','ECE_EXTRACT_UTILS_PUB.EXT_GET_VALUE');
1200: ec_debug.pl(0,'EC','ECE_ERROR_CODE','ERROR_CODE',SQLCODE);
1201: ec_debug.pl(0,'EC','ECE_ERROR_MESSAGE','ERROR_MESSAGE',SQLERRM);
1202: app_exception.raise_exception;
1203: END ext_get_value;
1204:
1197:
1198: WHEN OTHERS THEN
1199: ec_debug.pl(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL','ECE_EXTRACT_UTILS_PUB.EXT_GET_VALUE');
1200: ec_debug.pl(0,'EC','ECE_ERROR_CODE','ERROR_CODE',SQLCODE);
1201: ec_debug.pl(0,'EC','ECE_ERROR_MESSAGE','ERROR_MESSAGE',SQLERRM);
1202: app_exception.raise_exception;
1203: END ext_get_value;
1204:
1205: PROCEDURE ext_insert_value(
1207: p_position IN number,
1208: p_value IN varchar2)
1209: IS
1210: BEGIN
1211: if EC_DEBUG.G_debug_level >= 2 then
1212: ec_debug.push('ECE_EXTRACT_UTILS_PUB.EXT_INSERT_VALUE');
1213: ec_debug.pl(3,'p_position: ',p_position);
1214: ec_debug.pl(3,'p_value: ',p_value);
1215: end if;
1208: p_value IN varchar2)
1209: IS
1210: BEGIN
1211: if EC_DEBUG.G_debug_level >= 2 then
1212: ec_debug.push('ECE_EXTRACT_UTILS_PUB.EXT_INSERT_VALUE');
1213: ec_debug.pl(3,'p_position: ',p_position);
1214: ec_debug.pl(3,'p_value: ',p_value);
1215: end if;
1216: l_plsql_tbl(p_position).value := p_value;
1209: IS
1210: BEGIN
1211: if EC_DEBUG.G_debug_level >= 2 then
1212: ec_debug.push('ECE_EXTRACT_UTILS_PUB.EXT_INSERT_VALUE');
1213: ec_debug.pl(3,'p_position: ',p_position);
1214: ec_debug.pl(3,'p_value: ',p_value);
1215: end if;
1216: l_plsql_tbl(p_position).value := p_value;
1217:
1210: BEGIN
1211: if EC_DEBUG.G_debug_level >= 2 then
1212: ec_debug.push('ECE_EXTRACT_UTILS_PUB.EXT_INSERT_VALUE');
1213: ec_debug.pl(3,'p_position: ',p_position);
1214: ec_debug.pl(3,'p_value: ',p_value);
1215: end if;
1216: l_plsql_tbl(p_position).value := p_value;
1217:
1218: if EC_DEBUG.G_debug_level >= 2 then
1214: ec_debug.pl(3,'p_value: ',p_value);
1215: end if;
1216: l_plsql_tbl(p_position).value := p_value;
1217:
1218: if EC_DEBUG.G_debug_level >= 2 then
1219: ec_debug.pop('ECE_EXTRACT_UTILS_PUB.EXT_INSERT_VALUE');
1220: end if;
1221:
1222: EXCEPTION
1215: end if;
1216: l_plsql_tbl(p_position).value := p_value;
1217:
1218: if EC_DEBUG.G_debug_level >= 2 then
1219: ec_debug.pop('ECE_EXTRACT_UTILS_PUB.EXT_INSERT_VALUE');
1220: end if;
1221:
1222: EXCEPTION
1223: WHEN OTHERS THEN
1220: end if;
1221:
1222: EXCEPTION
1223: WHEN OTHERS THEN
1224: ec_debug.pl(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL','ECE_EXTRACT_UTILS_PUB.EXT_INSERT_VALUE');
1225: ec_debug.pl(0,'EC','ECE_ERROR_CODE','ERROR_CODE',SQLCODE);
1226: ec_debug.pl(0,'EC','ECE_ERROR_MESSAGE','ERROR_MESSAGE',SQLERRM);
1227: app_exception.raise_exception;
1228: end ext_insert_value;
1221:
1222: EXCEPTION
1223: WHEN OTHERS THEN
1224: ec_debug.pl(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL','ECE_EXTRACT_UTILS_PUB.EXT_INSERT_VALUE');
1225: ec_debug.pl(0,'EC','ECE_ERROR_CODE','ERROR_CODE',SQLCODE);
1226: ec_debug.pl(0,'EC','ECE_ERROR_MESSAGE','ERROR_MESSAGE',SQLERRM);
1227: app_exception.raise_exception;
1228: end ext_insert_value;
1229:
1222: EXCEPTION
1223: WHEN OTHERS THEN
1224: ec_debug.pl(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL','ECE_EXTRACT_UTILS_PUB.EXT_INSERT_VALUE');
1225: ec_debug.pl(0,'EC','ECE_ERROR_CODE','ERROR_CODE',SQLCODE);
1226: ec_debug.pl(0,'EC','ECE_ERROR_MESSAGE','ERROR_MESSAGE',SQLERRM);
1227: app_exception.raise_exception;
1228: end ext_insert_value;
1229:
1230: END ece_extract_utils_pub;