这里我们需要将qracle数据库迁移到sql server。这里我们使用的是c#.net应用程序。
下面给出了Oracle的示例代码。
这里我们使用的是OracleType.Cursor,那么sqldbtype中的等值是什么?
public DataSet GetL3CompanyDesc()
{
DataSet dsCompanyDetails = new DataSet();
try
{
oracleConnection = new OracleConnection(connectionString);
OracleParameter[] arrayParameter = new OracleParameter[2];
arrayParameter[0] = new OracleParameter(IODDALConstants.GetL3CompanyDescRefCur, OracleType.Cursor);
arrayParameter[0].Direction = ParameterDirection.Output;
arrayParameter[1] = new OracleParameter(IODDALConstants.GetL3CompanyDescCubeVersion, OracleType.Cursor);
arrayParameter[1].Direction = ParameterDirection.Output;
OracleHelper.FillDataset(oracleConnection, CommandType.StoredProcedure, IODDALConstants.GetL3CompanyDesc, dsCompanyDetails, new string[] { IODDALConstants.GetL3CompanyDescTableName }, arrayParameter);
}
catch (Exception ex)
{
bool rethrow = ExceptionLogEntry.HandleDALException(ex);
if (rethrow)
{
throw;
}
}
finally
{
if (oracleConnection != null)
oracleConnection.Dispose();
}
return dsCompanyDetails;
}在Oracle存储过程中,它们将游标作为参数进行传递。是否有可能在SQL中将游标作为参数传递。以及如何将游标作为输出参数从c#代码传递给sql存储过程?
有人能帮我解决这个问题吗?
发布于 2012-08-22 15:46:20
在T-SQL中,不能将游标作为SP参数传递。使用此MSDN sample中所示的表值参数。
https://stackoverflow.com/questions/12067647
复制相似问题