I tried to create a file using Oracle UTL_FILE.FOPEN command but i get this error.
Is there an alternative?
log_file:=UTL_FILE.FOPEN("P:\Documentation\Project Team\SA\CSR_Documentation\SHR-10500",'outputforDeleteStudentGroup.txt', 'W');
I dont want to say create or replace directory because the directory already exists.
Please suggest.
Thanks,
Sriram
CREATE OR REPLACE DIRECTORYdoes not create a directory at the operating system level. It creates an Oracle directory object. You want to create an Oracle directory object that points to a directory at the operating system level. You could potentially go with the very old-school approach of modifying theUTL_FILE_DIRinitialization parameter to includeP:\Documentation\Project Team\SA\CSR_Documentation\SHR-10500and reboot the database but that is not something that I would recommend.The first parameter to
UTL_FILE.FOPENshould be a string which means that it should be enclosed in single quotes not double quotes.Is the
P:\drive something that exists on the database server’s file system? Or is it a network drive that gets mounted by the database server? Or is it a directory that is available to the client?