|
-

From Oracle metalink Note:123862.1
- - - - - - - - - - - - - - - - Code begins here - - - - - - - - - - - - - - - -
DECLARE
fHandle UTL_FILE.FILE_TYPE;
vText varchar2(10);
BEGIN
fHandle := UTL_FILE.FOPEN('c:\','utlfile.txt','w');
vText := 'TEST';
UTL_FILE.PUTF(fHandle,vText);
UTL_FILE.FCLOSE(fHandle);
EXCEPTION
WHEN UTL_FILE.INVALID_PATH THEN
RAISE_APPLICATION_ERROR(-20100,'Invalid Path');
WHEN UTL_FILE.INVALID_MODE THEN
RAISE_APPLICATION_ERROR(-20101,'Invalid Mode');
WHEN UTL_FILE.INVALID_OPERATION then
RAISE_APPLICATION_ERROR(-20102,'Invalid Operation');
WHEN UTL_FILE.INVALID_FILEHANDLE then
RAISE_APPLICATION_ERROR(-20103,'Invalid Filehandle');
WHEN UTL_FILE.WRITE_ERROR then
RAISE_APPLICATION_ERROR(-20104,'Write Error');
WHEN UTL_FILE.READ_ERROR then
RAISE_APPLICATION_ERROR(-20105,'Read Error');
WHEN UTL_FILE.INTERNAL_ERROR then
RAISE_APPLICATION_ERROR(-20106,'Internal Error');
WHEN OTHERS THEN
UTL_FILE.FCLOSE(fHandle);
END;
/
- - - - - - - - - - - - - - - - Code ends here - - - - - - - - - - - - - - - -
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|