I have Oracle 12C installed in my system. I have created one SP which is returning a Table When I am trying to execute it in SQL Developer, it is giving me correct result, But When I am calling it from my DOTNET application it is giving me the error --"Unsupported column datatype". I am trying to fill dataset using Data adapter. To check I commented all the code in the procedure and returned the table using below code.
Declare
rc sys_refcursor;
Begin
OPEN rc FOR SELECT 'Sayam' AS "Error" FROM dual;
SYS.DBMS_SQL.RETURN_RESULT (rc, TRUE) ;
END;
But Still the problem was same. Below is the trace of the same.
Oracle.ManagedDataAccess.Client.OracleException was caught HResult=-1450 Message=Unsupported column datatype Source=Oracle Data Provider for .NET, Managed Driver ErrorCode=-1450 DataSource="" Number=-1450 Procedure=""
StackTrace: at Oracle.ManagedDataAccess.Client.OracleParameter.PreBind(OracleConnectionImpl connImpl, ColumnDescribeInfo cachedParamMetadata, Boolean& bMetadataModified, Int32 arrayBindCount, ColumnDescribeInfo& paramMetaData, Object& paramValue, Boolean isEFSelectStatement) at OracleInternal.ServiceObjects.OracleCommandImpl.InitializeParamInfo(ICollection paramColl, OracleConnectionImpl connectionImpl, ColumnDescribeInfo[] cachedParamMetadata, Boolean& bMetadataModified, Boolean isEFSelectStatement, MarshalBindParameterValueHelper& marshalBindValuesHelper) at OracleInternal.ServiceObjects.OracleCommandImpl.ProcessParameters(OracleParameterCollection paramColl, OracleConnectionImpl connectionImpl, ColumnDescribeInfo[] cachedParamMetadata, Boolean& bBindMetadataModified, Boolean isEFSelectStatement, MarshalBindParameterValueHelper& marshalBindValuesHelper, Boolean& bAllInputBinds) at OracleInternal.ServiceObjects.OracleCommandImpl.ExecuteReader(String commandText, OracleParameterCollection paramColl, CommandType commandType, OracleConnectionImpl connectionImpl, OracleDataReaderImpl& rdrImpl, Int32 longFetchSize, Int64 clientInitialLOBFS, OracleDependencyImpl orclDependencyImpl, Int64[] scnForExecution, Int64[]& scnFromExecution, OracleParameterCollection& bindByPositionParamColl, Boolean& bBindParamPresent, Int64& internalInitialLOBFS, OracleException& exceptionForArrayBindDML, Boolean isDescribeOnly, Boolean isFromEF) at Oracle.ManagedDataAccess.Client.OracleCommand.ExecuteReader(Boolean requery, Boolean fillRequest, CommandBehavior behavior) at Oracle.ManagedDataAccess.Client.OracleDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet) at DataAccessLayer.DataAccessService.OracleGetData_Load(String SPName, XElement QueryParam, Exception& e, Boolean bFlag) in d:\Sayam\April\Multiplay\DataAccessLayer\DataAccessLayer\DAS.cs:line 187
I have tried this link also.
Unsupported column datatype ODP.NET
Please let me know if I need to change any where.
using Oracle.ManagedDataAccess.Client;
and the code goes
if (this.ConOracle.State == ConnectionState.Closed)
ConOracle.Open();
oraCmd.Connection = ConOracle;
oraCmd.CommandTimeout = 0;
oraCmd.CommandType = CommandType.StoredProcedure;
OracleGetQuery(ref oraCmd, SPName.Split('.')[1],QueryParam);
using (OracleDataAdapter oraDA = new OracleDataAdapter(oraCmd))
{ oraDA.Fill(ds); }
Thanks Sayam