Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to create folder in disk using pl/sql

2,594 views
Skip to first unread message

Shahadat

unread,
May 7, 2005, 1:10:05 AM5/7/05
to
Hi,

can any guru tell me how can i create folder (c:\test\test1) in my disk
using oracle pl/sql?

please give me some adive.

thanks,

shahadat

Eric de Redelijkheid

unread,
May 7, 2005, 4:00:00 AM5/7/05
to
Anno Domini 7-5-2005 7:10, Shahadat sprak aldus:

SQL>! mkdir c:\test\test1

Mind the exclamation mark "!". What you actually do, is to give a
operating system command after the "!".

Rene Nyffenegger

unread,
May 7, 2005, 8:01:37 AM5/7/05
to
On 2005-05-07, Eric de Redelijkheid <eric...@xs4all.nl> wrote:
> Anno Domini 7-5-2005 7:10, Shahadat sprak aldus:
>
>>Hi,
>>
>>can any guru tell me how can i create folder (c:\test\test1) in my disk
>>using oracle pl/sql?
>>
>>please give me some adive.
>>
>>thanks,
>>
>>shahadat
>>
>>
>>
> SQL>! mkdir c:\test\test1

The OP was asking to create the directory with PL/SQL, not
with SQL*Plus.


--
Rene Nyffenegger
http://www.adp-gmbh.ch/

Lewis C

unread,
May 7, 2005, 8:24:34 AM5/7/05
to


Check out the CREATE DIRECTORY command in the reference manual.


Lewis


-----------------------------------------------------------
Lewis R Cunningham

Author, ItToolBox Blog: An Expert's Guide to Oracle
http://blogs.ittoolbox.com/oracle/guide/

Topic Editor, Suite101.com: Oracle Database
http://www.suite101.com/welcome.cfm/oracle

Sign up for courses here:
http://www.suite101.com/suiteu/default.cfm/416752
-----------------------------------------------------------

bwor...@gmail.com

unread,
May 7, 2005, 9:57:39 AM5/7/05
to
I have done this using Java, PL/SQL integration. I then have a base
directory that you create an Oracle directory from to work with. This
is pretty effective.

Good luck.

Dave

unread,
May 7, 2005, 10:41:44 AM5/7/05
to

"Lewis C" <lew...@excite.com> wrote in message
news:7rcp71hc6shtq2mgc...@4ax.com...

> On 6 May 2005 22:10:05 -0700, "Shahadat" <sho...@gmail.com> wrote:
>
>>Hi,
>>
>>can any guru tell me how can i create folder (c:\test\test1) in my disk
>>using oracle pl/sql?
>>
>>please give me some adive.
>>
>>thanks,
>>
>>shahadat
>
>
> Check out the CREATE DIRECTORY command in the reference manual.
>


and how is that going to create an os directory


Rene Nyffenegger

unread,
May 7, 2005, 10:41:04 AM5/7/05
to
On 2005-05-07, Lewis C <lew...@excite.com> wrote:
> On 6 May 2005 22:10:05 -0700, "Shahadat" <sho...@gmail.com> wrote:
>
>>Hi,
>>
>>can any guru tell me how can i create folder (c:\test\test1) in my disk
>>using oracle pl/sql?
>>
>>please give me some adive.
>>
>>thanks,
>>
>>shahadat
>
>
> Check out the CREATE DIRECTORY command in the reference manual.


The SQL create directory does not create an OS directory (of folder, how the
OP names it). Instead, it creates a directory object which is an
alias for an OS directory

Rene

DA Morgan

unread,
May 7, 2005, 11:02:16 AM5/7/05
to
Lewis C wrote:

> On 6 May 2005 22:10:05 -0700, "Shahadat" <sho...@gmail.com> wrote:
>
>
>>Hi,
>>
>>can any guru tell me how can i create folder (c:\test\test1) in my disk
>>using oracle pl/sql?
>>
>>please give me some adive.
>>
>>thanks,
>>
>>shahadat
>
>
>
> Check out the CREATE DIRECTORY command in the reference manual.
>
>
> Lewis

CREATE DIRECTORY has no affect on the operating system. It defines a
layer of abstraction inside the database and the physical directory
need not exist.
--
Daniel A. Morgan
University of Washington
damo...@x.washington.edu
(replace 'x' with 'u' to respond)

DA Morgan

unread,
May 7, 2005, 11:03:59 AM5/7/05
to
Shahadat wrote:

Java or C.

But, on its face, this is generally a terrible idea so can you explain
what business problem you are attempting to solve?

Perhaps we can provide you with a better solution.

Lewis C

unread,
May 7, 2005, 11:10:07 AM5/7/05
to


You're right. I misread what he was asking for. I interprested it as
meaning he wanted to access a directory (i.e. external tables or
utl_file). He did say he just wanted to create one though. Mea
culpa.

I'm not sure why someone would want to create an actual OS directory
from inside the DB though. Even the SQL CREATE DIRECTORY should be
done in advance. To me, that's kind of like creating tables on the
fly.

agon...@gmail.com

unread,
May 7, 2005, 3:28:04 PM5/7/05
to
in 10g it is simple.
just run this :
begin
DBMS_SCHEDULER.CREATE_JOB (
job_name =>'create_dir_test',
job_type =>'executable',
job_action => 'c:\winxp\system32\cmd.exe /c mkdir c:\test\test1',
enabled =>true,auto_drop => true
);
commit;
end;
/

on windows you will to start OracleJobSchedulerSID before using it.

Lewis C

unread,
May 7, 2005, 8:23:26 PM5/7/05
to

Sweet! I haven't had a chance to do more than glance at the docs for
the scheduler so far. I really need to dig into that some more.

Thanks,

0 new messages