2 Replies Latest reply on Oct 12, 2014 8:33 PM by aceinc

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

    aceinc

      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.