Odp.Net Provider - Problem with BuildParameterName override

Topics: Development Team Discussion
Jun 25, 2009 at 12:24 AM

I tend to use the DAAB in the following way:

IDataReader reader = this._database.ExecuteReader("mypkg.fetch_something", inputParameter, string.Empty)

where the package is something like

PROCEDURE fetch_something(inputParameter IN VARCHAR2, cur_out OUT ret_cursor)

The override of BuildParameterName causes problems because it adds a colon to the parameter names and throws a null reference exception when it can't find the parameter. I'd suggest this override be removed which would make the behavior consistent with Microsoft Oracle client or, if you really need this for executing Sql statements, not to add the colon for stored procs. Perhaps change the GetParameterValue override to something like

        public override object GetParameterValue(DbCommand command, string name)
            object convertedValue = base.GetParameterValue(command,
                command.CommandType == CommandType.StoredProcedure ? name : BuildOracleParameterName(name));

I'm working with the latest version of the EntLibContrib41Src.

Thanks for all this work.

Sep 5, 2009 at 9:35 PM

Sorry for the late reply, I have been out of action for a couple of months.  However, I did quite a lot of work on the ODP.NET provider in July, especially with packages, which would have been after this topic was filed.  Would it be possible to download the current source and see if I have already fixed this issue?  I believe I removed the BuildParamterName override. If not I will take another look.  I did find packages and the whole business of getting result sets back from Oracle Stored procedures quite confusing. I also created a script for building the Northwind DB on Oracle XE so I could run a standard set of Unit Tests.

Cheers...   Steve