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

Home -> Community -> Usenet -> c.d.o.tools -> External Procedure: C from PLSQL/Windows2000/Oracle8.1.6EE

External Procedure: C from PLSQL/Windows2000/Oracle8.1.6EE

From: Frank <franjoe_at_frisurf.no>
Date: Thu, 9 Aug 2001 16:14:30 +0200
Message-ID: <3Wwc7.654$fT5.9926@news1.oke.nextra.no>

Hi!
Windows2000, Oracle 8.1.6EE

I have tried to create a little dll, and have created the library/procedure as below.
When I call my test snippet I get the errors:

DECLARE
  a BINARY_INTEGER := 1;
BEGIN
  funksjon (a);
END;
/

FEIL på linje 1:

ORA-06521: PL/SQL: Feil ved tilordning av funksjon
ORA-06522: Unable to load symbol from DLL
ORA-06512: ved "SYSTEM.FUNKSJON", line 0
ORA-06512: ved line 4

The dll is compiled with C++Borland 3 Standard (Build 3.70), I suspect that there are some libraries that are compiled into the dll, and have tried to disable all runtime libraries that Borland uses, still I get this message.
I have tested the dll with a C program created in C++Builder, and it seems to work.

Another thing that I observe:
When I start Net8 Assistand, and choose Service Naming, and the extproc_connection_data service, and Test it, I get the error message: "EXTPROC.exe has generated errors and will be closed by Windows....." in a dialog box,
the report window says ORA-03113:end-of.file on communication channel. If I try to change the options in the Net8 Assistand, "Use Oracle 8i Compatible Identification" checked on enter ORCL as the Service name, and restart (PC and everything :-) and retest in Net8, that test passes and my snippet instead get the ORA-28576.

I have checked that the EXTPROC is in ORACLE_HOME/bin, and is working.

Frank



#include <windows.h>
#pragma hdrstop
#include <condefs.h>

#pragma argsused
int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) {

        return 1;
}

__declspec(dllexport) void funksjon (long Tall) {   Tall++;
}

CREATE OR REPLACE LIBRARY lib_test IS 'C:\Temp\PLSQL_dll.dll';
/

SHOW ERRORS CREATE OR REPLACE PROCEDURE funksjon (

   tall BINARY_INTEGER)
AS LANGUAGE C
LIBRARY lib_test
NAME "funksjon";
/

SHOW ERRORS DECLARE
  a BINARY_INTEGER := 1;
BEGIN
  funksjon (a);
END;
/

SHOW ERRORS Received on Thu Aug 09 2001 - 09:14:30 CDT

Original text of this message

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