15: c_local_chr_13 varchar2(1) := fnd_global.local_chr(13);
16:
17: /**
18: Build and Parses the Insert Statement for insert into ece_stage for each Level.
19: The Cursor handles are stored in the ec_utils.g_int_levels(i).cursor_handle.
20: **/
21: procedure parse_insert_statement
22: (
23: i_level in pls_integer
44: cValue_stmt := cValue_stmt||':a1 ,:a2 ,:a3 ,:a4 ,:a5,:a6,:a7,:a8,:a9 ,';
45: cValue_stmt := cValue_stmt||':w1 ,:w2 ,:w3 ,:w4 ,';
46:
47: --- Add Variable Columns for the Record
48: for i in ec_utils.g_int_levels(i_level).file_start_pos..ec_utils.g_int_levels(i_level).file_end_pos
49: loop
50: if ec_utils.g_file_tbl(i).staging_column is not null
51: then
52: --- Build Insert Statement
46:
47: --- Add Variable Columns for the Record
48: for i in ec_utils.g_int_levels(i_level).file_start_pos..ec_utils.g_int_levels(i_level).file_end_pos
49: loop
50: if ec_utils.g_file_tbl(i).staging_column is not null
51: then
52: --- Build Insert Statement
53: cInsert_stmt := cInsert_stmt||' '||ec_utils.g_file_tbl(i).staging_column|| ',';
54: cValue_stmt := cvalue_stmt || ':b'||i||',';
49: loop
50: if ec_utils.g_file_tbl(i).staging_column is not null
51: then
52: --- Build Insert Statement
53: cInsert_stmt := cInsert_stmt||' '||ec_utils.g_file_tbl(i).staging_column|| ',';
54: cValue_stmt := cvalue_stmt || ':b'||i||',';
55: end if;
56: end loop;
57:
73: if ec_debug.G_debug_level = 3 then
74: ec_debug.pl(3,'i_insert_cursor',i_insert_cursor);
75: end if;
76:
77: ec_utils.g_ext_levels(i_level).cursor_handle := i_insert_cursor;
78:
79: begin
80: dbms_sql.parse(i_Insert_Cursor,cInsert_stmt,dbms_sql.native);
81: exception
82: when others then
83: error_position := dbms_sql.last_error_position;
84: ec_debug.pl(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL','EC_OUTBOUND.PARSE_INSERT_STATEMENT');
85: ece_error_handling_pvt.print_parse_error (error_position,cInsert_stmt);
86: ec_utils.i_ret_code :=2;
87: raise EC_UTILS.PROGRAM_EXIT;
88: end;
89: if ec_debug.G_debug_level >= 2 then
90: ec_debug.pop('EC_OUTBOUND.PARSE_INSERT_STATEMENT');
83: error_position := dbms_sql.last_error_position;
84: ec_debug.pl(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL','EC_OUTBOUND.PARSE_INSERT_STATEMENT');
85: ece_error_handling_pvt.print_parse_error (error_position,cInsert_stmt);
86: ec_utils.i_ret_code :=2;
87: raise EC_UTILS.PROGRAM_EXIT;
88: end;
89: if ec_debug.G_debug_level >= 2 then
90: ec_debug.pop('EC_OUTBOUND.PARSE_INSERT_STATEMENT');
91: end if;
90: ec_debug.pop('EC_OUTBOUND.PARSE_INSERT_STATEMENT');
91: end if;
92:
93: EXCEPTION
94: WHEN EC_UTILS.PROGRAM_EXIT then
95: raise;
96: WHEN OTHERS THEN
97: ec_debug.pl(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL','EC_OUTBOUND.PARSE_INSERT_STATEMENT');
98: ec_debug.pl(0,'EC','ECE_ERROR_MESSAGE','ERROR_MESSAGE',SQLERRM);
95: raise;
96: WHEN OTHERS THEN
97: ec_debug.pl(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL','EC_OUTBOUND.PARSE_INSERT_STATEMENT');
98: ec_debug.pl(0,'EC','ECE_ERROR_MESSAGE','ERROR_MESSAGE',SQLERRM);
99: ec_utils.i_ret_code :=2;
100: raise EC_UTILS.PROGRAM_EXIT;
101: END parse_insert_statement;
102:
103: /**
96: WHEN OTHERS THEN
97: ec_debug.pl(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL','EC_OUTBOUND.PARSE_INSERT_STATEMENT');
98: ec_debug.pl(0,'EC','ECE_ERROR_MESSAGE','ERROR_MESSAGE',SQLERRM);
99: ec_utils.i_ret_code :=2;
100: raise EC_UTILS.PROGRAM_EXIT;
101: END parse_insert_statement;
102:
103: /**
104: Prepares the Select statement for the ec_views on the base Oracle Applications tables.
116: cDATE VARCHAR2(40) := ',''YYYYMMDD HH24MISS'')';
117: cWord1 VARCHAR2(20) := ' ';
118: cWord2 VARCHAR2(40) := ' ';
119:
120: iRow_count pls_integer := ec_utils.g_file_tbl.COUNT;
121:
122: BEGIN
123: if ec_debug.G_debug_level >= 2 then
124: EC_DEBUG.PUSH('EC_OUTBOUND.SELECT_CLAUSE');
124: EC_DEBUG.PUSH('EC_OUTBOUND.SELECT_CLAUSE');
125: EC_DEBUG.PL(3, 'i_level',i_level);
126: end if;
127:
128: For i in ec_utils.g_int_levels(i_level).file_start_pos..ec_utils.g_int_levels(i_level).file_end_pos
129: loop
130: -- **************************************
131: -- apply appropriate data conversion
132: -- convert everything to VARCHAR
131: -- apply appropriate data conversion
132: -- convert everything to VARCHAR
133: -- **************************************
134:
135: if 'DATE' = ec_utils.g_file_tbl(i).data_type Then
136: cWord1 := cTO_CHAR;
137: cWord2 := cDATE;
138:
139: elsif 'NUMBER' = ec_utils.g_file_tbl(i).data_type Then
135: if 'DATE' = ec_utils.g_file_tbl(i).data_type Then
136: cWord1 := cTO_CHAR;
137: cWord2 := cDATE;
138:
139: elsif 'NUMBER' = ec_utils.g_file_tbl(i).data_type Then
140: cWord1 := cTO_CHAR;
141: cWord2 := ')';
142: else
143: cWord1 := NULL;
145: END if;
146:
147: -- build SELECT statement
148: cSelect_stmt := cSelect_stmt || ' ' || cWord1 ||
149: nvl(ec_utils.g_file_tbl(i).base_column_Name,'NULL') || cWord2 || ',';
150: End Loop;
151:
152: -- build FROM, WHERE statements
153:
150: End Loop;
151:
152: -- build FROM, WHERE statements
153:
154: cFrom_stmt := cFrom_Stmt||' '||ec_utils.g_int_levels(i_level).base_table_name;
155:
156: cSelect_stmt := RTRIM(cSelect_stmt, ',');
157: i_Where_string := cSelect_stmt||' '||cFrom_stmt||' '||cWhere_Stmt;
158:
164: exception
165: when others then
166: EC_DEBUG.PL(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL','EC_OUTBOUND.SELECT_CLAUSE');
167: EC_DEBUG.PL(0,'EC','ECE_ERROR_MESSAGE','ERROR_MESSAGE',SQLERRM);
168: ec_utils.i_ret_code :=2;
169: raise EC_UTILS.PROGRAM_EXIT;
170: END select_clause;
171:
172: /**
165: when others then
166: EC_DEBUG.PL(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL','EC_OUTBOUND.SELECT_CLAUSE');
167: EC_DEBUG.PL(0,'EC','ECE_ERROR_MESSAGE','ERROR_MESSAGE',SQLERRM);
168: ec_utils.i_ret_code :=2;
169: raise EC_UTILS.PROGRAM_EXIT;
170: END select_clause;
171:
172: /**
173: Loads the Objects required by the Outbound transaction. This includes
183: if ec_debug.G_debug_level >= 2 then
184: ec_debug.push('EC_OUTBOUND.LOAD_OBJECTS');
185: end if;
186:
187: for i in 1..ec_utils.g_int_levels.COUNT
188: LOOP
189: select_clause
190: (
191: i,
188: LOOP
189: select_clause
190: (
191: i,
192: ec_utils.g_int_levels(i).sql_stmt
193: );
194:
195: ec_utils.execute_stage_data
196: (
191: i,
192: ec_utils.g_int_levels(i).sql_stmt
193: );
194:
195: ec_utils.execute_stage_data
196: (
197: 10,
198: i
199: );
199: );
200:
201:
202: -- Open Cursor For Each level and store the handles in the PL/SQL table.
203: ec_utils.g_int_levels(i).Cursor_handle := dbms_sql.open_cursor;
204: if ec_debug.G_debug_level = 3 then
205: ec_debug.pl(3,'Cursor handle',ec_utils.g_int_levels(i).Cursor_handle);
206: end if;
207:
201:
202: -- Open Cursor For Each level and store the handles in the PL/SQL table.
203: ec_utils.g_int_levels(i).Cursor_handle := dbms_sql.open_cursor;
204: if ec_debug.G_debug_level = 3 then
205: ec_debug.pl(3,'Cursor handle',ec_utils.g_int_levels(i).Cursor_handle);
206: end if;
207:
208: -- Parse the Select Statement for Each level
209: BEGIN
207:
208: -- Parse the Select Statement for Each level
209: BEGIN
210: dbms_sql.parse (
211: ec_utils.g_int_levels(i).cursor_handle,
212: ec_utils.g_int_levels(i).sql_stmt,
213: dbms_sql.native
214: );
215: EXCEPTION
208: -- Parse the Select Statement for Each level
209: BEGIN
210: dbms_sql.parse (
211: ec_utils.g_int_levels(i).cursor_handle,
212: ec_utils.g_int_levels(i).sql_stmt,
213: dbms_sql.native
214: );
215: EXCEPTION
216: WHEN OTHERS THEN
216: WHEN OTHERS THEN
217: ece_error_handling_pvt.print_parse_error
218: (
219: dbms_sql.last_error_position,
220: ec_utils.g_int_levels(i).sql_stmt
221: );
222: ec_debug.pl(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL','EC_OUTBOUND.LOAD_OBJECTS');
223: ec_debug.pl(0,'EC','ECE_PARSE_VIEW_ERROR','LEVEL',i);
224: raise EC_UTILS.PROGRAM_EXIT;
220: ec_utils.g_int_levels(i).sql_stmt
221: );
222: ec_debug.pl(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL','EC_OUTBOUND.LOAD_OBJECTS');
223: ec_debug.pl(0,'EC','ECE_PARSE_VIEW_ERROR','LEVEL',i);
224: raise EC_UTILS.PROGRAM_EXIT;
225: END;
226:
227: i_counter :=0;
228: -- Define Columns for Each Level
225: END;
226:
227: i_counter :=0;
228: -- Define Columns for Each Level
229: FOR k in ec_utils.g_int_levels(i).file_start_pos..ec_utils.g_int_levels(i).file_end_pos
230: LOOP
231: i_counter := i_counter + 1;
232: dbms_sql.define_column
233: (
230: LOOP
231: i_counter := i_counter + 1;
232: dbms_sql.define_column
233: (
234: ec_utils.g_int_levels(i).Cursor_Handle,
235: i_counter,
236: ec_utils.g_int_levels(i).sql_stmt,
237: ece_extract_utils_PUB.G_MaxColWidth
238: );
232: dbms_sql.define_column
233: (
234: ec_utils.g_int_levels(i).Cursor_Handle,
235: i_counter,
236: ec_utils.g_int_levels(i).sql_stmt,
237: ece_extract_utils_PUB.G_MaxColWidth
238: );
239: END LOOP;
240:
239: END LOOP;
240:
241: END LOOP;
242:
243: ec_utils.i_stage_data := ec_utils.i_tmp2_stage_data; -- 2920679
244:
245: for i in 1..ec_utils.g_ext_levels.COUNT
246: LOOP
247: -- Parse the Insert Statement for Staging table.
241: END LOOP;
242:
243: ec_utils.i_stage_data := ec_utils.i_tmp2_stage_data; -- 2920679
244:
245: for i in 1..ec_utils.g_ext_levels.COUNT
246: LOOP
247: -- Parse the Insert Statement for Staging table.
248: parse_insert_statement
249: (
254: ec_debug.pop('EC_OUTBOUND.LOAD_OBJECTS');
255: end if;
256:
257: EXCEPTION
258: WHEN EC_UTILS.PROGRAM_EXIT then
259: raise;
260: WHEN OTHERS THEN
261: ec_debug.pl(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL','EC_OUTBOUND.LOAD_OBJECTS');
262: ec_debug.pl(0,'EC','ECE_ERROR_MESSAGE','ERROR_MESSAGE',SQLERRM);
259: raise;
260: WHEN OTHERS THEN
261: ec_debug.pl(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL','EC_OUTBOUND.LOAD_OBJECTS');
262: ec_debug.pl(0,'EC','ECE_ERROR_MESSAGE','ERROR_MESSAGE',SQLERRM);
263: ec_utils.i_ret_code :=2;
264: raise EC_UTILS.PROGRAM_EXIT;
265: end load_objects;
266:
267:
260: WHEN OTHERS THEN
261: ec_debug.pl(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL','EC_OUTBOUND.LOAD_OBJECTS');
262: ec_debug.pl(0,'EC','ECE_ERROR_MESSAGE','ERROR_MESSAGE',SQLERRM);
263: ec_utils.i_ret_code :=2;
264: raise EC_UTILS.PROGRAM_EXIT;
265: end load_objects;
266:
267:
268: /**
272: (
273: i_level in pls_integer
274: )
275: is
276: i_Insert_Cursor pls_integer := ec_utils.g_ext_levels(i_level).cursor_handle;
277: dummy pls_integer;
278: error_position pls_integer;
279: i_status ece_stage.status%TYPE := 'NEW';
280: ins_value varchar2(32000);
285: end if;
286:
287: begin
288: -- Bind values for Mandatory Columns
289: dbms_sql.bind_variable (i_Insert_Cursor,'a1',to_number(ec_utils.g_ext_levels(i_level).Stage_Id));
290: dbms_sql.bind_variable (i_Insert_Cursor,'a2',to_number(ec_utils.g_ext_levels(i_level).Document_Id));
291: dbms_sql.bind_variable (i_Insert_Cursor,'a3',ec_utils.g_transaction_type);
292: dbms_sql.bind_variable (i_Insert_Cursor,'a4',to_number(i_level));
293: dbms_sql.bind_variable (i_Insert_Cursor,'a5',to_number(ec_utils.g_ext_levels(i_level).Line_Number));
286:
287: begin
288: -- Bind values for Mandatory Columns
289: dbms_sql.bind_variable (i_Insert_Cursor,'a1',to_number(ec_utils.g_ext_levels(i_level).Stage_Id));
290: dbms_sql.bind_variable (i_Insert_Cursor,'a2',to_number(ec_utils.g_ext_levels(i_level).Document_Id));
291: dbms_sql.bind_variable (i_Insert_Cursor,'a3',ec_utils.g_transaction_type);
292: dbms_sql.bind_variable (i_Insert_Cursor,'a4',to_number(i_level));
293: dbms_sql.bind_variable (i_Insert_Cursor,'a5',to_number(ec_utils.g_ext_levels(i_level).Line_Number));
294: dbms_sql.bind_variable (i_Insert_Cursor,'a6',ec_utils.g_ext_levels(i_level).Parent_Stage_Id);
287: begin
288: -- Bind values for Mandatory Columns
289: dbms_sql.bind_variable (i_Insert_Cursor,'a1',to_number(ec_utils.g_ext_levels(i_level).Stage_Id));
290: dbms_sql.bind_variable (i_Insert_Cursor,'a2',to_number(ec_utils.g_ext_levels(i_level).Document_Id));
291: dbms_sql.bind_variable (i_Insert_Cursor,'a3',ec_utils.g_transaction_type);
292: dbms_sql.bind_variable (i_Insert_Cursor,'a4',to_number(i_level));
293: dbms_sql.bind_variable (i_Insert_Cursor,'a5',to_number(ec_utils.g_ext_levels(i_level).Line_Number));
294: dbms_sql.bind_variable (i_Insert_Cursor,'a6',ec_utils.g_ext_levels(i_level).Parent_Stage_Id);
295: dbms_sql.bind_variable (i_Insert_Cursor,'a7',ec_utils.g_run_id);
289: dbms_sql.bind_variable (i_Insert_Cursor,'a1',to_number(ec_utils.g_ext_levels(i_level).Stage_Id));
290: dbms_sql.bind_variable (i_Insert_Cursor,'a2',to_number(ec_utils.g_ext_levels(i_level).Document_Id));
291: dbms_sql.bind_variable (i_Insert_Cursor,'a3',ec_utils.g_transaction_type);
292: dbms_sql.bind_variable (i_Insert_Cursor,'a4',to_number(i_level));
293: dbms_sql.bind_variable (i_Insert_Cursor,'a5',to_number(ec_utils.g_ext_levels(i_level).Line_Number));
294: dbms_sql.bind_variable (i_Insert_Cursor,'a6',ec_utils.g_ext_levels(i_level).Parent_Stage_Id);
295: dbms_sql.bind_variable (i_Insert_Cursor,'a7',ec_utils.g_run_id);
296: dbms_sql.bind_variable (i_Insert_Cursor,'a8',ec_utils.g_ext_levels(i_level).Document_Number);
297: dbms_sql.bind_variable (i_Insert_Cursor,'a9',i_status);
290: dbms_sql.bind_variable (i_Insert_Cursor,'a2',to_number(ec_utils.g_ext_levels(i_level).Document_Id));
291: dbms_sql.bind_variable (i_Insert_Cursor,'a3',ec_utils.g_transaction_type);
292: dbms_sql.bind_variable (i_Insert_Cursor,'a4',to_number(i_level));
293: dbms_sql.bind_variable (i_Insert_Cursor,'a5',to_number(ec_utils.g_ext_levels(i_level).Line_Number));
294: dbms_sql.bind_variable (i_Insert_Cursor,'a6',ec_utils.g_ext_levels(i_level).Parent_Stage_Id);
295: dbms_sql.bind_variable (i_Insert_Cursor,'a7',ec_utils.g_run_id);
296: dbms_sql.bind_variable (i_Insert_Cursor,'a8',ec_utils.g_ext_levels(i_level).Document_Number);
297: dbms_sql.bind_variable (i_Insert_Cursor,'a9',i_status);
298:
291: dbms_sql.bind_variable (i_Insert_Cursor,'a3',ec_utils.g_transaction_type);
292: dbms_sql.bind_variable (i_Insert_Cursor,'a4',to_number(i_level));
293: dbms_sql.bind_variable (i_Insert_Cursor,'a5',to_number(ec_utils.g_ext_levels(i_level).Line_Number));
294: dbms_sql.bind_variable (i_Insert_Cursor,'a6',ec_utils.g_ext_levels(i_level).Parent_Stage_Id);
295: dbms_sql.bind_variable (i_Insert_Cursor,'a7',ec_utils.g_run_id);
296: dbms_sql.bind_variable (i_Insert_Cursor,'a8',ec_utils.g_ext_levels(i_level).Document_Number);
297: dbms_sql.bind_variable (i_Insert_Cursor,'a9',i_status);
298:
299: -- Bind values for Mandatory Columns
292: dbms_sql.bind_variable (i_Insert_Cursor,'a4',to_number(i_level));
293: dbms_sql.bind_variable (i_Insert_Cursor,'a5',to_number(ec_utils.g_ext_levels(i_level).Line_Number));
294: dbms_sql.bind_variable (i_Insert_Cursor,'a6',ec_utils.g_ext_levels(i_level).Parent_Stage_Id);
295: dbms_sql.bind_variable (i_Insert_Cursor,'a7',ec_utils.g_run_id);
296: dbms_sql.bind_variable (i_Insert_Cursor,'a8',ec_utils.g_ext_levels(i_level).Document_Number);
297: dbms_sql.bind_variable (i_Insert_Cursor,'a9',i_status);
298:
299: -- Bind values for Mandatory Columns
300: dbms_sql.bind_variable (i_Insert_Cursor,'w1',sysdate);
302: dbms_sql.bind_variable (i_Insert_Cursor,'w3',sysdate);
303: dbms_sql.bind_variable (i_Insert_Cursor,'w4',fnd_global.user_id);
304:
305: if ec_debug.G_debug_level = 3 then
306: ec_debug.pl(3,'STAGE_ID',ec_utils.g_ext_levels(i_level).Stage_Id);
307: ec_debug.pl(3,'DOCUMENT_ID',ec_utils.g_ext_levels(i_level).Document_Id);
308: ec_debug.pl(3,'TRANSACTION_TYPE',ec_utils.g_transaction_type);
309: ec_debug.pl(3,'TRANSACTION_LEVEL',i_level);
310: ec_debug.pl(3,'LINE_NUMBER',ec_utils.g_ext_levels(i_level).Line_Number);
303: dbms_sql.bind_variable (i_Insert_Cursor,'w4',fnd_global.user_id);
304:
305: if ec_debug.G_debug_level = 3 then
306: ec_debug.pl(3,'STAGE_ID',ec_utils.g_ext_levels(i_level).Stage_Id);
307: ec_debug.pl(3,'DOCUMENT_ID',ec_utils.g_ext_levels(i_level).Document_Id);
308: ec_debug.pl(3,'TRANSACTION_TYPE',ec_utils.g_transaction_type);
309: ec_debug.pl(3,'TRANSACTION_LEVEL',i_level);
310: ec_debug.pl(3,'LINE_NUMBER',ec_utils.g_ext_levels(i_level).Line_Number);
311: ec_debug.pl(3,'PARENT_STAGE_ID',ec_utils.g_ext_levels(i_level).Parent_Stage_Id);
304:
305: if ec_debug.G_debug_level = 3 then
306: ec_debug.pl(3,'STAGE_ID',ec_utils.g_ext_levels(i_level).Stage_Id);
307: ec_debug.pl(3,'DOCUMENT_ID',ec_utils.g_ext_levels(i_level).Document_Id);
308: ec_debug.pl(3,'TRANSACTION_TYPE',ec_utils.g_transaction_type);
309: ec_debug.pl(3,'TRANSACTION_LEVEL',i_level);
310: ec_debug.pl(3,'LINE_NUMBER',ec_utils.g_ext_levels(i_level).Line_Number);
311: ec_debug.pl(3,'PARENT_STAGE_ID',ec_utils.g_ext_levels(i_level).Parent_Stage_Id);
312: ec_debug.pl(3,'RUN_ID',ec_utils.g_run_id);
306: ec_debug.pl(3,'STAGE_ID',ec_utils.g_ext_levels(i_level).Stage_Id);
307: ec_debug.pl(3,'DOCUMENT_ID',ec_utils.g_ext_levels(i_level).Document_Id);
308: ec_debug.pl(3,'TRANSACTION_TYPE',ec_utils.g_transaction_type);
309: ec_debug.pl(3,'TRANSACTION_LEVEL',i_level);
310: ec_debug.pl(3,'LINE_NUMBER',ec_utils.g_ext_levels(i_level).Line_Number);
311: ec_debug.pl(3,'PARENT_STAGE_ID',ec_utils.g_ext_levels(i_level).Parent_Stage_Id);
312: ec_debug.pl(3,'RUN_ID',ec_utils.g_run_id);
313: ec_debug.pl(3,'DOCUMENT_NUMBER',ec_utils.g_ext_levels(i_level).Document_Number);
314: ec_debug.pl(3,'CREATION_DATE',sysdate);
307: ec_debug.pl(3,'DOCUMENT_ID',ec_utils.g_ext_levels(i_level).Document_Id);
308: ec_debug.pl(3,'TRANSACTION_TYPE',ec_utils.g_transaction_type);
309: ec_debug.pl(3,'TRANSACTION_LEVEL',i_level);
310: ec_debug.pl(3,'LINE_NUMBER',ec_utils.g_ext_levels(i_level).Line_Number);
311: ec_debug.pl(3,'PARENT_STAGE_ID',ec_utils.g_ext_levels(i_level).Parent_Stage_Id);
312: ec_debug.pl(3,'RUN_ID',ec_utils.g_run_id);
313: ec_debug.pl(3,'DOCUMENT_NUMBER',ec_utils.g_ext_levels(i_level).Document_Number);
314: ec_debug.pl(3,'CREATION_DATE',sysdate);
315: ec_debug.pl(3,'CREATED_BY',fnd_global.user_id);
308: ec_debug.pl(3,'TRANSACTION_TYPE',ec_utils.g_transaction_type);
309: ec_debug.pl(3,'TRANSACTION_LEVEL',i_level);
310: ec_debug.pl(3,'LINE_NUMBER',ec_utils.g_ext_levels(i_level).Line_Number);
311: ec_debug.pl(3,'PARENT_STAGE_ID',ec_utils.g_ext_levels(i_level).Parent_Stage_Id);
312: ec_debug.pl(3,'RUN_ID',ec_utils.g_run_id);
313: ec_debug.pl(3,'DOCUMENT_NUMBER',ec_utils.g_ext_levels(i_level).Document_Number);
314: ec_debug.pl(3,'CREATION_DATE',sysdate);
315: ec_debug.pl(3,'CREATED_BY',fnd_global.user_id);
316: ec_debug.pl(3,'LAST_UPDATE_DATE',sysdate);
309: ec_debug.pl(3,'TRANSACTION_LEVEL',i_level);
310: ec_debug.pl(3,'LINE_NUMBER',ec_utils.g_ext_levels(i_level).Line_Number);
311: ec_debug.pl(3,'PARENT_STAGE_ID',ec_utils.g_ext_levels(i_level).Parent_Stage_Id);
312: ec_debug.pl(3,'RUN_ID',ec_utils.g_run_id);
313: ec_debug.pl(3,'DOCUMENT_NUMBER',ec_utils.g_ext_levels(i_level).Document_Number);
314: ec_debug.pl(3,'CREATION_DATE',sysdate);
315: ec_debug.pl(3,'CREATED_BY',fnd_global.user_id);
316: ec_debug.pl(3,'LAST_UPDATE_DATE',sysdate);
317: ec_debug.pl(3,'LAST_UPDATED_BY',fnd_global.user_id);
317: ec_debug.pl(3,'LAST_UPDATED_BY',fnd_global.user_id);
318: end if;
319:
320: -- Bind values for Staging Columns mapped to the Flat File
321: for k in ec_utils.g_int_levels(i_level).file_start_pos..ec_utils.g_int_levels(i_level).file_end_pos
322: loop
323: if ( ec_utils.g_file_tbl(k).staging_column is not null)
324: then
325: ins_value := replace(replace(replace(ec_utils.g_file_tbl(k).value,c_local_chr_10,''),c_local_chr_9,''),c_local_chr_13,'');
319:
320: -- Bind values for Staging Columns mapped to the Flat File
321: for k in ec_utils.g_int_levels(i_level).file_start_pos..ec_utils.g_int_levels(i_level).file_end_pos
322: loop
323: if ( ec_utils.g_file_tbl(k).staging_column is not null)
324: then
325: ins_value := replace(replace(replace(ec_utils.g_file_tbl(k).value,c_local_chr_10,''),c_local_chr_9,''),c_local_chr_13,'');
326: dbms_sql.bind_variable (
327: i_Insert_Cursor,
321: for k in ec_utils.g_int_levels(i_level).file_start_pos..ec_utils.g_int_levels(i_level).file_end_pos
322: loop
323: if ( ec_utils.g_file_tbl(k).staging_column is not null)
324: then
325: ins_value := replace(replace(replace(ec_utils.g_file_tbl(k).value,c_local_chr_10,''),c_local_chr_9,''),c_local_chr_13,'');
326: dbms_sql.bind_variable (
327: i_Insert_Cursor,
328: 'b'||k,ins_value,
329: 500
328: 'b'||k,ins_value,
329: 500
330: );
331: if ec_debug.G_debug_level = 3 then
332: ec_debug.pl(3,upper(ec_utils.g_file_tbl(k).staging_column)||'-'||
333: upper(ec_utils.g_file_tbl(k).interface_column_name),
334: ec_utils.g_file_tbl(k).value);
335: end if;
336: end if;
329: 500
330: );
331: if ec_debug.G_debug_level = 3 then
332: ec_debug.pl(3,upper(ec_utils.g_file_tbl(k).staging_column)||'-'||
333: upper(ec_utils.g_file_tbl(k).interface_column_name),
334: ec_utils.g_file_tbl(k).value);
335: end if;
336: end if;
337: end loop;
330: );
331: if ec_debug.G_debug_level = 3 then
332: ec_debug.pl(3,upper(ec_utils.g_file_tbl(k).staging_column)||'-'||
333: upper(ec_utils.g_file_tbl(k).interface_column_name),
334: ec_utils.g_file_tbl(k).value);
335: end if;
336: end if;
337: end loop;
338:
343: end if;
344: else
345: ec_debug.pl(0,'EC','ECE_STAGE_INSERT_FAILED','LEVEL',i_level);
346: ec_debug.pl(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL','EC_OUTBOUND.BIND_INSERT_STATEMENT');
347: ec_utils.i_ret_code :=2;
348: raise EC_UTILS.PROGRAM_EXIT;
349: end if;
350:
351: exception
344: else
345: ec_debug.pl(0,'EC','ECE_STAGE_INSERT_FAILED','LEVEL',i_level);
346: ec_debug.pl(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL','EC_OUTBOUND.BIND_INSERT_STATEMENT');
347: ec_utils.i_ret_code :=2;
348: raise EC_UTILS.PROGRAM_EXIT;
349: end if;
350:
351: exception
352: when others then
353: ec_debug.pl(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL','EC_OUTBOUND.BIND_INSERT_STATEMENT');
354: ec_debug.pl(0,'EC','ECE_ERROR_MESSAGE','ERROR_MESSAGE',SQLERRM);
355: ec_debug.pl(0,'EC','ECE_ERROR_SQL',null);
356:
357: ec_utils.i_ret_code :=2;
358: raise EC_UTILS.PROGRAM_EXIT;
359: end;
360: if ec_debug.G_debug_level >= 2 then
361: ec_debug.pop('EC_OUTBOUND.BIND_INSERT_STATEMENT');
354: ec_debug.pl(0,'EC','ECE_ERROR_MESSAGE','ERROR_MESSAGE',SQLERRM);
355: ec_debug.pl(0,'EC','ECE_ERROR_SQL',null);
356:
357: ec_utils.i_ret_code :=2;
358: raise EC_UTILS.PROGRAM_EXIT;
359: end;
360: if ec_debug.G_debug_level >= 2 then
361: ec_debug.pop('EC_OUTBOUND.BIND_INSERT_STATEMENT');
362: end if;
360: if ec_debug.G_debug_level >= 2 then
361: ec_debug.pop('EC_OUTBOUND.BIND_INSERT_STATEMENT');
362: end if;
363: EXCEPTION
364: WHEN EC_UTILS.PROGRAM_EXIT then
365: raise;
366: WHEN OTHERS THEN
367: ec_debug.pl(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL','EC_OUTBOUND.BIND_INSERT_STATEMENT');
368: ec_debug.pl(0,'EC','ECE_ERROR_MESSAGE','ERROR_MESSAGE',SQLERRM);
365: raise;
366: WHEN OTHERS THEN
367: ec_debug.pl(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL','EC_OUTBOUND.BIND_INSERT_STATEMENT');
368: ec_debug.pl(0,'EC','ECE_ERROR_MESSAGE','ERROR_MESSAGE',SQLERRM);
369: ec_utils.i_ret_code :=2;
370: raise EC_UTILS.PROGRAM_EXIT;
371: END bind_insert_statement;
372:
373:
366: WHEN OTHERS THEN
367: ec_debug.pl(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL','EC_OUTBOUND.BIND_INSERT_STATEMENT');
368: ec_debug.pl(0,'EC','ECE_ERROR_MESSAGE','ERROR_MESSAGE',SQLERRM);
369: ec_utils.i_ret_code :=2;
370: raise EC_UTILS.PROGRAM_EXIT;
371: END bind_insert_statement;
372:
373:
374: /**
403: fetch seq_document_id
404: into i_document_id;
405: close seq_document_id;
406:
407: ec_utils.g_ext_levels(1).document_id := i_document_id;
408: ec_utils.g_ext_levels(1).parent_stage_id := 0;
409: ec_utils.g_ext_levels(1).Line_Number := 1;
410: ec_utils.g_ext_levels(1).stage_id := i_stage_id;
411:
404: into i_document_id;
405: close seq_document_id;
406:
407: ec_utils.g_ext_levels(1).document_id := i_document_id;
408: ec_utils.g_ext_levels(1).parent_stage_id := 0;
409: ec_utils.g_ext_levels(1).Line_Number := 1;
410: ec_utils.g_ext_levels(1).stage_id := i_stage_id;
411:
412: /**
405: close seq_document_id;
406:
407: ec_utils.g_ext_levels(1).document_id := i_document_id;
408: ec_utils.g_ext_levels(1).parent_stage_id := 0;
409: ec_utils.g_ext_levels(1).Line_Number := 1;
410: ec_utils.g_ext_levels(1).stage_id := i_stage_id;
411:
412: /**
413: Initialize all the Down Levels
406:
407: ec_utils.g_ext_levels(1).document_id := i_document_id;
408: ec_utils.g_ext_levels(1).parent_stage_id := 0;
409: ec_utils.g_ext_levels(1).Line_Number := 1;
410: ec_utils.g_ext_levels(1).stage_id := i_stage_id;
411:
412: /**
413: Initialize all the Down Levels
414: **/
411:
412: /**
413: Initialize all the Down Levels
414: **/
415: for j in 2..ec_utils.g_ext_levels.COUNT
416: loop
417: ec_utils.g_ext_levels(j).document_id := i_document_id;
418: ec_utils.g_ext_levels(j).parent_stage_id := null;
419: ec_utils.g_ext_levels(j).Line_Number := 0;
413: Initialize all the Down Levels
414: **/
415: for j in 2..ec_utils.g_ext_levels.COUNT
416: loop
417: ec_utils.g_ext_levels(j).document_id := i_document_id;
418: ec_utils.g_ext_levels(j).parent_stage_id := null;
419: ec_utils.g_ext_levels(j).Line_Number := 0;
420: ec_utils.g_ext_levels(j).stage_id := null;
421: end loop;
414: **/
415: for j in 2..ec_utils.g_ext_levels.COUNT
416: loop
417: ec_utils.g_ext_levels(j).document_id := i_document_id;
418: ec_utils.g_ext_levels(j).parent_stage_id := null;
419: ec_utils.g_ext_levels(j).Line_Number := 0;
420: ec_utils.g_ext_levels(j).stage_id := null;
421: end loop;
422:
415: for j in 2..ec_utils.g_ext_levels.COUNT
416: loop
417: ec_utils.g_ext_levels(j).document_id := i_document_id;
418: ec_utils.g_ext_levels(j).parent_stage_id := null;
419: ec_utils.g_ext_levels(j).Line_Number := 0;
420: ec_utils.g_ext_levels(j).stage_id := null;
421: end loop;
422:
423:
416: loop
417: ec_utils.g_ext_levels(j).document_id := i_document_id;
418: ec_utils.g_ext_levels(j).parent_stage_id := null;
419: ec_utils.g_ext_levels(j).Line_Number := 0;
420: ec_utils.g_ext_levels(j).stage_id := null;
421: end loop;
422:
423:
424: if g_key_column_pos is null
428: end if;
429: else
430: if ec_debug.G_debug_level >= 1 then
431: ec_debug.pl(1,'EC','ECE_DOCUMENT_ID','DOCUMENT_ID',i_document_id,
432: 'DOCUMENT_NUMBER',ec_utils.g_file_tbl(g_key_column_pos).value);
433: end if;
434: ec_utils.g_ext_levels(1).Document_Number :=
435: ec_utils.g_file_tbl(g_key_column_pos).value;
436: end if;
430: if ec_debug.G_debug_level >= 1 then
431: ec_debug.pl(1,'EC','ECE_DOCUMENT_ID','DOCUMENT_ID',i_document_id,
432: 'DOCUMENT_NUMBER',ec_utils.g_file_tbl(g_key_column_pos).value);
433: end if;
434: ec_utils.g_ext_levels(1).Document_Number :=
435: ec_utils.g_file_tbl(g_key_column_pos).value;
436: end if;
437: else
438: ec_utils.g_ext_levels(i_level).Line_Number :=
431: ec_debug.pl(1,'EC','ECE_DOCUMENT_ID','DOCUMENT_ID',i_document_id,
432: 'DOCUMENT_NUMBER',ec_utils.g_file_tbl(g_key_column_pos).value);
433: end if;
434: ec_utils.g_ext_levels(1).Document_Number :=
435: ec_utils.g_file_tbl(g_key_column_pos).value;
436: end if;
437: else
438: ec_utils.g_ext_levels(i_level).Line_Number :=
439: ec_utils.g_ext_levels(i_level).Line_Number + 1;
434: ec_utils.g_ext_levels(1).Document_Number :=
435: ec_utils.g_file_tbl(g_key_column_pos).value;
436: end if;
437: else
438: ec_utils.g_ext_levels(i_level).Line_Number :=
439: ec_utils.g_ext_levels(i_level).Line_Number + 1;
440: ec_utils.g_ext_levels(i_level).stage_id := i_stage_id;
441: /**
442: If the previous Level Stage Id is null , go all the way up till you find
435: ec_utils.g_file_tbl(g_key_column_pos).value;
436: end if;
437: else
438: ec_utils.g_ext_levels(i_level).Line_Number :=
439: ec_utils.g_ext_levels(i_level).Line_Number + 1;
440: ec_utils.g_ext_levels(i_level).stage_id := i_stage_id;
441: /**
442: If the previous Level Stage Id is null , go all the way up till you find
443: a not null stage_id.
436: end if;
437: else
438: ec_utils.g_ext_levels(i_level).Line_Number :=
439: ec_utils.g_ext_levels(i_level).Line_Number + 1;
440: ec_utils.g_ext_levels(i_level).stage_id := i_stage_id;
441: /**
442: If the previous Level Stage Id is null , go all the way up till you find
443: a not null stage_id.
444: **/
443: a not null stage_id.
444: **/
445: for j in REVERSE 1..i_level-1
446: loop
447: if ec_utils.g_ext_levels(j).stage_id is not null
448: then
449: ec_utils.g_ext_levels(i_level).parent_stage_id :=
450: ec_utils.g_ext_levels(j).stage_id;
451: exit;
445: for j in REVERSE 1..i_level-1
446: loop
447: if ec_utils.g_ext_levels(j).stage_id is not null
448: then
449: ec_utils.g_ext_levels(i_level).parent_stage_id :=
450: ec_utils.g_ext_levels(j).stage_id;
451: exit;
452: end if;
453: end loop;
446: loop
447: if ec_utils.g_ext_levels(j).stage_id is not null
448: then
449: ec_utils.g_ext_levels(i_level).parent_stage_id :=
450: ec_utils.g_ext_levels(j).stage_id;
451: exit;
452: end if;
453: end loop;
454:
454:
455: /**
456: Initialize all Down Levels
457: **/
458: for j in i_level+1..ec_utils.g_ext_Levels.COUNT
459: loop
460: ec_utils.g_ext_levels(j).parent_stage_id := null;
461: ec_utils.g_ext_levels(j).Line_Number := 0;
462: end loop;
456: Initialize all Down Levels
457: **/
458: for j in i_level+1..ec_utils.g_ext_Levels.COUNT
459: loop
460: ec_utils.g_ext_levels(j).parent_stage_id := null;
461: ec_utils.g_ext_levels(j).Line_Number := 0;
462: end loop;
463: end if;
464: if ec_debug.G_debug_level = 3 then
457: **/
458: for j in i_level+1..ec_utils.g_ext_Levels.COUNT
459: loop
460: ec_utils.g_ext_levels(j).parent_stage_id := null;
461: ec_utils.g_ext_levels(j).Line_Number := 0;
462: end loop;
463: end if;
464: if ec_debug.G_debug_level = 3 then
465: ec_debug.pl(3,'Stage Id',ec_utils.g_ext_levels(i_level).Stage_Id);
461: ec_utils.g_ext_levels(j).Line_Number := 0;
462: end loop;
463: end if;
464: if ec_debug.G_debug_level = 3 then
465: ec_debug.pl(3,'Stage Id',ec_utils.g_ext_levels(i_level).Stage_Id);
466: ec_debug.pl(3,'Document Id',ec_utils.g_ext_levels(i_level).Document_Id);
467: ec_debug.pl(3,'Document Number',ec_utils.g_ext_levels(i_level).Document_Number);
468: ec_debug.pl(3,'Line Number',ec_utils.g_ext_levels(i_level).Line_Number);
469: ec_debug.pl(3,'Parent Stage Id',ec_utils.g_ext_levels(i_level).Parent_Stage_Id);
462: end loop;
463: end if;
464: if ec_debug.G_debug_level = 3 then
465: ec_debug.pl(3,'Stage Id',ec_utils.g_ext_levels(i_level).Stage_Id);
466: ec_debug.pl(3,'Document Id',ec_utils.g_ext_levels(i_level).Document_Id);
467: ec_debug.pl(3,'Document Number',ec_utils.g_ext_levels(i_level).Document_Number);
468: ec_debug.pl(3,'Line Number',ec_utils.g_ext_levels(i_level).Line_Number);
469: ec_debug.pl(3,'Parent Stage Id',ec_utils.g_ext_levels(i_level).Parent_Stage_Id);
470: ec_debug.pl(3,'Transaction Level',ec_utils.g_ext_levels(i_level).external_level);
463: end if;
464: if ec_debug.G_debug_level = 3 then
465: ec_debug.pl(3,'Stage Id',ec_utils.g_ext_levels(i_level).Stage_Id);
466: ec_debug.pl(3,'Document Id',ec_utils.g_ext_levels(i_level).Document_Id);
467: ec_debug.pl(3,'Document Number',ec_utils.g_ext_levels(i_level).Document_Number);
468: ec_debug.pl(3,'Line Number',ec_utils.g_ext_levels(i_level).Line_Number);
469: ec_debug.pl(3,'Parent Stage Id',ec_utils.g_ext_levels(i_level).Parent_Stage_Id);
470: ec_debug.pl(3,'Transaction Level',ec_utils.g_ext_levels(i_level).external_level);
471: end if;
464: if ec_debug.G_debug_level = 3 then
465: ec_debug.pl(3,'Stage Id',ec_utils.g_ext_levels(i_level).Stage_Id);
466: ec_debug.pl(3,'Document Id',ec_utils.g_ext_levels(i_level).Document_Id);
467: ec_debug.pl(3,'Document Number',ec_utils.g_ext_levels(i_level).Document_Number);
468: ec_debug.pl(3,'Line Number',ec_utils.g_ext_levels(i_level).Line_Number);
469: ec_debug.pl(3,'Parent Stage Id',ec_utils.g_ext_levels(i_level).Parent_Stage_Id);
470: ec_debug.pl(3,'Transaction Level',ec_utils.g_ext_levels(i_level).external_level);
471: end if;
472:
465: ec_debug.pl(3,'Stage Id',ec_utils.g_ext_levels(i_level).Stage_Id);
466: ec_debug.pl(3,'Document Id',ec_utils.g_ext_levels(i_level).Document_Id);
467: ec_debug.pl(3,'Document Number',ec_utils.g_ext_levels(i_level).Document_Number);
468: ec_debug.pl(3,'Line Number',ec_utils.g_ext_levels(i_level).Line_Number);
469: ec_debug.pl(3,'Parent Stage Id',ec_utils.g_ext_levels(i_level).Parent_Stage_Id);
470: ec_debug.pl(3,'Transaction Level',ec_utils.g_ext_levels(i_level).external_level);
471: end if;
472:
473: bind_insert_statement
466: ec_debug.pl(3,'Document Id',ec_utils.g_ext_levels(i_level).Document_Id);
467: ec_debug.pl(3,'Document Number',ec_utils.g_ext_levels(i_level).Document_Number);
468: ec_debug.pl(3,'Line Number',ec_utils.g_ext_levels(i_level).Line_Number);
469: ec_debug.pl(3,'Parent Stage Id',ec_utils.g_ext_levels(i_level).Parent_Stage_Id);
470: ec_debug.pl(3,'Transaction Level',ec_utils.g_ext_levels(i_level).external_level);
471: end if;
472:
473: bind_insert_statement
474: (
478: ec_debug.pop('EC_OUTBOUND.INSERT_INTO_STAGE');
479: end if;
480:
481: EXCEPTION
482: WHEN EC_UTILS.PROGRAM_EXIT then
483: raise;
484: WHEN OTHERS THEN
485: ec_debug.pl(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL','EC_OUTBOUND.INSERT_INTO_STAGE');
486: ec_debug.pl(0,'EC','ECE_ERROR_MESSAGE','ERROR_MESSAGE',SQLERRM);
483: raise;
484: WHEN OTHERS THEN
485: ec_debug.pl(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL','EC_OUTBOUND.INSERT_INTO_STAGE');
486: ec_debug.pl(0,'EC','ECE_ERROR_MESSAGE','ERROR_MESSAGE',SQLERRM);
487: ec_utils.i_ret_code :=2;
488: raise EC_UTILS.PROGRAM_EXIT;
489: END insert_into_stage;
490:
491:
484: WHEN OTHERS THEN
485: ec_debug.pl(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL','EC_OUTBOUND.INSERT_INTO_STAGE');
486: ec_debug.pl(0,'EC','ECE_ERROR_MESSAGE','ERROR_MESSAGE',SQLERRM);
487: ec_utils.i_ret_code :=2;
488: raise EC_UTILS.PROGRAM_EXIT;
489: END insert_into_stage;
490:
491:
492: /**
514: ec_debug.push('EC_OUTBOUND.FETCH_DATA_FROM_VIEW');
515: ec_debug.pl(3,'i_level',i_level);
516: end if;
517:
518: for i in 1..ec_utils.g_int_levels.COUNT
519: loop
520: IF ec_utils.g_int_levels(i).parent_level = i_level
521: THEN
522: -- Set the Global Variable for Current Level
516: end if;
517:
518: for i in 1..ec_utils.g_int_levels.COUNT
519: loop
520: IF ec_utils.g_int_levels(i).parent_level = i_level
521: THEN
522: -- Set the Global Variable for Current Level
523: ec_utils.g_current_level := i;
524: ec_utils.execute_stage_data
519: loop
520: IF ec_utils.g_int_levels(i).parent_level = i_level
521: THEN
522: -- Set the Global Variable for Current Level
523: ec_utils.g_current_level := i;
524: ec_utils.execute_stage_data
525: (
526: 20,
527: i
520: IF ec_utils.g_int_levels(i).parent_level = i_level
521: THEN
522: -- Set the Global Variable for Current Level
523: ec_utils.g_current_level := i;
524: ec_utils.execute_stage_data
525: (
526: 20,
527: i
528: );
526: 20,
527: i
528: );
529:
530: i_rows_processed := dbms_sql.execute (ec_utils.g_int_levels(i).Cursor_Handle);
531: if ec_debug.G_debug_level = 3 then
532: ec_debug.pl(3,'Cursor Handle',ec_utils.g_int_levels(i).Cursor_handle);
533: end if;
534: while dbms_sql.fetch_rows( ec_utils.g_int_levels(i).Cursor_handle) > 0
528: );
529:
530: i_rows_processed := dbms_sql.execute (ec_utils.g_int_levels(i).Cursor_Handle);
531: if ec_debug.G_debug_level = 3 then
532: ec_debug.pl(3,'Cursor Handle',ec_utils.g_int_levels(i).Cursor_handle);
533: end if;
534: while dbms_sql.fetch_rows( ec_utils.g_int_levels(i).Cursor_handle) > 0
535: LOOP
536: if ec_debug.G_debug_level = 3 then
530: i_rows_processed := dbms_sql.execute (ec_utils.g_int_levels(i).Cursor_Handle);
531: if ec_debug.G_debug_level = 3 then
532: ec_debug.pl(3,'Cursor Handle',ec_utils.g_int_levels(i).Cursor_handle);
533: end if;
534: while dbms_sql.fetch_rows( ec_utils.g_int_levels(i).Cursor_handle) > 0
535: LOOP
536: if ec_debug.G_debug_level = 3 then
537: ec_debug.pl(3,'Processing Row: '||dbms_sql.last_row_count||' for Level '||
538: ec_utils.g_int_levels(i).interface_level);
534: while dbms_sql.fetch_rows( ec_utils.g_int_levels(i).Cursor_handle) > 0
535: LOOP
536: if ec_debug.G_debug_level = 3 then
537: ec_debug.pl(3,'Processing Row: '||dbms_sql.last_row_count||' for Level '||
538: ec_utils.g_int_levels(i).interface_level);
539: end if;
540: -- Get Values from the View
541: -- Initialize the Column Counter
542: i_column_counter :=0;
539: end if;
540: -- Get Values from the View
541: -- Initialize the Column Counter
542: i_column_counter :=0;
543: for j in ec_utils.g_int_levels(i).file_start_pos..ec_utils.g_int_levels(i).file_end_pos
544: loop
545: i_column_counter := i_column_counter + 1;
546:
547: dbms_sql.column_value
545: i_column_counter := i_column_counter + 1;
546:
547: dbms_sql.column_value
548: (
549: ec_utils.g_int_levels(i).Cursor_handle,
550: i_column_counter,
551: ec_utils.g_file_tbl(j).value
552: );
553: if ec_debug.G_debug_level = 3 then
547: dbms_sql.column_value
548: (
549: ec_utils.g_int_levels(i).Cursor_handle,
550: i_column_counter,
551: ec_utils.g_file_tbl(j).value
552: );
553: if ec_debug.G_debug_level = 3 then
554: if ec_utils.g_file_tbl(j).base_column_name is not null
555: then
550: i_column_counter,
551: ec_utils.g_file_tbl(j).value
552: );
553: if ec_debug.G_debug_level = 3 then
554: if ec_utils.g_file_tbl(j).base_column_name is not null
555: then
556: ec_debug.pl(
557: 3,
558: ec_utils.g_file_tbl(j).base_column_name,
554: if ec_utils.g_file_tbl(j).base_column_name is not null
555: then
556: ec_debug.pl(
557: 3,
558: ec_utils.g_file_tbl(j).base_column_name,
559: ec_utils.g_file_tbl(j).value
560: );
561: end if;
562: end if;
555: then
556: ec_debug.pl(
557: 3,
558: ec_utils.g_file_tbl(j).base_column_name,
559: ec_utils.g_file_tbl(j).value
560: );
561: end if;
562: end if;
563: end loop;
562: end if;
563: end loop;
564:
565: -- Stage 30 Actions
566: ec_utils.execute_stage_data
567: (
568: 30,
569: i
570: );
569: i
570: );
571:
572:
573: for k in 1..ec_utils.g_int_ext_levels.COUNT
574: loop
575: if ec_utils.g_int_ext_levels(k).interface_level = i
576: then
577: if k < ec_utils.g_int_ext_levels.COUNT
571:
572:
573: for k in 1..ec_utils.g_int_ext_levels.COUNT
574: loop
575: if ec_utils.g_int_ext_levels(k).interface_level = i
576: then
577: if k < ec_utils.g_int_ext_levels.COUNT
578: then
579: if ec_utils.g_int_ext_levels(k+1).external_level <>
573: for k in 1..ec_utils.g_int_ext_levels.COUNT
574: loop
575: if ec_utils.g_int_ext_levels(k).interface_level = i
576: then
577: if k < ec_utils.g_int_ext_levels.COUNT
578: then
579: if ec_utils.g_int_ext_levels(k+1).external_level <>
580: ec_utils.g_int_ext_levels(k).external_level
581: then
575: if ec_utils.g_int_ext_levels(k).interface_level = i
576: then
577: if k < ec_utils.g_int_ext_levels.COUNT
578: then
579: if ec_utils.g_int_ext_levels(k+1).external_level <>
580: ec_utils.g_int_ext_levels(k).external_level
581: then
582:
583: /**
576: then
577: if k < ec_utils.g_int_ext_levels.COUNT
578: then
579: if ec_utils.g_int_ext_levels(k+1).external_level <>
580: ec_utils.g_int_ext_levels(k).external_level
581: then
582:
583: /**
584: Perform Code Conversion
592: p_validation_level => i_validation_level,
593: p_return_status => i_return_status,
594: p_msg_count => i_msg_count,
595: p_msg_data => i_msg_data,
596: p_level => ec_utils.g_int_ext_levels(k).external_level,
597: p_tbl => ec_utils.g_file_tbl
598: );
599:
600: /**
593: p_return_status => i_return_status,
594: p_msg_count => i_msg_count,
595: p_msg_data => i_msg_data,
596: p_level => ec_utils.g_int_ext_levels(k).external_level,
597: p_tbl => ec_utils.g_file_tbl
598: );
599:
600: /**
601: Check the Status of the Code Conversion API
609: THEN
610: ec_debug.pl(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL',
611: 'EC_OUTBOUND.FETCH_DATA_FROM_VIEW');
612: ec_debug.pl(0,'EC','EC_CODE_CONVERSION_FAILED','LEVEL',i);
613: ec_utils.i_ret_code := 2;
614: RAISE EC_UTILS.PROGRAM_EXIT;
615: END IF;
616:
617: -- Stage 40 Actions
610: ec_debug.pl(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL',
611: 'EC_OUTBOUND.FETCH_DATA_FROM_VIEW');
612: ec_debug.pl(0,'EC','EC_CODE_CONVERSION_FAILED','LEVEL',i);
613: ec_utils.i_ret_code := 2;
614: RAISE EC_UTILS.PROGRAM_EXIT;
615: END IF;
616:
617: -- Stage 40 Actions
618: ec_utils.execute_stage_data
614: RAISE EC_UTILS.PROGRAM_EXIT;
615: END IF;
616:
617: -- Stage 40 Actions
618: ec_utils.execute_stage_data
619: (
620: 40,
621: i
622: );
626: **/
627: --Insert into Staging
628: insert_into_stage
629: (
630: ec_utils.g_int_ext_levels(k).external_level
631: );
632:
633: end if;
634: else
644: p_validation_level => i_validation_level,
645: p_return_status => i_return_status,
646: p_msg_count => i_msg_count,
647: p_msg_data => i_msg_data,
648: p_level => ec_utils.g_int_ext_levels(k).external_level,
649: p_tbl => ec_utils.g_file_tbl
650: );
651:
652: /**
645: p_return_status => i_return_status,
646: p_msg_count => i_msg_count,
647: p_msg_data => i_msg_data,
648: p_level => ec_utils.g_int_ext_levels(k).external_level,
649: p_tbl => ec_utils.g_file_tbl
650: );
651:
652: /**
653: Check the Status of the Code Conversion API
661: THEN
662: ec_debug.pl(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL',
663: 'EC_OUTBOUND.FETCH_DATA_FROM_VIEW');
664: ec_debug.pl(0,'EC','EC_CODE_CONVERSION_FAILED','LEVEL',i);
665: ec_utils.i_ret_code := 2;
666: RAISE EC_UTILS.PROGRAM_EXIT;
667: END IF;
668:
669: -- Stage 40 Actions
662: ec_debug.pl(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL',
663: 'EC_OUTBOUND.FETCH_DATA_FROM_VIEW');
664: ec_debug.pl(0,'EC','EC_CODE_CONVERSION_FAILED','LEVEL',i);
665: ec_utils.i_ret_code := 2;
666: RAISE EC_UTILS.PROGRAM_EXIT;
667: END IF;
668:
669: -- Stage 40 Actions
670: ec_utils.execute_stage_data
666: RAISE EC_UTILS.PROGRAM_EXIT;
667: END IF;
668:
669: -- Stage 40 Actions
670: ec_utils.execute_stage_data
671: (
672: 40,
673: i
674: );
678: **/
679: --Insert into Staging
680: insert_into_stage
681: (
682: ec_utils.g_int_ext_levels(k).external_level
683: );
684: end if;
685: end if;
686: end loop;
685: end if;
686: end loop;
687:
688: -- Stage 50 Actions
689: ec_utils.execute_stage_data
690: (
691: 50,
692: i
693: );
697:
698: END LOOP;
699: if i = 1
700: then
701: ec_utils.g_int_levels(i).rows_processed := dbms_sql.last_row_count;
702: else
703: ec_utils.g_int_levels(i).rows_processed :=
704: ec_utils.g_int_levels(i).rows_processed + dbms_sql.last_row_count;
705: end if;
699: if i = 1
700: then
701: ec_utils.g_int_levels(i).rows_processed := dbms_sql.last_row_count;
702: else
703: ec_utils.g_int_levels(i).rows_processed :=
704: ec_utils.g_int_levels(i).rows_processed + dbms_sql.last_row_count;
705: end if;
706:
707: END IF;
700: then
701: ec_utils.g_int_levels(i).rows_processed := dbms_sql.last_row_count;
702: else
703: ec_utils.g_int_levels(i).rows_processed :=
704: ec_utils.g_int_levels(i).rows_processed + dbms_sql.last_row_count;
705: end if;
706:
707: END IF;
708: end loop;
710: ec_debug.pop('EC_OUTBOUND.FETCH_DATA_FROM_VIEW');
711: end if;
712:
713: EXCEPTION
714: WHEN EC_UTILS.PROGRAM_EXIT then
715: raise;
716: WHEN OTHERS THEN
717: ec_debug.pl(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL','EC_OUTBOUND.FETCH_DATA_FROM_VIEW');
718: ec_debug.pl(0,'EC','ECE_ERROR_MESSAGE','ERROR_MESSAGE',SQLERRM);
715: raise;
716: WHEN OTHERS THEN
717: ec_debug.pl(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL','EC_OUTBOUND.FETCH_DATA_FROM_VIEW');
718: ec_debug.pl(0,'EC','ECE_ERROR_MESSAGE','ERROR_MESSAGE',SQLERRM);
719: ec_utils.i_ret_code :=2;
720: raise EC_UTILS.PROGRAM_EXIT;
721: END fetch_data_from_view;
722:
723: /**
716: WHEN OTHERS THEN
717: ec_debug.pl(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL','EC_OUTBOUND.FETCH_DATA_FROM_VIEW');
718: ec_debug.pl(0,'EC','ECE_ERROR_MESSAGE','ERROR_MESSAGE',SQLERRM);
719: ec_utils.i_ret_code :=2;
720: raise EC_UTILS.PROGRAM_EXIT;
721: END fetch_data_from_view;
722:
723: /**
724: Closes all the cursor handles .
733: Successful execution of the transaction. Close the Cursor handles,
734: Disbale the Debug.
735: **/
736:
737: for i in 1..ec_utils.g_procedure_stack.COUNT
738: loop
739: if dbms_sql.IS_OPEN(ec_utils.g_procedure_stack(i).Cursor_Handle)
740: then
741: dbms_sql.close_cursor(ec_utils.g_procedure_stack(i).Cursor_Handle);
735: **/
736:
737: for i in 1..ec_utils.g_procedure_stack.COUNT
738: loop
739: if dbms_sql.IS_OPEN(ec_utils.g_procedure_stack(i).Cursor_Handle)
740: then
741: dbms_sql.close_cursor(ec_utils.g_procedure_stack(i).Cursor_Handle);
742: end if;
743: end loop;
737: for i in 1..ec_utils.g_procedure_stack.COUNT
738: loop
739: if dbms_sql.IS_OPEN(ec_utils.g_procedure_stack(i).Cursor_Handle)
740: then
741: dbms_sql.close_cursor(ec_utils.g_procedure_stack(i).Cursor_Handle);
742: end if;
743: end loop;
744:
745: for i in 1..ec_utils.g_int_levels.COUNT
741: dbms_sql.close_cursor(ec_utils.g_procedure_stack(i).Cursor_Handle);
742: end if;
743: end loop;
744:
745: for i in 1..ec_utils.g_int_levels.COUNT
746: loop
747: if dbms_sql.IS_OPEN(ec_utils.g_int_levels(i).Cursor_Handle)
748: then
749: dbms_sql.close_cursor(ec_utils.g_int_levels(i).Cursor_Handle);
743: end loop;
744:
745: for i in 1..ec_utils.g_int_levels.COUNT
746: loop
747: if dbms_sql.IS_OPEN(ec_utils.g_int_levels(i).Cursor_Handle)
748: then
749: dbms_sql.close_cursor(ec_utils.g_int_levels(i).Cursor_Handle);
750: end if;
751: end loop;
745: for i in 1..ec_utils.g_int_levels.COUNT
746: loop
747: if dbms_sql.IS_OPEN(ec_utils.g_int_levels(i).Cursor_Handle)
748: then
749: dbms_sql.close_cursor(ec_utils.g_int_levels(i).Cursor_Handle);
750: end if;
751: end loop;
752:
753: for i in 1..ec_utils.g_ext_levels.COUNT
749: dbms_sql.close_cursor(ec_utils.g_int_levels(i).Cursor_Handle);
750: end if;
751: end loop;
752:
753: for i in 1..ec_utils.g_ext_levels.COUNT
754: loop
755:
756: if dbms_sql.IS_OPEN(ec_utils.g_ext_levels(i).cursor_handle)
757: then
752:
753: for i in 1..ec_utils.g_ext_levels.COUNT
754: loop
755:
756: if dbms_sql.IS_OPEN(ec_utils.g_ext_levels(i).cursor_handle)
757: then
758: dbms_sql.close_cursor(ec_utils.g_ext_levels(i).cursor_handle);
759: end if;
760: end loop;
754: loop
755:
756: if dbms_sql.IS_OPEN(ec_utils.g_ext_levels(i).cursor_handle)
757: then
758: dbms_sql.close_cursor(ec_utils.g_ext_levels(i).cursor_handle);
759: end if;
760: end loop;
761: if ec_debug.G_debug_level >= 2 then
762: ec_debug.pop('EC_OUTBOUND.CLOSE_OUTBOUND');
765: exception
766: WHEN OTHERS THEN
767: ec_debug.pl(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL','EC_OUTBOUND.CLOSE_OUTBOUND');
768: ec_debug.pl(0,'EC','ECE_ERROR_MESSAGE','ERROR_MESSAGE',SQLERRM);
769: ec_utils.i_ret_code :=2;
770: raise EC_UTILS.PROGRAM_EXIT;
771: end close_outbound;
772:
773: /**
766: WHEN OTHERS THEN
767: ec_debug.pl(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL','EC_OUTBOUND.CLOSE_OUTBOUND');
768: ec_debug.pl(0,'EC','ECE_ERROR_MESSAGE','ERROR_MESSAGE',SQLERRM);
769: ec_utils.i_ret_code :=2;
770: raise EC_UTILS.PROGRAM_EXIT;
771: end close_outbound;
772:
773: /**
774: Main Call for Processing Outbound Documents
789: ec_debug.push('EC_OUTBOUND.PROCESS_OUTBOUND_DOCUMENTS');
790: end if;
791:
792: /** Initialize Memory Structures**/
793: ec_utils.g_file_tbl.DELETE;
794: ec_utils.g_int_levels.DELETE;
795: ec_utils.g_ext_levels.DELETE;
796: ec_utils.g_int_ext_levels.DELETE;
797: ec_utils.g_stage_data.DELETE;
790: end if;
791:
792: /** Initialize Memory Structures**/
793: ec_utils.g_file_tbl.DELETE;
794: ec_utils.g_int_levels.DELETE;
795: ec_utils.g_ext_levels.DELETE;
796: ec_utils.g_int_ext_levels.DELETE;
797: ec_utils.g_stage_data.DELETE;
798: ec_utils.g_parameter_stack.DELETE;
791:
792: /** Initialize Memory Structures**/
793: ec_utils.g_file_tbl.DELETE;
794: ec_utils.g_int_levels.DELETE;
795: ec_utils.g_ext_levels.DELETE;
796: ec_utils.g_int_ext_levels.DELETE;
797: ec_utils.g_stage_data.DELETE;
798: ec_utils.g_parameter_stack.DELETE;
799: ec_utils.g_procedure_stack.DELETE;
792: /** Initialize Memory Structures**/
793: ec_utils.g_file_tbl.DELETE;
794: ec_utils.g_int_levels.DELETE;
795: ec_utils.g_ext_levels.DELETE;
796: ec_utils.g_int_ext_levels.DELETE;
797: ec_utils.g_stage_data.DELETE;
798: ec_utils.g_parameter_stack.DELETE;
799: ec_utils.g_procedure_stack.DELETE;
800: ec_utils.g_procedure_mappings.DELETE;
793: ec_utils.g_file_tbl.DELETE;
794: ec_utils.g_int_levels.DELETE;
795: ec_utils.g_ext_levels.DELETE;
796: ec_utils.g_int_ext_levels.DELETE;
797: ec_utils.g_stage_data.DELETE;
798: ec_utils.g_parameter_stack.DELETE;
799: ec_utils.g_procedure_stack.DELETE;
800: ec_utils.g_procedure_mappings.DELETE;
801: ec_utils.g_stack_pointer.DELETE;
794: ec_utils.g_int_levels.DELETE;
795: ec_utils.g_ext_levels.DELETE;
796: ec_utils.g_int_ext_levels.DELETE;
797: ec_utils.g_stage_data.DELETE;
798: ec_utils.g_parameter_stack.DELETE;
799: ec_utils.g_procedure_stack.DELETE;
800: ec_utils.g_procedure_mappings.DELETE;
801: ec_utils.g_stack_pointer.DELETE;
802: ec_utils.g_transaction_type := i_transaction_type;
795: ec_utils.g_ext_levels.DELETE;
796: ec_utils.g_int_ext_levels.DELETE;
797: ec_utils.g_stage_data.DELETE;
798: ec_utils.g_parameter_stack.DELETE;
799: ec_utils.g_procedure_stack.DELETE;
800: ec_utils.g_procedure_mappings.DELETE;
801: ec_utils.g_stack_pointer.DELETE;
802: ec_utils.g_transaction_type := i_transaction_type;
803: ec_utils.g_direction := substrb(i_transaction_type,length(i_transaction_type),1);
796: ec_utils.g_int_ext_levels.DELETE;
797: ec_utils.g_stage_data.DELETE;
798: ec_utils.g_parameter_stack.DELETE;
799: ec_utils.g_procedure_stack.DELETE;
800: ec_utils.g_procedure_mappings.DELETE;
801: ec_utils.g_stack_pointer.DELETE;
802: ec_utils.g_transaction_type := i_transaction_type;
803: ec_utils.g_direction := substrb(i_transaction_type,length(i_transaction_type),1);
804: ec_utils.g_map_id := i_map_id;
797: ec_utils.g_stage_data.DELETE;
798: ec_utils.g_parameter_stack.DELETE;
799: ec_utils.g_procedure_stack.DELETE;
800: ec_utils.g_procedure_mappings.DELETE;
801: ec_utils.g_stack_pointer.DELETE;
802: ec_utils.g_transaction_type := i_transaction_type;
803: ec_utils.g_direction := substrb(i_transaction_type,length(i_transaction_type),1);
804: ec_utils.g_map_id := i_map_id;
805:
798: ec_utils.g_parameter_stack.DELETE;
799: ec_utils.g_procedure_stack.DELETE;
800: ec_utils.g_procedure_mappings.DELETE;
801: ec_utils.g_stack_pointer.DELETE;
802: ec_utils.g_transaction_type := i_transaction_type;
803: ec_utils.g_direction := substrb(i_transaction_type,length(i_transaction_type),1);
804: ec_utils.g_map_id := i_map_id;
805:
806: if ec_debug.G_debug_level = 3 then
799: ec_utils.g_procedure_stack.DELETE;
800: ec_utils.g_procedure_mappings.DELETE;
801: ec_utils.g_stack_pointer.DELETE;
802: ec_utils.g_transaction_type := i_transaction_type;
803: ec_utils.g_direction := substrb(i_transaction_type,length(i_transaction_type),1);
804: ec_utils.g_map_id := i_map_id;
805:
806: if ec_debug.G_debug_level = 3 then
807: ec_debug.pl(3,'g_direction',ec_utils.g_direction);
800: ec_utils.g_procedure_mappings.DELETE;
801: ec_utils.g_stack_pointer.DELETE;
802: ec_utils.g_transaction_type := i_transaction_type;
803: ec_utils.g_direction := substrb(i_transaction_type,length(i_transaction_type),1);
804: ec_utils.g_map_id := i_map_id;
805:
806: if ec_debug.G_debug_level = 3 then
807: ec_debug.pl(3,'g_direction',ec_utils.g_direction);
808: end if;
803: ec_utils.g_direction := substrb(i_transaction_type,length(i_transaction_type),1);
804: ec_utils.g_map_id := i_map_id;
805:
806: if ec_debug.G_debug_level = 3 then
807: ec_debug.pl(3,'g_direction',ec_utils.g_direction);
808: end if;
809: /**
810: If the program is run from SQLplus , the Concurrent Request id is
811: < 0. In this case , get the run id from ECE_OUTPUT_RUNS_S.NEXTVAL.
816: select ece_output_runs_s.NEXTVAL
817: into i_run_id
818: from dual;
819: end if;
820: ec_utils.g_run_id := i_run_id;
821: if ec_debug.G_debug_level = 3 then
822: ec_debug.pl(3,'Run Id for the Transaction',ec_utils.g_run_id);
823: end if;
824:
818: from dual;
819: end if;
820: ec_utils.g_run_id := i_run_id;
821: if ec_debug.G_debug_level = 3 then
822: ec_debug.pl(3,'Run Id for the Transaction',ec_utils.g_run_id);
823: end if;
824:
825: ec_utils.get_tran_stage_data
826: (
821: if ec_debug.G_debug_level = 3 then
822: ec_debug.pl(3,'Run Id for the Transaction',ec_utils.g_run_id);
823: end if;
824:
825: ec_utils.get_tran_stage_data
826: (
827: i_transaction_type,
828: i_map_id
829: );
833: i_transaction_type,
834: i_map_id
835: );
836:
837: ec_utils.sort_stage_data;
838:
839: ec_utils.find_pos
840: (
841: 1,
835: );
836:
837: ec_utils.sort_stage_data;
838:
839: ec_utils.find_pos
840: (
841: 1,
842: ec_utils.g_int_levels(1).key_column_name,
843: i_plsql_pos,
838:
839: ec_utils.find_pos
840: (
841: 1,
842: ec_utils.g_int_levels(1).key_column_name,
843: i_plsql_pos,
844: TRUE
845: );
846:
845: );
846:
847: g_key_column_pos := i_plsql_pos;
848:
849: ec_utils.i_stage_data := ec_utils.i_tmp_stage_data; -- 2920679
850:
851: ec_utils.execute_stage_data
852: (
853: 10,
847: g_key_column_pos := i_plsql_pos;
848:
849: ec_utils.i_stage_data := ec_utils.i_tmp_stage_data; -- 2920679
850:
851: ec_utils.execute_stage_data
852: (
853: 10,
854: 0
855: );
857: load_objects;
858:
859: fetch_data_from_view (0);
860: if ec_debug.G_debug_level >= 1 then
861: for i in 1..ec_utils.g_int_levels.COUNT
862: loop
863: ec_debug.pl(1,ec_utils.g_int_levels(i).rows_processed||' row(s) processed for Level '||i);
864: end loop;
865: end if;
859: fetch_data_from_view (0);
860: if ec_debug.G_debug_level >= 1 then
861: for i in 1..ec_utils.g_int_levels.COUNT
862: loop
863: ec_debug.pl(1,ec_utils.g_int_levels(i).rows_processed||' row(s) processed for Level '||i);
864: end loop;
865: end if;
866: ec_debug.pl(0,'EC','ECE_DOCUMENTS_PROCESSED','NO_OF_DOCS',ec_utils.g_int_levels(1).rows_processed);
867:
862: loop
863: ec_debug.pl(1,ec_utils.g_int_levels(i).rows_processed||' row(s) processed for Level '||i);
864: end loop;
865: end if;
866: ec_debug.pl(0,'EC','ECE_DOCUMENTS_PROCESSED','NO_OF_DOCS',ec_utils.g_int_levels(1).rows_processed);
867:
868: close_outbound;
869: if ec_debug.G_debug_level >= 2 then
870: ec_debug.pop('EC_OUTBOUND.PROCESS_OUTBOUND_DOCUMENTS');
870: ec_debug.pop('EC_OUTBOUND.PROCESS_OUTBOUND_DOCUMENTS');
871: end if;
872: ec_debug.pl(0,'EC','ECE_FINISH_OUTBOUND','TRANSACTION_TYPE',i_transaction_type,'MAP_ID',i_map_id);
873: EXCEPTION
874: WHEN EC_UTILS.PROGRAM_EXIT then
875: raise;
876: WHEN OTHERS THEN
877: ec_debug.pl(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL','EC_OUTBOUND.PROCESS_OUTBOUND_DOCUMENTS');
878: ec_debug.pl(0,'EC','ECE_ERROR_CODE','ERROR_CODE',SQLCODE);
878: ec_debug.pl(0,'EC','ECE_ERROR_CODE','ERROR_CODE',SQLCODE);
879: ec_debug.pl(0,'EC','ECE_ERROR_MESSAGE','ERROR_MESSAGE',SQLERRM);
880: close_outbound;
881: ec_debug.pop('EC_OUTBOUND.PROCESS_OUTBOUND_DOCUMENTS');
882: raise EC_UTILS.PROGRAM_EXIT;
883: end process_outbound_documents;
884:
885: /**
886: This file will delete all records in a staging table without using the
903: ec_debug.pl(0,'EC','ECE_PARAM_MISSING','PARAMETER','I_RUN_ID', 'PROCEDURE','EC_OUTBOUND.DELETE_STAGE_DATA');
904: /**
905: Set the FAILURE Retcode for the Concurrent Manager
906: **/
907: EC_UTILS.i_ret_code := 2;
908: raise EC_UTILS.PROGRAM_EXIT;
909: END IF;
910:
911: /**
904: /**
905: Set the FAILURE Retcode for the Concurrent Manager
906: **/
907: EC_UTILS.i_ret_code := 2;
908: raise EC_UTILS.PROGRAM_EXIT;
909: END IF;
910:
911: /**
912: Delete all indicated records from ECE_STAGE
928:
929: ec_debug.pop('EC_OUTBOUND.DELETE_STAGE_DATA');
930: end if;
931: EXCEPTION
932: WHEN EC_UTILS.PROGRAM_EXIT then
933: raise;
934: WHEN OTHERS THEN
935: ec_debug.pl(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL','EC_OUTBOUND.DELETE_STAGE_DATA');
936: ec_debug.pl(0,'EC','ECE_ERROR_MESSAGE','ERROR_MESSAGE',SQLERRM);
933: raise;
934: WHEN OTHERS THEN
935: ec_debug.pl(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL','EC_OUTBOUND.DELETE_STAGE_DATA');
936: ec_debug.pl(0,'EC','ECE_ERROR_MESSAGE','ERROR_MESSAGE',SQLERRM);
937: ec_utils.i_ret_code:=2;
938: raise EC_UTILS.PROGRAM_EXIT;
939: END delete_stage_data;
940:
941: end ec_outbound;
934: WHEN OTHERS THEN
935: ec_debug.pl(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL','EC_OUTBOUND.DELETE_STAGE_DATA');
936: ec_debug.pl(0,'EC','ECE_ERROR_MESSAGE','ERROR_MESSAGE',SQLERRM);
937: ec_utils.i_ret_code:=2;
938: raise EC_UTILS.PROGRAM_EXIT;
939: END delete_stage_data;
940:
941: end ec_outbound;