Solved

Creating Folders on OS from PLSQL

Posted on 2012-03-30
5
1,458 Views
Last Modified: 2012-04-04
Hello Experts,

Is it possible to create a folder from PLSQL.

My database version is 10g and OS version is Windows XP and Redhat Linux.

I want from examples for this.
0
Comment
Question by:Swadhin Ray
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 77

Accepted Solution

by:
slightwv (䄆 Netminder) earned 167 total points
ID: 37786733
There is no direct way.

There is a trick from the link below that uses dbms_scehduler to call MKDIR.

http://www.orafaq.com/forum/t/154053/2/

exec dbms_scheduler.create_job('mkdir','executable','/bin/mkdir',1,auto_drop=>false);
exec dbms_scheduler.set_job_argument_value('mkdir',1,'/tmp/newdir');
exec dbms_scheduler.run_job('mkdir');
0
 
LVL 16

Assisted Solution

by:Wasim Akram Shaik
Wasim Akram Shaik earned 167 total points
ID: 37786736
you can't create physical directories  in OS using plsql..

there is an alternative way, you have to use external routines possibly a Java or C++ program which can do this for you..

i don't have this sample piece code for this, but you can refer to docs on how to call a routine from oracle

http://docs.oracle.com/cd/B19306_01/appdev.102/b14251/adfns_extern_proc.htm#i1019726
0
 
LVL 74

Assisted Solution

by:sdstuber
sdstuber earned 166 total points
ID: 37786787
if the system you want to create the directories in has an ftp server you could try

http://www.experts-exchange.com/A_3043.html

note, you would be limited to only those file systems exposed by the ftp server, but you could do it on multiple servers, all with pl/sql
0
 
LVL 16

Author Comment

by:Swadhin Ray
ID: 37786870
Thanks experts for you comments. I will try all the possible method and update as soon as possible.
0
 
LVL 16

Author Closing Comment

by:Swadhin Ray
ID: 37809570
By getting all the inputs I have used the JAVA source to solve my problem.

here are the steps that I used to accomplish my problem :
1)      Created a JAVA SOURCE on Oracle database.
2)      Create a wrapper to make use of the JAVA Source and named it like runOScm.
3)      Login with SYS user and grant DBMS_JAVA read, write and execute to the users from where we want to run the export (Export is my main issue where I am having a table with file name and doc contain with Langraw column )
4)      Then i had run the runOScm from java granted users to create folder.
5) Finally wrote one program which exported the LangRaw column i.e. contains pdf's , .doc files to folders based on its file name using UTL File.
6) Finally used script to FTP all the folders to other remote DB.


This is really great :-)  Thanks a ton experts..
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
clob to char in oracle 3 92
PL/SQL More than one element associated with another element 7 55
Error in creating a view. 8 32
PL/SQL: ORA-00979: not a GROUP BY expression 3 53
Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question