Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> External Procedure - Long and Painful
I have been tasked with calling a C dll from PLSQL. I have added a listener
to our development box and modified the TNSnames file for the external
procedure. The docs were less than helpful, but metalinks had a few good
articles that helped. I have tested it and it works well. After much
headache, I created the extren.dll for the rdbms80\exproc directory using
Visual C++. I can call the dll with the supplied UseIT procedure.
The problem is that the dll I need to use returns the same value regardless of what parameters I pass it or it creates a Dr. Watson error. I have a TAR open but WWS has been less than unless. I know the problem is with the datatypes I am using in the library. I have tried every combination of datatype, but I am not a C programmer.
I really need some help getting this to work. I am hoping that one of you wonderful people would take a look at this a point me in the right direction. I would really appreciate it if I could get a copy of a function creation script that one of you have used with calling C dlls. Below is the parameters and datatypes of the dll along with my function creation script. Thank you very much.
short EXPORT cOptionsBS(double Model, short TypeOpt, double Func, double Underlying,
double Exercise, double Time, double Volatility, double InterestRate, double YieldRate,
double MarketOptionPrice, double DivAmount, double TimeExDiv, double DivFreq, char FAR *
TypeRate, short LenTypeRate, short TimeBasis, double TimeToEarlyExer, short,
char FAR * OutString, short SizeOutString, double FAR * ans);
create or replace function option_calc(model BINARY_INTEGER,
typeopt BINARY_INTEGER,
func BINARY_INTEGER,
Underlying BINARY_INTEGER,
Exercise BINARY_INTEGER,
Time BINARY_INTEGER,
Volatility char,
InterestRate BINARY_INTEGER,
YieldRate BINARY_INTEGER,
MarketOptionPrice BINARY_INTEGER,
DivAmount BINARY_INTEGER,
TimeExDiv BINARY_INTEGER,
DivFreq BINARY_INTEGER,
TypeRate string,
TimeBasis string,
TimeToEarlyExer BINARY_INTEGER,
Method BINARY_INTEGER)
return double
as
external library optcalc
name "cOptionsBS"
Received on Mon May 15 2000 - 17:18:19 CDT
![]() |
![]() |