1

I'm using JDBC to create a directory object in the database.

i.e create or replace directory "dir" as 'c:\temp';

My question is:

  1. I want to pass the path at runtime
  2. Or at least specify path relative to current one. I mean : create or replace "dir" as './../tempdir'

Is there a way to do this or is specifying absolute path the only way out.

3
  • 1
    Why do you want relative paths? Are you sure you know what they would be relative to? What do you mean by "current path"? Those are file paths on the database server, unaffected by where you run the client from. Commented Dec 27, 2011 at 7:31
  • I'm using Oracle capture and replay in my App.By relative path, I mean the generated capture files to be stored in a directory inside the App folder. By, current path I mean my .java file's path in which I'm writing the "create directory" statement Commented Dec 27, 2011 at 7:50
  • 1
    Oracle does not allow dynamic manipulation of DIRECTORY objects, for very sound reasons. Get the full skinny by reading my response to another SO thread: stackoverflow.com/questions/8147756/… Commented Dec 27, 2011 at 9:38

1 Answer 1

2

From Oracle Doc:

path_name Specify the full path name of the operating system directory of the server where the files are located.

I think this is because there is no such thing as "current directory". (You are in database, not in command line :) )

You can post a question with your problem and you'll get help from community.

Sign up to request clarification or add additional context in comments.

2 Comments

Note that you could use a relative path, relative to the absolute path specified by the DIRECTORY. That's the case when you use a BFILE where the BFILE locator = DIRECTORY + relative path.
have you tried that? here says that should be Directory + filename

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.