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

Home -> Community -> Usenet -> c.d.o.server -> Re: call extern C function from PL/SQL

Re: call extern C function from PL/SQL

From: Thomas Kyte <tkyte_at_oracle.com>
Date: 25 Jun 2002 10:45:24 -0700
Message-ID: <afaa7k02avj@drn.newsguy.com>


In article <af885j$fkpa$1_at_as201.hinet.hr>, "REM" says...
>
>Hello, I'm having problem with calling extern C routin.
>As you see I'm loading extern C routin, publishing it, but I don't know how
>call Plzbroj_func function!!!
>
>
>SQL> CREATE OR REPLACE LIBRARY C_utils AS
>'G:\users\ibrnadic\Extern_Rutins_to_Oracle\Debug';
> 2 /
>

that looks like a directory path, NOT a .dll file. what is the name of the DLL -- that is what goes there.

>Library created.
>
>SQL> CREATE OR REPLACE FUNCTION Plzbroj_func (
> 2 x FLOAT,
> 3 y FLOAT)
> 4 RETURN FLOAT
> 5 AS LANGUAGE C
> 6 LIBRARY C_utils
> 7 NAME "zbroj";
> 8 /
>
>Function created.
>
>SQL> DECLARE
> 2 g FLOAT;
> 3 a FLOAT:=5;
> 4 b FLOAT:=10;
> 5 BEGIN
> 6 dbms_output.put_line('proba');
> 7 g:=Plzbroj_func(a, b);
> 8 end;
> 9 /
>DECLARE
>*
>ERROR at line 1:
>ORA-06520: PL/SQL: Error loading external library
>ORA-06522: Unable to load DLL
>ORA-06512: at "SCOTT.PLZBROJ_FUNC", line 0
>ORA-06512: at line 7
>
>With regards,
>
>desparait ilica
>
>"Dale Edgar" <Dale_at_DataBee.com> wrote in message
>news:3d16fb51.14679407_at_news.btclick.com...
>>
>> On Sat, 22 Jun 2002 23:45:16 +0200, "REM" <ilica.brnadic_at_zg.hinet.hr>
>> wrote:
>>
>> >I'm know that is posible to load java class to the database but, is't
>> >posible call extern C function direct from PL/SQL???
>>
>> Yes it is - a google search on "extproc" should turn up a lot
>> information. Here's an excellent tutorial to get you started:
>>
>> http://home.clara.net/dwotton/dba/oracle_extn_rtn.htm
>>
>> Regards
>> Dale
>> ----------------------
>> Need instant schema documentation? Check out the DDL to HTML generator
>> in the free DataBee DBATool. http://www.DataBee.com/dt_home.htm
>
>

--
Thomas Kyte (tkyte@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 Tue Jun 25 2002 - 12:45:24 CDT

Original text of this message

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