使用它返回游标小巧玲珑与Oracle存储过程 [英] Using Dapper with Oracle stored procedures which return cursors

查看:287
本文介绍了使用它返回游标小巧玲珑与Oracle存储过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将一去使用精致小巧与返回游标Oracle存储过程?

How would one go about using Dapper with Oracle stored procedures which return cursors?

var p = new DynamicParameters();
p.Add("foo", "bar");
p.Add("baz_cursor", dbType: DbType.? , direction: ParameterDirection.Output);

下面,所述的DbType是的System.Data.DbType不具有一个光标构件。我已经使用DbType.Object尝试,但并不既OracleClient的和OracleDataAcess工作。

Here, the DbType is System.Data.DbType which does not have a Cursor member. I've tried using DbType.Object but that does not work with both OracleClient and OracleDataAcess.

什么是使用OracleType或OracleDbType一个可行的办法呢?

What would be a possible way to use OracleType or OracleDbType instead?

推荐答案

您必须实现:

 public interface IDynamicParameters
 {
    void AddParameters(IDbCommand command, Identity identity);
 }

然后在 AddParameters 回调,你会投 IDbCommand的的OracleCommand 并添加DB具体PARAMS。

Then in the AddParameters callback you would cast the IDbCommand to an OracleCommand and add the DB specific params.

这篇关于使用它返回游标小巧玲珑与Oracle存储过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆