This question is executing the UTL_FILE.FOPEN command in the PL/SQL.
Will UTL_FILE.FOPEN open the file in client side or server side?
Lets say I run a Oracle client 10 in my MACHINE A and I am connecting the MACHINE B (which is the server).
When I execute this following stored procedures in Machine A through Java Application,
DECLARE
fileHandler UTL_FILE.FILE_TYPE;
BEGIN
fileHandler := UTL_FILE.FOPEN('/app/dir', 'test.txt', 'W');
UTL_FILE.PUTF(fileHandler, 'Writing TO a file\n');
UTL_FILE.FCLOSE(fileHandler);
END;
/
Question is Directory /app/dir should be in MACHINE A(client) or MACHINE B(Server)
will only open files in directories that have been set up by the DBA, and those directories are on the same server the database lives on. MachineB in your question. And. you cannot access any old directory you want.
There two ways the DBA can control this – an init.ora parameter
utl_file_diror by creating directory objects.To see
utl_file_dirIf you can select from V$PARAMETERS tryTo see directory objects you can access in pl/sql:
These are two distinct things. utl_file_dir is an old feature, directory objects are newer.