DBA Data[Home] [Help]

APPS.DDR_WEBSERVICES_PUB dependencies on UTL_FILE

Line 1285: l_xml_file UTL_FILE.file_type;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

1338: -- Use of chr function not allowed by GSCC. The new line character is introduced using line edit
1339: UTL_FILE.put_line(l_xml_file, l_fact||'
1340: '||'');
1341: IF l_fetch_ctn = l_pagination_row_count THEN
1342: UTL_FILE.put_line(l_xml_file,'');
1343: UTL_FILE.FCLOSE(l_xml_file);
1344: --update the job file metadata table with the file name
1345: BEGIN
1346: 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 1343: UTL_FILE.FCLOSE(l_xml_file);

1339: UTL_FILE.put_line(l_xml_file, l_fact||'
1340: '||'');
1341: IF l_fetch_ctn = l_pagination_row_count THEN
1342: UTL_FILE.put_line(l_xml_file,'');
1343: UTL_FILE.FCLOSE(l_xml_file);
1344: --update the job file metadata table with the file name
1345: BEGIN
1346: 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,
1347: created_by, creation_date, last_updated_by,

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

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

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

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

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

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

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

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

Line 1373: UTL_FILE.FCLOSE(l_xml_file);

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

Line 1393: IF UTL_FILE.is_open(l_xml_file) THEN

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

Line 1394: UTL_FILE.fclose(l_xml_file);

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

Line 1399: WHEN UTL_FILE.INTERNAL_ERROR THEN

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

Line 1403: IF UTL_FILE.is_open(l_xml_file) THEN

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

Line 1404: UTL_FILE.fclose(l_xml_file);

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

Line 1409: WHEN UTL_FILE.INVALID_OPERATION THEN

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

Line 1413: IF UTL_FILE.is_open(l_xml_file) THEN

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

Line 1414: UTL_FILE.fclose(l_xml_file);

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

Line 1419: WHEN UTL_FILE.INVALID_PATH THEN

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

Line 1423: IF UTL_FILE.is_open(l_xml_file) THEN

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

Line 1424: UTL_FILE.fclose(l_xml_file);

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

Line 1429: WHEN UTL_FILE.WRITE_ERROR THEN

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

Line 1433: IF UTL_FILE.is_open(l_xml_file) THEN

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

Line 1434: UTL_FILE.fclose(l_xml_file);

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

Line 1443: IF UTL_FILE.is_open(l_xml_file) THEN

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

Line 1444: UTL_FILE.fclose(l_xml_file);

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