Re: Calling a UNIX system call from Forms 5.0

From: <sanjaykuriyal_at_my-deja.com>
Date: Wed, 19 Apr 2000 17:59:06 GMT
Message-ID: <8dks4v$1uo$1_at_nnrp1.deja.com>


Tom,
[Quoted] Thanks a bunch for the valued information.

Just to update you,
I'd like to give you some more details.
The oracle database version is 8.0.5.1.0 and it runs on a sun solaris unix server.
The C function I created looks like this : please ignore the main function . that was for testing purpose.

#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>

/*main(int argc , char **argv)
{

        printf("Hostname is %s\n",argv[1]);
        if(ifhostfound(argv[1]))
                printf("Host found\n");
        else
                printf(" Host does not exist\n");

}
*/

int ifhostfound(char *hostname)
{

        struct hostent *hostip;
        hostip = gethostbyname(hostname);
        if(hostip==NULL)
                return 0;
        else
                return 1;

}

I compiled the code to make an object file. I did not make it a shared object. Which I will. Could you please tell me more about an oracle wrapper function? The C function I created is in my home directory on the unix machine. what permission do i set on it?
Thanks Again
Sanjay

In article <8dj7vs$1tq$1_at_perki.connect.com.au>,   "Tom Zamani" <tomz_at_redflex.com.au> wrote:
> use External procedure call, from oracle DB, ORacle 8.1.6 has its own
> pakage for external procedure call.
> but if you are using 8.X then External procedure call is the way.
> if your DB is less than 8 then I am not sure.
>
> create a C function which executes system (input command output
number)
> make an object filr cc -c Myfunction.c -o Myfunction.o
> make a shared object ld -G Myfunction.o -o Myfunction.so
>
> in oracle create a library pointing to the Myfuntion.so
> create library Mylib as 'full path to Myfunction.so'
> create an oracle wrapper function
> Some thing like this
> Function SYSRUN
> ( syscomm IN varchar2)
> RETURN binary_integer AS external
> LANGUAGE C
> NAME "sysrun"
> LIBRARY shell_lib;
>
> then by using a PLSQL procedure execute this function.
> Tom
>
> Tom
> <sanjaykuriyal_at_my-deja.com> wrote in message
> news:8dir8l$q52$1_at_nnrp1.deja.com...
> > Hello,
> >
> > I need to use the unix system call gethostbyname from Forms 5.0. Is
> > there any library or any other way in which I can call a unix system
> > call. If No, is there any way I can call a C executable from Form
5.0.
> > like ora_ffi or user_exit. If so please help me with the detail
> > procedure to go through it.
> > I have Forms 5.0 running on a windows NT workstation.
> >
> > Thanks in advance.
> > Sanjay
> >
> >
> > Sent via Deja.com http://www.deja.com/
> > Before you buy.
>
>

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Wed Apr 19 2000 - 19:59:06 CEST

Original text of this message