Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

How can I make an existing VB.NET DLL's functions available to stored procedures?

aceincOct 10 2014 — edited Oct 12 2014

I have a generic string manipulation function developed as a class as follows;

Public Class MyClass

     Public Function MyFunction(ByVal inString As String) As String

          Dim MyString as String = inString & " Some Stuff"

          Return MyString

     End Function

End Class

The real function does real stuff, but it is all string manipulation, no DB, file or screen access.

Is there an easy way to make this function callable from a procedure within a package within an Oracle DB?

I have installed Oracle DB Extensions for .NET on the DB server.

I am hoping to avoid installing anything on the computer where I develop my VB.NET code.

I have created external packages using a c library (c++ DLL) before, but I was under the impression that .NET is different. Everything I find when searching seems to talk about some form of extension to VS that allows an "easy" deploy straight from .NET.

I will eventually need to deploy this on multiple DBs and want a manual process that I can just run, and not connect to each DB from my .NET development computer.

I have an existing C++ library I call from PL/SQL. When I define the package body it looks like;

create or replace

PACKAGE BODY  "MY_PACKAGE" AS FUNCTION MY_FUNCTION (VAR1  in varchar2, VAR2 in varchar2, VAR3 in varchar2)RETURN PLS_INTEGER

IS

     EXTERNAL

     LIBRARY DLL_MY_LIBRARY

     NAME "MY_FUNCTION"

     LANGUAGE C

     PARAMETERS (VAR1 string, VAR2 string, VAR3 string);

END MY_PACKAGE;

What does the definition for a VB.NET function within a class look like? Do I need dot notation like;

create or replace

PACKAGE BODY  "MY_PACKAGE" AS FUNCTION MY_CLASS.MY_FUNCTION (VAR1  in varchar2, VAR2 in varchar2, VAR3 in varchar2)RETURN PLS_INTEGER

IS

     EXTERNAL

     LIBRARY DLL_MY_LIBRARY

     NAME "MY_CLASS.MY_FUNCTION"

     LANGUAGE VB.NET

     PARAMETERS (VAR1 string, VAR2 string, VAR3 string);

END MY_PACKAGE;

What should the language be?

What would be useful is documentation that shows how to manually add an existing .NET DLL to a database so that it can be accessed by PL/SQL. If this is available, please point me to it.

All of the documentation that I have found just shows how to install and use the  VS add on.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 9 2014
Added on Oct 10 2014
2 comments
2,329 views