RE: utl_file question

From: Storey, Robert (DCSO) <"Storey,>
Date: Wed, 20 Jun 2018 14:21:38 +0000
Message-ID: <>

Yea, not sure how I'm going to get around that.

The code is written to modify the path based on the conditions, and then assigns that value to the "file_path". I would seem that I need to rewrite the stored proc such that instead of modifying the path, I have to pass the new directory name. That's a major rewrite of the code.

-----Original Message-----
From: Jonathan Lewis [] Sent: Wednesday, June 20, 2018 9:14 AM
To:; Storey, Robert (DCSO) Subject: Re: utl_file question

I don't know if the security model changed between 9 and 11, but there is this comment in the manual (11.1):

"A subdirectory of an accessible directory is not necessarily also accessible; it too must be specified using a complete path name matching an ALL_DIRECTORIES object."

This suggests that your "add /level3/filename" shouldn't work and you need to specify /level1/level2/level3 as a directory (or the path name if you're using the utl_file_dir mechanism).

Jonathan Lewis

From: <> on behalf of Storey, Robert (DCSO) <> Sent: 20 June 2018 14:31:30
Subject: utl_file question

Working on moving some stored procedures from a 9i to an 11g system and I hit a snag with regards to utl_file.

In my stored proc, I pull a path variable, ie, d:\level1\level2 for a root level folder. Then, as the procedure goes through the motions, it tacks on another level to this path based on some criteria. It then writes out a flat text file to location d:\Level1\Level2\Level3.

When I tested this proc in my 11g, I kept getting an utl_file.invalid_path error. I first took this as permissions based, but, when I gave everyone full control of the destination folder, it still gave same error.

Created a simple proc to just open and close a file. Get the same error regardless of where I point it. This code works perfect on the 9i, but not 11g.

A check of documents and online searching seems to point to the fact that you can't pass UTL_FILE.FOPEN a qualified path name. You now have to create a "Directory" object and give permssions to it, and use it as the Path.

Anyone confirm or deny?

Received on Wed Jun 20 2018 - 16:21:38 CEST

Original text of this message