DBA Data[Home] [Help]

APPS.DDR_WEBSERVICES_PUB dependencies on UTL_FILE

Line 1288: l_xml_file UTL_FILE.file_type;

1284: l_cnt NUMBER;
1285: l_status NUMBER;
1286: l_val VARCHAR2(200);
1287: l_col_name VARCHAR2(200);
1288: l_xml_file UTL_FILE.file_type;
1289: l_fetch_ctn NUMBER:=0;
1290: l_fetch_rows NUMBER:=0;
1291: l_file_name VARCHAR2(30):=null;
1292: l_total_row_count NUMBER:=0;

Line 1313: l_xml_file := UTL_FILE.fopen(l_dir_name,l_file_name,ddr_webservices_constants.g_file_write_mode);

1309: l_file_id :=get_ddr_ws_file_seq_nextval(x_return_status,x_msg_count,x_msg_data);
1310: --construct file name
1311: l_file_name := p_fact_code || '_'|| l_file_id || '.xml';
1312: --open file in write mode
1313: l_xml_file := UTL_FILE.fopen(l_dir_name,l_file_name,ddr_webservices_constants.g_file_write_mode);
1314: --write xml header data in the xml file
1315: UTL_FILE.put_line(l_xml_file, '');
1316: --open cursor
1317: l_cur := dbms_sql.open_cursor;

Line 1315: UTL_FILE.put_line(l_xml_file, '');

1311: l_file_name := p_fact_code || '_'|| l_file_id || '.xml';
1312: --open file in write mode
1313: l_xml_file := UTL_FILE.fopen(l_dir_name,l_file_name,ddr_webservices_constants.g_file_write_mode);
1314: --write xml header data in the xml file
1315: UTL_FILE.put_line(l_xml_file, '');
1316: --open cursor
1317: l_cur := dbms_sql.open_cursor;
1318: dbms_sql.parse(l_cur,p_query,dbms_sql.native);
1319: l_status := dbms_sql.execute(l_cur);

Line 1325: UTL_FILE.put_line(l_xml_file, '');

1321: dbms_sql.describe_columns(l_cur,l_cnt,l_dtbl);
1322: FOR i in 1..l_cnt LOOP
1323: dbms_sql.define_column(l_cur,i,l_val,30);
1324: END LOOP;
1325: UTL_FILE.put_line(l_xml_file, '');
1326: l_fetch_rows:=dbms_sql.fetch_rows(l_cur);
1327: WHILE ( l_fetch_rows > 0 ) LOOP
1328: l_fetch_ctn:=l_fetch_ctn+l_fetch_rows;
1329: UTL_FILE.put_line(l_xml_file, '');

Line 1329: UTL_FILE.put_line(l_xml_file, '');

1325: UTL_FILE.put_line(l_xml_file, '');
1326: l_fetch_rows:=dbms_sql.fetch_rows(l_cur);
1327: WHILE ( l_fetch_rows > 0 ) LOOP
1328: l_fetch_ctn:=l_fetch_ctn+l_fetch_rows;
1329: UTL_FILE.put_line(l_xml_file, '');
1330: l_fact:=null;
1331: --write individual row in the xml file
1332: FOR i in 1..l_cnt loop
1333: l_col_name:= l_dtbl(i).col_name;

Line 1340: -- UTL_FILE.put_line(l_xml_file, l_fact||chr(10)||'');

1336: -- Use of chr function not allowed by GSCC. The new line character is introduced using line edit
1337: l_fact:=l_fact||'<'||l_col_name||'>'||l_val||''||'
1338: '||NULL;
1339: END LOOP;
1340: -- UTL_FILE.put_line(l_xml_file, l_fact||chr(10)||'');
1341: -- Use of chr function not allowed by GSCC. The new line character is introduced using line edit
1342: UTL_FILE.put_line(l_xml_file, l_fact||'
1343: '||'');
1344: IF l_fetch_ctn = l_pagination_row_count THEN

Line 1342: UTL_FILE.put_line(l_xml_file, l_fact||'

1338: '||NULL;
1339: END LOOP;
1340: -- UTL_FILE.put_line(l_xml_file, l_fact||chr(10)||'');
1341: -- Use of chr function not allowed by GSCC. The new line character is introduced using line edit
1342: UTL_FILE.put_line(l_xml_file, l_fact||'
1343: '||'');
1344: IF l_fetch_ctn = l_pagination_row_count THEN
1345: UTL_FILE.put_line(l_xml_file,'');
1346: UTL_FILE.FCLOSE(l_xml_file);

Line 1345: UTL_FILE.put_line(l_xml_file,'');

1341: -- Use of chr function not allowed by GSCC. The new line character is introduced using line edit
1342: UTL_FILE.put_line(l_xml_file, l_fact||'
1343: '||'');
1344: IF l_fetch_ctn = l_pagination_row_count THEN
1345: UTL_FILE.put_line(l_xml_file,'');
1346: UTL_FILE.FCLOSE(l_xml_file);
1347: --update the job file metadata table with the file name
1348: BEGIN
1349: INSERT INTO ddr_ws_job_file_dls(file_id, job_id, file_name, status, delete_flag,src_sys_idnt, src_sys_dt, crtd_by_dsr, last_updt_by_dsr,

Line 1346: UTL_FILE.FCLOSE(l_xml_file);

1342: UTL_FILE.put_line(l_xml_file, l_fact||'
1343: '||'');
1344: IF l_fetch_ctn = l_pagination_row_count THEN
1345: UTL_FILE.put_line(l_xml_file,'');
1346: UTL_FILE.FCLOSE(l_xml_file);
1347: --update the job file metadata table with the file name
1348: BEGIN
1349: INSERT INTO ddr_ws_job_file_dls(file_id, job_id, file_name, status, delete_flag,src_sys_idnt, src_sys_dt, crtd_by_dsr, last_updt_by_dsr,
1350: created_by, creation_date, last_updated_by,

Line 1362: l_xml_file := UTL_FILE.fopen(l_dir_name,l_file_name,ddr_webservices_constants.g_file_write_mode);

1358: RAISE l_max_rows;
1359: END IF;
1360: l_file_id :=get_ddr_ws_file_seq_nextval(x_return_status,x_msg_count,x_msg_data);
1361: l_file_name := p_fact_code || '_'|| l_file_id || '.xml';
1362: l_xml_file := UTL_FILE.fopen(l_dir_name,l_file_name,ddr_webservices_constants.g_file_write_mode);
1363: UTL_FILE.put_line(l_xml_file, '');
1364: UTL_FILE.put_line(l_xml_file, '');
1365: l_fetch_ctn:=0;
1366: END IF;

Line 1363: UTL_FILE.put_line(l_xml_file, '');

1359: END IF;
1360: l_file_id :=get_ddr_ws_file_seq_nextval(x_return_status,x_msg_count,x_msg_data);
1361: l_file_name := p_fact_code || '_'|| l_file_id || '.xml';
1362: l_xml_file := UTL_FILE.fopen(l_dir_name,l_file_name,ddr_webservices_constants.g_file_write_mode);
1363: UTL_FILE.put_line(l_xml_file, '');
1364: UTL_FILE.put_line(l_xml_file, '');
1365: l_fetch_ctn:=0;
1366: END IF;
1367: ELSE

Line 1364: UTL_FILE.put_line(l_xml_file, '');

1360: l_file_id :=get_ddr_ws_file_seq_nextval(x_return_status,x_msg_count,x_msg_data);
1361: l_file_name := p_fact_code || '_'|| l_file_id || '.xml';
1362: l_xml_file := UTL_FILE.fopen(l_dir_name,l_file_name,ddr_webservices_constants.g_file_write_mode);
1363: UTL_FILE.put_line(l_xml_file, '');
1364: UTL_FILE.put_line(l_xml_file, '');
1365: l_fetch_ctn:=0;
1366: END IF;
1367: ELSE
1368: l_fetch_rows:=dbms_sql.fetch_rows(l_cur);

Line 1375: UTL_FILE.put_line(l_xml_file, '');

1371: END LOOP;
1372: -- DBMS_OUTPUT.PUT_LINE('l_total_row_count='||l_total_row_count);
1373: dbms_sql.close_cursor(l_cur);
1374: IF l_fetch_ctn <> l_pagination_row_count THEN
1375: UTL_FILE.put_line(l_xml_file, '');
1376: UTL_FILE.FCLOSE(l_xml_file);
1377: BEGIN
1378: -- DBMS_OUTPUT.PUT_LINE('third, l_file_id='||l_file_id);
1379: INSERT INTO ddr_ws_job_file_dls

Line 1376: UTL_FILE.FCLOSE(l_xml_file);

1372: -- DBMS_OUTPUT.PUT_LINE('l_total_row_count='||l_total_row_count);
1373: dbms_sql.close_cursor(l_cur);
1374: IF l_fetch_ctn <> l_pagination_row_count THEN
1375: UTL_FILE.put_line(l_xml_file, '');
1376: UTL_FILE.FCLOSE(l_xml_file);
1377: BEGIN
1378: -- DBMS_OUTPUT.PUT_LINE('third, l_file_id='||l_file_id);
1379: INSERT INTO ddr_ws_job_file_dls
1380: (file_id, job_id, file_name, status, delete_flag,

Line 1396: IF UTL_FILE.is_open(l_xml_file) THEN

1392: WHEN l_max_rows THEN
1393: IF dbms_sql.is_open(l_cur) THEN
1394: dbms_sql.close_cursor(l_cur);
1395: END IF;
1396: IF UTL_FILE.is_open(l_xml_file) THEN
1397: UTL_FILE.fclose(l_xml_file);
1398: END IF;
1399: x_return_status:=ddr_webservices_constants.g_ret_sts_error;
1400: x_msg_count:=1;

Line 1397: UTL_FILE.fclose(l_xml_file);

1393: IF dbms_sql.is_open(l_cur) THEN
1394: dbms_sql.close_cursor(l_cur);
1395: END IF;
1396: IF UTL_FILE.is_open(l_xml_file) THEN
1397: UTL_FILE.fclose(l_xml_file);
1398: END IF;
1399: x_return_status:=ddr_webservices_constants.g_ret_sts_error;
1400: x_msg_count:=1;
1401: x_msg_data:='Program exceeded maximum row OUT NOCOPY put';

Line 1402: WHEN UTL_FILE.INTERNAL_ERROR THEN

1398: END IF;
1399: x_return_status:=ddr_webservices_constants.g_ret_sts_error;
1400: x_msg_count:=1;
1401: x_msg_data:='Program exceeded maximum row OUT NOCOPY put';
1402: WHEN UTL_FILE.INTERNAL_ERROR THEN
1403: IF dbms_sql.is_open(l_cur) THEN
1404: dbms_sql.close_cursor(l_cur);
1405: END IF;
1406: IF UTL_FILE.is_open(l_xml_file) THEN

Line 1406: IF UTL_FILE.is_open(l_xml_file) THEN

1402: WHEN UTL_FILE.INTERNAL_ERROR THEN
1403: IF dbms_sql.is_open(l_cur) THEN
1404: dbms_sql.close_cursor(l_cur);
1405: END IF;
1406: IF UTL_FILE.is_open(l_xml_file) THEN
1407: UTL_FILE.fclose(l_xml_file);
1408: END IF;
1409: x_return_status:=ddr_webservices_constants.g_ret_sts_unexp_error;
1410: x_msg_count:=1;

Line 1407: UTL_FILE.fclose(l_xml_file);

1403: IF dbms_sql.is_open(l_cur) THEN
1404: dbms_sql.close_cursor(l_cur);
1405: END IF;
1406: IF UTL_FILE.is_open(l_xml_file) THEN
1407: UTL_FILE.fclose(l_xml_file);
1408: END IF;
1409: x_return_status:=ddr_webservices_constants.g_ret_sts_unexp_error;
1410: x_msg_count:=1;
1411: x_msg_data:='Cannot open file :' || l_file_name ||', write error; code:' || sqlcode ||',message:' || sqlerrm;

Line 1412: WHEN UTL_FILE.INVALID_OPERATION THEN

1408: END IF;
1409: x_return_status:=ddr_webservices_constants.g_ret_sts_unexp_error;
1410: x_msg_count:=1;
1411: x_msg_data:='Cannot open file :' || l_file_name ||', write error; code:' || sqlcode ||',message:' || sqlerrm;
1412: WHEN UTL_FILE.INVALID_OPERATION THEN
1413: IF dbms_sql.is_open(l_cur) THEN
1414: dbms_sql.close_cursor(l_cur);
1415: END IF;
1416: IF UTL_FILE.is_open(l_xml_file) THEN

Line 1416: IF UTL_FILE.is_open(l_xml_file) THEN

1412: WHEN UTL_FILE.INVALID_OPERATION THEN
1413: IF dbms_sql.is_open(l_cur) THEN
1414: dbms_sql.close_cursor(l_cur);
1415: END IF;
1416: IF UTL_FILE.is_open(l_xml_file) THEN
1417: UTL_FILE.fclose(l_xml_file);
1418: END IF;
1419: x_return_status:=ddr_webservices_constants.g_ret_sts_unexp_error;
1420: x_msg_count:=1;

Line 1417: UTL_FILE.fclose(l_xml_file);

1413: IF dbms_sql.is_open(l_cur) THEN
1414: dbms_sql.close_cursor(l_cur);
1415: END IF;
1416: IF UTL_FILE.is_open(l_xml_file) THEN
1417: UTL_FILE.fclose(l_xml_file);
1418: END IF;
1419: x_return_status:=ddr_webservices_constants.g_ret_sts_unexp_error;
1420: x_msg_count:=1;
1421: x_msg_data:='Cannot open file :' || l_file_name ||', write error; code:' || sqlcode ||',message:' || sqlerrm;

Line 1422: WHEN UTL_FILE.INVALID_PATH THEN

1418: END IF;
1419: x_return_status:=ddr_webservices_constants.g_ret_sts_unexp_error;
1420: x_msg_count:=1;
1421: x_msg_data:='Cannot open file :' || l_file_name ||', write error; code:' || sqlcode ||',message:' || sqlerrm;
1422: WHEN UTL_FILE.INVALID_PATH THEN
1423: IF dbms_sql.is_open(l_cur) THEN
1424: dbms_sql.close_cursor(l_cur);
1425: END IF;
1426: IF UTL_FILE.is_open(l_xml_file) THEN

Line 1426: IF UTL_FILE.is_open(l_xml_file) THEN

1422: WHEN UTL_FILE.INVALID_PATH THEN
1423: IF dbms_sql.is_open(l_cur) THEN
1424: dbms_sql.close_cursor(l_cur);
1425: END IF;
1426: IF UTL_FILE.is_open(l_xml_file) THEN
1427: UTL_FILE.fclose(l_xml_file);
1428: END IF;
1429: x_return_status:=ddr_webservices_constants.g_ret_sts_unexp_error;
1430: x_msg_count:=1;

Line 1427: UTL_FILE.fclose(l_xml_file);

1423: IF dbms_sql.is_open(l_cur) THEN
1424: dbms_sql.close_cursor(l_cur);
1425: END IF;
1426: IF UTL_FILE.is_open(l_xml_file) THEN
1427: UTL_FILE.fclose(l_xml_file);
1428: END IF;
1429: x_return_status:=ddr_webservices_constants.g_ret_sts_unexp_error;
1430: x_msg_count:=1;
1431: x_msg_data:='Cannot open file :' || l_file_name ||', write error; code:' || sqlcode ||',message:' || sqlerrm;

Line 1432: WHEN UTL_FILE.WRITE_ERROR THEN

1428: END IF;
1429: x_return_status:=ddr_webservices_constants.g_ret_sts_unexp_error;
1430: x_msg_count:=1;
1431: x_msg_data:='Cannot open file :' || l_file_name ||', write error; code:' || sqlcode ||',message:' || sqlerrm;
1432: WHEN UTL_FILE.WRITE_ERROR THEN
1433: IF dbms_sql.is_open(l_cur) THEN
1434: dbms_sql.close_cursor(l_cur);
1435: END IF;
1436: IF UTL_FILE.is_open(l_xml_file) THEN

Line 1436: IF UTL_FILE.is_open(l_xml_file) THEN

1432: WHEN UTL_FILE.WRITE_ERROR THEN
1433: IF dbms_sql.is_open(l_cur) THEN
1434: dbms_sql.close_cursor(l_cur);
1435: END IF;
1436: IF UTL_FILE.is_open(l_xml_file) THEN
1437: UTL_FILE.fclose(l_xml_file);
1438: END IF;
1439: x_return_status:=ddr_webservices_constants.g_ret_sts_unexp_error;
1440: x_msg_count:=1;

Line 1437: UTL_FILE.fclose(l_xml_file);

1433: IF dbms_sql.is_open(l_cur) THEN
1434: dbms_sql.close_cursor(l_cur);
1435: END IF;
1436: IF UTL_FILE.is_open(l_xml_file) THEN
1437: UTL_FILE.fclose(l_xml_file);
1438: END IF;
1439: x_return_status:=ddr_webservices_constants.g_ret_sts_unexp_error;
1440: x_msg_count:=1;
1441: x_msg_data:='Cannot write to file :' || l_file_name ||', write error; code:' || sqlcode ||',message:' || sqlerrm;

Line 1446: IF UTL_FILE.is_open(l_xml_file) THEN

1442: WHEN OTHERS THEN
1443: IF dbms_sql.is_open(l_cur) THEN
1444: dbms_sql.close_cursor(l_cur);
1445: END IF;
1446: IF UTL_FILE.is_open(l_xml_file) THEN
1447: UTL_FILE.fclose(l_xml_file);
1448: END IF;
1449: x_return_status:=ddr_webservices_constants.g_ret_sts_unexp_error;
1450: x_msg_count:=1;

Line 1447: UTL_FILE.fclose(l_xml_file);

1443: IF dbms_sql.is_open(l_cur) THEN
1444: dbms_sql.close_cursor(l_cur);
1445: END IF;
1446: IF UTL_FILE.is_open(l_xml_file) THEN
1447: UTL_FILE.fclose(l_xml_file);
1448: END IF;
1449: x_return_status:=ddr_webservices_constants.g_ret_sts_unexp_error;
1450: x_msg_count:=1;
1451: x_msg_data:='Unexpected Error. Error code:'||sqlcode||' Error message:'||sqlerrm;