Q
Problem solve Get help with specific problems with your technologies, process and projects.

Creating a directory

How can I create a directory using an Oracle query?

I'm not sure what you're asking. Are you asking how to create an Oracle DIRECTORY which is an alias for a directory on the server's file system where external binary file LOBs (BFILEs) are located OR are you asking how to create a directory on the OS from within Oracle (via a SQL*Plus script, via PL/SQL, what?)?

If you want to create an Oracle DIRECTORY here's the command syntax:

CREATE OR REPLACE DIRECTORY bfile_dir AS '';
If you want to create a directory on the OS, it will be necessary for you to create a Java program to do that since you can't do that directly in PL/SQL. Here's an example of how to get started (although you'll have to supply the remaining code):
create or replace and compile java source named "CreateDir"
as
  import java.io.*;
  import java.sql.*;
 
  public class CreateDir
  { . . . . and so on. . . 

For More Information


Dig Deeper on Oracle database design and architecture

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide.com

SearchDataCenter

SearchContentManagement

SearchHRSoftware

Close