I have a function defined inside an Oracle package:
CREATE OR REPLACE PACKAGE BODY TESTUSER.TESTPKG as
FUNCTION testfunc(n IN NUMBER) RETURN NUMBER as
begin
I think you should consider using the Oracle Client instead.
And if you choose ODBC to have just to create a DSN
and then connect to it to be somehow database agnostic, consider using Enterprise Library Data Access Application Block.
try
OdbcCommand command = new OdbcCommand("begin ? := TESTUSER.TESTPKG.testfunc(?) end;", connection);
In the past I would use something like to following for the command string:
"{? = CALL JF_TESTUSER.TESTPKG.testFunc(?)}"
See the following article for more information
I managed to call the package function like this:
command.CommandText = @"begin
:ret := ILMTEST.testpkg.testfunc(:n);
end;";
command.CommandType = System.Data.CommandType.Text;