DBA Data[Home] [Help]

APPS.AS_FORECAST_ACTUAL_PKG dependencies on UTL_FILE

Line 228: p_filehandle IN UTL_FILE.FILE_TYPE,

224: p_PROGRAM_APPLICATION_ID IN NUMBER,
225: p_PROGRAM_ID IN NUMBER,
226: p_PROGRAM_UPDATE_DATE IN DATE,
227: p_SECURITY_GROUP_ID IN NUMBER,
228: p_filehandle IN UTL_FILE.FILE_TYPE,
229: p_forecast_category_name IN VARCHAR2,
230: p_credit_type_name IN VARCHAR2)
231:
232: IS

Line 242: l_filepath VARCHAR2(60) := ''; -- check utl_file dir

238: l_sales_group_id NUMBER;
239: l_forecast_category_id NUMBER;
240: l_credit_type_id NUMBER;
241: l_log_file VARCHAR2(60);
242: l_filepath VARCHAR2(60) := ''; -- check utl_file dir
243: l_log_msg VARCHAR2(255):= '';
244: l_header VARCHAR2(100):='';
245: l_period_start_date DATE;
246: l_period_end_date DATE;

Line 454: UTL_FILE.PUT_LINE(p_filehandle, l_log_msg) ;

450: ELSE -- error in validating IDs
451: fnd_message.set_name('ASF','ASF_FRCSTACT_LOG_LINE');
452: fnd_message.set_token('LINE',p_line_number);
453: l_log_msg := fnd_message.get||l_log_msg;
454: UTL_FILE.PUT_LINE(p_filehandle, l_log_msg) ;
455: l_log_msg := l_log_msg;
456: create_loglob(l_log_msg
457: ,null
458: ,'W'

Line 474: -- use first entry of utl_file_dir as the DIR

470: l_slash VARCHAR2(1) := FND_GLOBAL.LOCAL_CHR(47);
471: l_logdir VARCHAR2(2000) := '';
472: l_pos number := 0;
473: BEGIN
474: -- use first entry of utl_file_dir as the DIR
475: -- if there is no entry then do not even construct file names
476: select trim(value)
477: into l_logdir
478: from v$parameter

Line 479: where name = 'utl_file_dir';

475: -- if there is no entry then do not even construct file names
476: select trim(value)
477: into l_logdir
478: from v$parameter
479: where name = 'utl_file_dir';
480:
481: l_pos := instr(l_logdir, l_token);
482: if ( l_logdir is null ) then
483: raise no_data_found;

Line 514: , p_filehandle IN UTL_FILE.FILE_TYPE

510:
511: PROCEDURE Chk_Valid_PeriodName (
512: p_period_name IN VARCHAR2
513: , p_period_set_name IN VARCHAR2
514: , p_filehandle IN UTL_FILE.FILE_TYPE
515: , x_period_flag OUT NOCOPY BOOLEAN
516: , x_start_date OUT NOCOPY DATE
517: , x_end_date OUT NOCOPY DATE )
518: IS

Line 537: IF (UTL_FILE.IS_OPEN(p_filehandle)) THEN

533: WHEN NO_DATA_FOUND THEN
534: l_period_name := '';
535: x_period_flag := FALSE;
536: WHEN OTHERS THEN
537: IF (UTL_FILE.IS_OPEN(p_filehandle)) THEN
538: UTL_FILE.PUT_LINE(p_filehandle, 'Oracle error while checking period name: '||sqlerrm);
539: END IF;
540: l_exception := 'Oracle error while checking period name: '||sqlerrm;
541: create_loglob(l_exception

Line 538: UTL_FILE.PUT_LINE(p_filehandle, 'Oracle error while checking period name: '||sqlerrm);

534: l_period_name := '';
535: x_period_flag := FALSE;
536: WHEN OTHERS THEN
537: IF (UTL_FILE.IS_OPEN(p_filehandle)) THEN
538: UTL_FILE.PUT_LINE(p_filehandle, 'Oracle error while checking period name: '||sqlerrm);
539: END IF;
540: l_exception := 'Oracle error while checking period name: '||sqlerrm;
541: create_loglob(l_exception
542: ,null

Line 549: , p_filehandle IN UTL_FILE.FILE_TYPE

545: END Chk_Valid_PeriodName;
546:
547: PROCEDURE Chk_Valid_Currency (
548: p_currency_code IN VARCHAR2
549: , p_filehandle IN UTL_FILE.FILE_TYPE
550: , x_currency_flag OUT NOCOPY BOOLEAN )
551: IS
552: l_currency_code VARCHAR2(30);
553: l_exception VARCHAR2(500);

Line 568: IF (UTL_FILE.IS_OPEN(p_filehandle)) THEN

564: EXCEPTION
565: WHEN NO_DATA_FOUND THEN
566: l_currency_code := '';
567: WHEN OTHERS THEN
568: IF (UTL_FILE.IS_OPEN(p_filehandle)) THEN
569: UTL_FILE.PUT_LINE(p_filehandle, 'Oracle error while checking Currency: '||sqlerrm);
570: END IF;
571: l_exception := 'Oracle error while checking Currency: '||sqlerrm;
572: create_loglob(l_exception

Line 569: UTL_FILE.PUT_LINE(p_filehandle, 'Oracle error while checking Currency: '||sqlerrm);

565: WHEN NO_DATA_FOUND THEN
566: l_currency_code := '';
567: WHEN OTHERS THEN
568: IF (UTL_FILE.IS_OPEN(p_filehandle)) THEN
569: UTL_FILE.PUT_LINE(p_filehandle, 'Oracle error while checking Currency: '||sqlerrm);
570: END IF;
571: l_exception := 'Oracle error while checking Currency: '||sqlerrm;
572: create_loglob(l_exception
573: ,null

Line 580: , p_filehandle IN UTL_FILE.FILE_TYPE

576: END Chk_Valid_Currency;
577:
578: PROCEDURE Get_CreditTypeId (
579: p_name IN VARCHAR2
580: , p_filehandle IN UTL_FILE.FILE_TYPE
581: , x_credit_type_id OUT NOCOPY NUMBER ) IS
582: l_exception VARCHAR2(500);
583: BEGIN
584: SELECT sales_credit_type_id

Line 595: IF (UTL_FILE.IS_OPEN(p_filehandle)) THEN

591: EXCEPTION
592: WHEN NO_DATA_FOUND THEN
593: x_credit_type_id := 0;
594: WHEN OTHERS THEN
595: IF (UTL_FILE.IS_OPEN(p_filehandle)) THEN
596: UTL_FILE.PUT_LINE(p_filehandle, 'Oracle error while validating Credit Type: '||sqlerrm);
597: END IF;
598: l_exception := 'Oracle error while validating Credit Type: '||sqlerrm;
599: create_loglob(l_exception

Line 596: UTL_FILE.PUT_LINE(p_filehandle, 'Oracle error while validating Credit Type: '||sqlerrm);

592: WHEN NO_DATA_FOUND THEN
593: x_credit_type_id := 0;
594: WHEN OTHERS THEN
595: IF (UTL_FILE.IS_OPEN(p_filehandle)) THEN
596: UTL_FILE.PUT_LINE(p_filehandle, 'Oracle error while validating Credit Type: '||sqlerrm);
597: END IF;
598: l_exception := 'Oracle error while validating Credit Type: '||sqlerrm;
599: create_loglob(l_exception
600: ,null

Line 607: , p_filehandle IN UTL_FILE.FILE_TYPE

603: END Get_CreditTypeId;
604:
605: PROCEDURE Get_ForecastCategoryId (
606: p_name IN VARCHAR2
607: , p_filehandle IN UTL_FILE.FILE_TYPE
608: , p_start_date IN DATE
609: , p_end_date IN DATE
610: , x_forecast_category_id OUT NOCOPY NUMBER ) IS
611: l_exception VARCHAR2(500);

Line 627: IF (UTL_FILE.IS_OPEN(p_filehandle)) THEN

623: EXCEPTION
624: WHEN NO_DATA_FOUND THEN
625: x_forecast_category_id := 0;
626: WHEN OTHERS THEN
627: IF (UTL_FILE.IS_OPEN(p_filehandle)) THEN
628: UTL_FILE.PUT_LINE(p_filehandle, 'Oracle error while validating Forecast Category: '||sqlerrm);
629: END IF;
630: l_exception := 'Oracle error while validating Forecast Category: '||sqlerrm;
631: create_loglob(l_exception

Line 628: UTL_FILE.PUT_LINE(p_filehandle, 'Oracle error while validating Forecast Category: '||sqlerrm);

624: WHEN NO_DATA_FOUND THEN
625: x_forecast_category_id := 0;
626: WHEN OTHERS THEN
627: IF (UTL_FILE.IS_OPEN(p_filehandle)) THEN
628: UTL_FILE.PUT_LINE(p_filehandle, 'Oracle error while validating Forecast Category: '||sqlerrm);
629: END IF;
630: l_exception := 'Oracle error while validating Forecast Category: '||sqlerrm;
631: create_loglob(l_exception
632: ,null

Line 639: , p_filehandle IN UTL_FILE.FILE_TYPE

635: END Get_ForecastCategoryId;
636:
637: PROCEDURE Get_SalesGroupId (
638: p_sales_group_number IN NUMBER
639: , p_filehandle IN UTL_FILE.FILE_TYPE
640: , p_start_date IN DATE
641: , p_end_date IN DATE
642: , x_sales_group_id OUT NOCOPY NUMBER ) IS
643: l_exception VARCHAR2(500);

Line 662: IF (UTL_FILE.IS_OPEN(p_filehandle)) THEN

658: EXCEPTION
659: WHEN NO_DATA_FOUND THEN
660: x_sales_group_id := 0;
661: WHEN OTHERS THEN
662: IF (UTL_FILE.IS_OPEN(p_filehandle)) THEN
663: UTL_FILE.PUT_LINE(p_filehandle, 'Oracle error while checking Sales Group ID: '||sqlerrm);
664: END IF;
665: l_exception := 'Oracle error while checking Sales Group ID: '||sqlerrm;
666: create_loglob(l_exception

Line 663: UTL_FILE.PUT_LINE(p_filehandle, 'Oracle error while checking Sales Group ID: '||sqlerrm);

659: WHEN NO_DATA_FOUND THEN
660: x_sales_group_id := 0;
661: WHEN OTHERS THEN
662: IF (UTL_FILE.IS_OPEN(p_filehandle)) THEN
663: UTL_FILE.PUT_LINE(p_filehandle, 'Oracle error while checking Sales Group ID: '||sqlerrm);
664: END IF;
665: l_exception := 'Oracle error while checking Sales Group ID: '||sqlerrm;
666: create_loglob(l_exception
667: ,null

Line 674: , p_filehandle IN UTL_FILE.FILE_TYPE

670: END Get_SalesGroupId;
671:
672: PROCEDURE Get_SalesForceId (
673: p_salesforce_number IN NUMBER
674: , p_filehandle IN UTL_FILE.FILE_TYPE
675: , p_start_date IN DATE
676: , p_end_date IN DATE
677: , p_sales_group_id IN NUMBER
678: , x_salesforce_id OUT NOCOPY NUMBER

Line 680: l_file_handle UTL_FILE.FILE_TYPE;

676: , p_end_date IN DATE
677: , p_sales_group_id IN NUMBER
678: , x_salesforce_id OUT NOCOPY NUMBER
679: ) IS
680: l_file_handle UTL_FILE.FILE_TYPE;
681: l_exception VARCHAR2(500);
682: BEGIN
683:
684: SELECT res.resource_id

Line 713: IF (UTL_FILE.IS_OPEN(p_filehandle)) THEN

709: EXCEPTION
710: WHEN NO_DATA_FOUND THEN
711: x_salesforce_id := 0;
712: WHEN OTHERS THEN
713: IF (UTL_FILE.IS_OPEN(p_filehandle)) THEN
714: UTL_FILE.PUT_LINE(p_filehandle, 'Oracle error while checking Sales ForceId: '||sqlerrm);
715: UTL_FILE.PUT_LINE(p_filehandle, 'SalespersonNumber:'||p_salesforce_number||'SalesGroupId: '||p_sales_group_id||' StartDate: '||p_start_date||' EndDate:'||p_end_date);
716: END IF;
717: l_exception := 'Oracle error while checking Sales ForceId: '||sqlerrm||g_next_line||'SalespersonNumber:'||p_salesforce_number||'SalesGroupId: '||p_sales_group_id||' StartDate: '||p_start_date||' EndDate:'||p_end_date;

Line 714: UTL_FILE.PUT_LINE(p_filehandle, 'Oracle error while checking Sales ForceId: '||sqlerrm);

710: WHEN NO_DATA_FOUND THEN
711: x_salesforce_id := 0;
712: WHEN OTHERS THEN
713: IF (UTL_FILE.IS_OPEN(p_filehandle)) THEN
714: UTL_FILE.PUT_LINE(p_filehandle, 'Oracle error while checking Sales ForceId: '||sqlerrm);
715: UTL_FILE.PUT_LINE(p_filehandle, 'SalespersonNumber:'||p_salesforce_number||'SalesGroupId: '||p_sales_group_id||' StartDate: '||p_start_date||' EndDate:'||p_end_date);
716: END IF;
717: l_exception := 'Oracle error while checking Sales ForceId: '||sqlerrm||g_next_line||'SalespersonNumber:'||p_salesforce_number||'SalesGroupId: '||p_sales_group_id||' StartDate: '||p_start_date||' EndDate:'||p_end_date;
718: create_loglob(l_exception

Line 715: UTL_FILE.PUT_LINE(p_filehandle, 'SalespersonNumber:'||p_salesforce_number||'SalesGroupId: '||p_sales_group_id||' StartDate: '||p_start_date||' EndDate:'||p_end_date);

711: x_salesforce_id := 0;
712: WHEN OTHERS THEN
713: IF (UTL_FILE.IS_OPEN(p_filehandle)) THEN
714: UTL_FILE.PUT_LINE(p_filehandle, 'Oracle error while checking Sales ForceId: '||sqlerrm);
715: UTL_FILE.PUT_LINE(p_filehandle, 'SalespersonNumber:'||p_salesforce_number||'SalesGroupId: '||p_sales_group_id||' StartDate: '||p_start_date||' EndDate:'||p_end_date);
716: END IF;
717: l_exception := 'Oracle error while checking Sales ForceId: '||sqlerrm||g_next_line||'SalespersonNumber:'||p_salesforce_number||'SalesGroupId: '||p_sales_group_id||' StartDate: '||p_start_date||' EndDate:'||p_end_date;
718: create_loglob(l_exception
719: ,null

Line 733: l_file_handle UTL_FILE.FILE_TYPE; /*File Handle given to the Utl_file call*/

729: , p_PROGRAM_APPLICATION_ID IN NUMBER)
730: IS
731: l_lob_loc BLOB;
732: l_lob_len NUMBER;
733: l_file_handle UTL_FILE.FILE_TYPE; /*File Handle given to the Utl_file call*/
734: l_lob_data VARCHAR2(1000);/*this variable stores blob data*/
735: l_filepath VARCHAR2(200) := '';/*has the dir path of log file*/
736: l_file_name VARCHAR2(200) := '';/*has the client file name*/
737: l_log_file VARCHAR2(200) := '';/*has the log file name*/

Line 783: if (UTL_FILE.IS_OPEN(l_file_handle)) then

779: create_loglob(null
780: ,null
781: ,'W'
782: ,TRUE);
783: if (UTL_FILE.IS_OPEN(l_file_handle)) then
784: UTL_FILE.FCLOSE(l_file_handle);
785: end if;
786:
787: begin

Line 784: UTL_FILE.FCLOSE(l_file_handle);

780: ,null
781: ,'W'
782: ,TRUE);
783: if (UTL_FILE.IS_OPEN(l_file_handle)) then
784: UTL_FILE.FCLOSE(l_file_handle);
785: end if;
786:
787: begin
788: l_file_handle := UTL_FILE.FOPEN(l_filepath, l_log_file, 'w');

Line 788: l_file_handle := UTL_FILE.FOPEN(l_filepath, l_log_file, 'w');

784: UTL_FILE.FCLOSE(l_file_handle);
785: end if;
786:
787: begin
788: l_file_handle := UTL_FILE.FOPEN(l_filepath, l_log_file, 'w');
789: exception
790: when others then
791: create_loglob(sqlerrm
792: ,p_file_id

Line 801: UTL_FILE.PUT_LINE(l_file_handle, l_header);

797: fnd_message.set_token('DATETIME',to_Char(sysdate, 'DD-MON-RR HH24:MI:SS'));
798: fnd_message.set_token('USER',p_created_by);
799: fnd_message.set_token('FILENAME', l_file_name);
800: l_header := fnd_message.get;
801: UTL_FILE.PUT_LINE(l_file_handle, l_header);
802: UTL_FILE.NEW_LINE(l_file_handle, 1);
803:
804: create_loglob(l_header
805: ,p_file_id

Line 802: UTL_FILE.NEW_LINE(l_file_handle, 1);

798: fnd_message.set_token('USER',p_created_by);
799: fnd_message.set_token('FILENAME', l_file_name);
800: l_header := fnd_message.get;
801: UTL_FILE.PUT_LINE(l_file_handle, l_header);
802: UTL_FILE.NEW_LINE(l_file_handle, 1);
803:
804: create_loglob(l_header
805: ,p_file_id
806: ,'W'

Line 931: UTL_FILE.PUT_LINE(l_file_handle, fnd_message.get||sqlerrm) ;

927: exception
928: when others then
929: fnd_message.set_name('ASF','ASF_FRCSTACT_LOG_LINE');
930: fnd_message.set_token('LINE',l_line_number);
931: UTL_FILE.PUT_LINE(l_file_handle, fnd_message.get||sqlerrm) ;
932: l_exception := fnd_message.get||sqlerrm;
933: create_loglob(l_exception
934: ,null
935: ,'W'

Line 968: UTL_FILE.PUT_LINE(l_file_handle, 'Oracle error(s) occured at '|| l_line_number ||' while Uploading : '||sqlerrm) ;

964: ,l_forecast_category_name
965: ,l_credit_type_name);
966: exception
967: when others then
968: UTL_FILE.PUT_LINE(l_file_handle, 'Oracle error(s) occured at '|| l_line_number ||' while Uploading : '||sqlerrm) ;
969: l_exception := 'Oracle error(s) occured at '|| l_line_number ||' while Uploading : '||sqlerrm;
970: create_loglob(l_exception
971: ,null
972: ,'W'

Line 995: UTL_FILE.NEW_LINE(l_file_handle, 1);

991: fnd_message.set_token('DATETIME',to_Char(sysdate, 'DD-MON-RR HH24:MI:SS'));
992: fnd_message.set_token('LINE',l_line_number);
993: fnd_message.set_token('ERROR',g_line_error);
994: l_footer := fnd_message.get;
995: UTL_FILE.NEW_LINE(l_file_handle, 1);
996: UTL_FILE.PUT_LINE(l_file_handle, l_footer ) ;
997: l_footer := l_footer;
998: create_loglob(l_footer
999: ,null

Line 996: UTL_FILE.PUT_LINE(l_file_handle, l_footer ) ;

992: fnd_message.set_token('LINE',l_line_number);
993: fnd_message.set_token('ERROR',g_line_error);
994: l_footer := fnd_message.get;
995: UTL_FILE.NEW_LINE(l_file_handle, 1);
996: UTL_FILE.PUT_LINE(l_file_handle, l_footer ) ;
997: l_footer := l_footer;
998: create_loglob(l_footer
999: ,null
1000: ,'W'

Line 1009: UTL_FILE.FCLOSE(l_file_handle); -- close data file

1005: ,'C'
1006: ,FALSE);
1007: --delete_lob(p_file_id, l_file_handle);/*Commented because the internal lob is rewritten with log content.*/
1008: commit;
1009: UTL_FILE.FCLOSE(l_file_handle); -- close data file
1010: l_line_number := 0;
1011: g_line_error := 0;
1012: Exception
1013: When others then

Line 1014: IF (UTL_FILE.IS_OPEN(l_file_handle) = false) THEN

1010: l_line_number := 0;
1011: g_line_error := 0;
1012: Exception
1013: When others then
1014: IF (UTL_FILE.IS_OPEN(l_file_handle) = false) THEN
1015: l_file_handle := UTL_FILE.FOPEN(l_filepath, l_log_file, 'a');
1016: END IF;
1017: UTL_FILE.PUT_LINE(l_file_handle, 'Oracle error(s) occured at '|| l_line_number ||' while processing : '||sqlerrm);
1018: UTL_FILE.FCLOSE(l_file_handle); -- close data file

Line 1015: l_file_handle := UTL_FILE.FOPEN(l_filepath, l_log_file, 'a');

1011: g_line_error := 0;
1012: Exception
1013: When others then
1014: IF (UTL_FILE.IS_OPEN(l_file_handle) = false) THEN
1015: l_file_handle := UTL_FILE.FOPEN(l_filepath, l_log_file, 'a');
1016: END IF;
1017: UTL_FILE.PUT_LINE(l_file_handle, 'Oracle error(s) occured at '|| l_line_number ||' while processing : '||sqlerrm);
1018: UTL_FILE.FCLOSE(l_file_handle); -- close data file
1019: l_exception := 'Oracle error(s) occured at '|| l_line_number ||' while processing : '||sqlerrm;

Line 1017: UTL_FILE.PUT_LINE(l_file_handle, 'Oracle error(s) occured at '|| l_line_number ||' while processing : '||sqlerrm);

1013: When others then
1014: IF (UTL_FILE.IS_OPEN(l_file_handle) = false) THEN
1015: l_file_handle := UTL_FILE.FOPEN(l_filepath, l_log_file, 'a');
1016: END IF;
1017: UTL_FILE.PUT_LINE(l_file_handle, 'Oracle error(s) occured at '|| l_line_number ||' while processing : '||sqlerrm);
1018: UTL_FILE.FCLOSE(l_file_handle); -- close data file
1019: l_exception := 'Oracle error(s) occured at '|| l_line_number ||' while processing : '||sqlerrm;
1020: create_loglob(l_exception
1021: ,null

Line 1018: UTL_FILE.FCLOSE(l_file_handle); -- close data file

1014: IF (UTL_FILE.IS_OPEN(l_file_handle) = false) THEN
1015: l_file_handle := UTL_FILE.FOPEN(l_filepath, l_log_file, 'a');
1016: END IF;
1017: UTL_FILE.PUT_LINE(l_file_handle, 'Oracle error(s) occured at '|| l_line_number ||' while processing : '||sqlerrm);
1018: UTL_FILE.FCLOSE(l_file_handle); -- close data file
1019: l_exception := 'Oracle error(s) occured at '|| l_line_number ||' while processing : '||sqlerrm;
1020: create_loglob(l_exception
1021: ,null
1022: ,'W'

Line 1032: ,p_filehandle IN UTL_FILE.FILE_TYPE) IS

1028: End Read_lob;
1029:
1030: /*Deleting the blob*/
1031: PROCEDURE Delete_lob(p_file_id IN NUMBER
1032: ,p_filehandle IN UTL_FILE.FILE_TYPE) IS
1033: l_doc_id NUMBER := 0;
1034: l_datatype NUMBER := 6;
1035: CURSOR doc_id_cur IS
1036: SELECT document_id

Line 1053: UTL_FILE.PUT_LINE(p_filehandle,'Error while deleting Fnd_documents: '||sqlerrm);

1049: begin
1050: FND_DOCUMENTS_PKG.DELETE_ROW( l_doc_id, l_datatype, NULL);
1051: exception
1052: when others then
1053: UTL_FILE.PUT_LINE(p_filehandle,'Error while deleting Fnd_documents: '||sqlerrm);
1054: End ;
1055: begin
1056: DELETE FND_LOBS WHERE FILE_ID = p_file_id;
1057: exception

Line 1059: UTL_FILE.PUT_LINE(p_filehandle,'Error while deleting lob: '||sqlerrm);

1055: begin
1056: DELETE FND_LOBS WHERE FILE_ID = p_file_id;
1057: exception
1058: when others then
1059: UTL_FILE.PUT_LINE(p_filehandle,'Error while deleting lob: '||sqlerrm);
1060: End ;
1061: end;
1062: /*Lob is deleted*/
1063: /*Creating the log lob by accumlating the temporary lob