Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: How can I call Unix commnad in pl/sql?

Re: How can I call Unix commnad in pl/sql?

From: Thomas Kyte <tkyte_at_oracle.com>
Date: 6 Mar 2002 08:04:33 -0800
Message-ID: <a65emh025s1@drn.newsguy.com>


In article <8882aa3c.0203060729.100e2a8_at_posting.google.com>, andyho99_at_yahoo.com says...
>
>Hello,
>
>I am trying to call UNIX command (such as cp) in my pl/sql program. I
>am using AIX. I think the syntax should be the same for for Unixs. Has
>anyone done this before and how? I was surprised that I could not find
>in Oracle's pl/sql manual. This should be a baisc requirement. C can
>do this pretty easy.
>
>Thanks, Andrew

see
http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:952229840241 for one approach in 8i (sigh, never ever a version).

In 8.0 you can use external procedures written in C.

There are HUGE issues with this -- issues that just don't exist in "C" as "C" is a general purpose programming language. First and foremost is that your plsql is running as "Oracle" so the addition of a simple host command makes "rm -rf /*.dbf" trivial (so be careful with this capability if you add it). "C" would not be able to do that unless Oracle itself ran it (or you had it setuid())

--
Thomas Kyte (tkyte@us.oracle.com)             http://asktom.oracle.com/ 
Expert one on one Oracle, programming techniques and solutions for Oracle.
http://www.amazon.com/exec/obidos/ASIN/1861004826/  
Opinions are mine and do not necessarily reflect those of Oracle Corp 
Received on Wed Mar 06 2002 - 10:04:33 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US