我试图在C#中使用Microsoft.Practices.EnterpriseLibrary 6调用Oracle存储过程
以下是我的存储过程
create or replace
PROCEDURE "US_GET" (inputa IN integer,
cur_OUT IN OUT SYS_REFCURSOR)
IS
cur_N SYS_REFCURSOR;
BEGIN
OPEN cur_N FOR
SELECT columnb FROM tablea
WHERE columna = inputa;
cur_OUT := cur_N;
end US_GET;
以下代码用于调用此过程
DatabaseProviderFactory factory = new DatabaseProviderFactory();
Database db = factory.Create(DataBaseInstance);
DbCommand dbCommand = db.GetStoredProcCommand("US_GET");
db.AddInParameter(dbCommand, "inputa", DbType.Int32, 0);
Dataset ds = db.ExecuteDataSet(dbCommand);
我在运行时
时遇到错误Oracle.DataAccess.Client.OracleException: ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'US_GET'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
有没有人遇到过这个错误?有没有可用的修复?我尝试了不同的实现方法,但无法实现解决方案
答案 0 :(得分:0)
我从以下格式更改了连接字符串中的提供程序
connectionString="Provider=OraOLEDB.Oracle;Data Source=;User ID=;Password=;OLEDB.NET=true;PLSQLRSet=true;"
这种格式并且有效
connectionString="Data Source=;User ID=;Password=;" providerName="System.Data.OracleClient"