Home » SQL & PL/SQL » SQL & PL/SQL » Accessing Sub directory under Oracle directory (11g)
Accessing Sub directory under Oracle directory [message #651492] |
Thu, 19 May 2016 02:16  |
harshadsp
Messages: 100 Registered: August 2008
|
Senior Member |

|
|
Hello-
I have created a oracle directory WCPOLS_DIR and which looks in dba_directories like this:-
OWNER DIRECTORY_NAME DIRECTORY_PATH
SYS WCPOLS_DIR /mnt/WCPOLS/PROCESSWCPOLS
Now I need to have a subfolder under this path where I am placing one input file to read in pl/sql code. So I created a directory 'test' under this path but when I run my code its giving an error invalid directory path. This is how I gave path to this test folder in plsql code.
declare
w_dir VARCHAR2(100);
w_input_file VARCHAR2(50);
input_file utl_file.file_type;
BEGIN
w_dir := 'WCPOLS_DIR\test'; -- This is how I am accessing test folder under the oracle directory
w_input_file := 'wcpols_04262016_05032016_CA.TXT';
input_file := utl_file.fopen(w_dir, w_input_file, 'r',32000);
IF utl_file.is_open(input_file) THEN
LOOP
I was assuming when we have created a directory in oracle, we could access the sub directory under this path. Could you please advise where I am making miskate?
Thanks!
|
|
|
|
|
|
|
|
|
|
Re: Accessing Sub directory under Oracle directory [message #663597 is a reply to message #663596] |
Sat, 10 June 2017 05:57   |
 |
Michel Cadot
Messages: 68757 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
Quote: Subsequently asking "why" simply bloats the thread and adds no tangible value,
Agree to the very specified question but it just may help OP to review his original design so that the problem disappears which is much better than having a direct solution for a problem that is not necessary to have.
Saying that your post does not add anything to the topic and, not wanting to be rude, registering to just post that is somewhat silly.
[Updated on: Sat, 10 June 2017 05:58] Report message to a moderator
|
|
|
|
Re: Accessing Sub directory under Oracle directory [message #664181 is a reply to message #664179] |
Thu, 06 July 2017 06:00   |
Bill B
Messages: 1971 Registered: December 2004
|
Senior Member |
|
|
There is zero implied or explicit criticism of the OP. I have been an oracle DBA and developer since oracle 5 and was suggesting that they could simplify their code by using one directory. Having the file names with specific prefixes would separate the files into separate silos. It was a suggestion only and I have an application currently where I am using separate subfolders with different directory objects but that is for separating the files so each folder can only be accessed by specific users. Please don't read into comments intentions that aren't there.
[Updated on: Thu, 06 July 2017 06:01] Report message to a moderator
|
|
|
|
|
Goto Forum:
Current Time: Sat May 17 11:52:14 CDT 2025
|