C#调用Oracle PL/SQL存储过程,传递数组参数

proghua 2010-07-01 12:09:46
我在Oracle数据库中写了个存储过程如下:
create or replace package coordinate is
type int_array is table of number index by binary_integer;
procedure setxcoordinate(testunitno_array int_array, length number);
end coordinate;

请问我在C#中如何传递整型数组
...全文
280 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
daihua_1113 2010-07-01
  • 打赏
  • 举报
回复
这个我们技术部老大也是这么做的 感觉还可以啦 不是很复杂 直接传数组好像数据库里面没有这个类型的对象接收
proghua 2010-07-01
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 daihua_1113 的回复:]
把数组转换成特定的字符串 传入存储过程 然后对字符串进行解析就可以了
[/Quote]
这种方法我也想过,的确是一种可行的方法。
可我觉得如果能直接传数组就更好了
proghua 2010-07-01
  • 打赏
  • 举报
回复
我用oracle提供的ODP.net解决了这个问题
Dobzhansky 2010-07-01
  • 打赏
  • 举报
回复
反向一下看看.

用 OracleCommandBuilder 的

public static void DeriveParameters (
OracleCommand command
)

查询一下看看得到的参数类型.
daihua_1113 2010-07-01
  • 打赏
  • 举报
回复
把数组转换成特定的字符串 传入存储过程 然后对字符串进行解析就可以了

110,533

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧