External Proc Execution [message #39392] |
Sun, 14 July 2002 07:49 |
MJ
Messages: 11 Registered: April 2002
|
Junior Member |
|
|
Hi,
I tried to create an external proc but when I queried the user_objects , i did not find the object.
I am using personal oracle8,connected to Beq-local
database.
outstr is the name of the function in C.
Can anyone tell where is the error .
is any modification reqd to listener or tnsnames.ora
here is the method I followed :
create library fprntlib as
'f:extc_shared_libdll_prj.dll';
library gets created.
create or replace procedure filpr(ip_mesg varchar2,ip_fpath varchar2,ip_flg number)
as external
Library FPRNTLIB
NAME "outstr"
PARAMETERS(ip_mesg string,ip_fpath string,ip_flg int);
begin
filpr('First Line...','f:extfilpr.log',0);
filpr('Second Line...','f:extfilpr.log',1);
end;
error :identifier filpr must be declared.
Listener.ora
------------
################
# Filename......: listener.ora
# Node..........: local.world
# Date..........: 24-MAY-94 13:23:20
################
LISTENER =
(ADDRESS_LIST =
(ADDRESS=
(PROTOCOL= IPC)
(KEY= oracle.world)
)
(ADDRESS=
(PROTOCOL= IPC)
(KEY= ORCL)
)
(ADDRESS=
(COMMUNITY= NMP.world)
(PROTOCOL= NMP)
(SERVER= MJG)
(PIPE= ORAPIPE)
)
(ADDRESS=
(PROTOCOL= TCP)
(Host= mjg)
(Port= 1521)
)
(ADDRESS=
(PROTOCOL= TCP)
(Host= mjg)
(Port= 1526)
)
(ADDRESS=
(PROTOCOL= TCP)
(Host= 127.0.0.1)
(Port= 1521)
)
(ADDRESS=
(PROTOCOL= SPX)
(Service= mjg_lsnr)
)
)
STARTUP_WAIT_TIME_LISTENER = 0
CONNECT_TIMEOUT_LISTENER = 10
TRACE_LEVEL_LISTENER = 0
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = mjg)
(SID_NAME = ORCL)
)
(SID_DESC =
(SID_NAME = extproc)
(PROGRAM=extproc)
)
)
PASSWORDS_LISTENER = (oracle)
tnsnames.ora
------------
# TNSNAMES.ORA Configuration file: H:ORANTNET80ADMINtnsnames.ora
# Generated by Oracle Net8 Assistant
Beq-local.world =
(DESCRIPTION =
(ADDRESS =
(PROTOCOL = BEQ)
(PROGRAM = oracle80)
(ARGV0 = oracle80ORCL)
(ARGS = '(DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))')
)
(CONNECT_DATA = (SID = ORCL)
)
)
Tcp-loopback.world =
(DESCRIPTION =
(ADDRESS =
(PROTOCOL = TCP)
(Host = 127.0.0.1)
(Port = 1521)
)
(CONNECT_DATA = (SID = ORCL)
)
)
TcpExample.world =
(DESCRIPTION =
(ADDRESS =
(PROTOCOL = TCP)
(Host = Production1)
(Port = 1521)
)
(CONNECT_DATA = (SID = SID1)
)
)
SpxExample.world =
(DESCRIPTION =
(ADDRESS =
(PROTOCOL = SPX)
(Service = Server_lsnr)
)
(CONNECT_DATA = (SID = ORCL)
)
)
NmpExample.world =
(DESCRIPTION =
(ADDRESS =
(PROTOCOL = NMP)
(Server = FinanceServer1)
(Pipe = ORAPIPE)
)
(CONNECT_DATA = (SID = ORCL)
)
)
CMExample.world =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(PROTOCOL = tcp)
(PORT = 1610)
(HOST = CM_SERVER)
)
(ADDRESS =
(PROTOCOL = tcp)
(PORT = 1521)
(HOST = LSNR_SERVER)
)
)
(CONNECT_DATA = (SID = ORCL)
)
(SOURCE_ROUTE = yes)
)
extproc_connection_data.world =
(DESCRIPTION =
(ADDRESS =
(PROTOCOL = IPC)
(KEY = ORCL)
)
(CONNECT_DATA = (SID = extproc)
)
)
dll_prj.c
--------
#include<stdio.h>
void outstr(char *messg,char *fname,int flg)
{
FILE *fp;
if( flg == 0)
fp = fopen(fname,"w");
fputs(fp,messg);
if (flg == 1)
fclose(fp);
}
dll_prj.h
--------
#ifdef WIN32
#ifdef dll_prj_EXPORTS
#define dll_prj_API __declspec(dllexport)
#else
#define dll_prj_API __declspec(dllimport)
#endif
#else /* not MSVC */
#define dll_prj_API
#endif
dll_prj_API
void
outstr PARAMS((char *messg,char *fname,int flg));
|
|
|
Re: External Proc Execution [message #39394 is a reply to message #39392] |
Sun, 14 July 2002 09:53 |
MJ
Messages: 11 Registered: April 2002
|
Junior Member |
|
|
Hi,
I could create the procedure , but while executing it,I got the error "unable to load symbol from dll"
what changes are reqd in dll source file .
|
|
|