The example uses Oracle Linux 5 32bits , Oracle 11gR2 EE
Call C
csum
int csum(int a, int b)
{
return (a+b);
}
gcc -c -fPIC csum.c -o csum.o
gcc -shared -Wl,-soname,csum.so.1 -o csum.so.1.0.1 csum.o
mv csum.so.1.0.1 /oracle/product/11.2.0/dbhome_1/lib
ln -sf /oracle/product/11.2.0/dbhome_1/lib/csum.so.1.0.1 /oracle/product/11.2.0/dbhome_1/lib/csum.so
ln -sf /oracle/product/11.2.0/dbhome_1/lib/csum.so.1.0.1 /oracle/product/11.2.0/dbhome_1/lib/csum.so.1
create or replace library calc_sum as '/oracle/product/11.2.0/dbhome_1/lib/csum.so';
/
create or replace function getCSUM( a binary_integer,b binary_integer) return binary_integer
as language c
library calc_sum
name "csum";
/
select getCSUM(10,2) from dual;