I have to read a text file that I have created on the database. I am not sure what the appropriate path would be for the UTL_FILE.FOPEN directory parameter. I am confused because the path is not on my local pc.
The path where I found this file is something like
\\{something here}\winixdb$\{schema here I think}\dev\data
This is my current code.
Declare
f UTL_FILE.FILE_TYPE;
s VARCHAR2(200);
begin
f:= UTL_FILE.FOPEN({path_here}, 'certs_file.txt', 'R');
UTL_FILE.GET_LINE(f,s);
UTL_FILE.FCLOSE(f);
dbms_output.put_line(s);
end;
Right now if I put the exact path there it will be an error:
ORA-2928: Invalid Directory Path
I've tried looking at other resources but they talk about a path that is found on your local environment. Also, I don't quite understand the idea of a file on your database.
I want to see this file be outputted to the DBMS.
directoryis a database object you need to create (just like creating a table or an index). The location is on the db server machine, not on the client.fopencall? Is that path in yourutl_file_dirsetting? Or did you create a directory object that points at that UNC path? Does the operating system user running the Oracle service have access to that UNC path?