Re: How to call shell script from PL/SQL ?.

From: <yitbsal_at_statcan.ca>
Date: 2000/05/12
Message-ID: <8fh86o$4cp$1_at_nnrp1.deja.com>#1/1


In article <38FF7D81.6C4EF57E_at_att.com>,   Raj <rajarulmani_at_att.com> wrote:
> Tom,
> External procedure fn getting executed correctly but the action is
 not being
> done . i,e creating a file / deleting a file / executing a file .
 Could you
> please let me know what i'm missing in my process.
>
> Here is the fn:
>
> int call_system ( char *progname , int a )
> {
>
> FILE *fp;
>
> fp = fopen ("test.txt","w");
>
> fprintf( fp , " First line is ! ");
>
> fclose( fp );
>
> }
>
> This code doesn't create the file "test.txt" .
>
> Tom Zamani wrote:
>
> > You need to provide us what version of database you are using.
> > If 7 then I have no Idea I am not sure if you can do that.
> > if 8.X you need to use external procedures in oracle
> > if 8.1.6 there is a package in oracle which could help you with this
 (I
> > don't know the name of the package).
> > I have used external procedures to do ftp ,cp, mv send email etc,
 and it is
> > very fast.
> >
> > Tom
> >
> > Raj <rajarulmani_at_att.com> wrote in message
 news:38FDF480.9D00B0B1_at_att.com...
> > > Hi,
> > > can any one tell me how to call a shell script from PL/SQL ?.
> > >
> > > Thanks,
> > > Raj
> > >
> > >
>

In case you haven't found the answer yet ...

If you _know_ the external procedure is being executed, then there are two possible causes of the problem.

  1. The oracle account on your server does not have read/write access to the directory that you are creating or deleting the file from. As far as I know, external procedures run under the oracle account as far as the server operating system is concerned.
  2. When you compile the C library, make sure you have correctly specified the Oracle includes. For example:

gcc -I/oracle/product/8.1.5/rdbms/demo
-I/oracle/product/8.1.5/network/public etc.

Make sure the above paths are correct. These Oracle libraries include things that allow the server oracle account to write to operating system files.

Let me know what happens.

Salaam

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Fri May 12 2000 - 00:00:00 CEST

Original text of this message