我如何在C#中调用oracle函数 [英] how i can call oracle function in c#

查看:72
本文介绍了我如何在C#中调用oracle函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建


SQL>创建或替换类型为对象的arr(
2 ename varchar2(100),
3个empno号(3))
4/

类型已创建.

----
创建或替换功能fun_1
返回arr
作为
x arr;
开始
x.ename:=''mostafa'';
x.empno:= 1;
返回x;
结束;
/

所以我怎么能在C#中调用此函数
并显示值x .ename和x.empno
感谢您的帮助.

i create


SQL> create or replace type arr as object(
2 ename varchar2(100),
3 empno number(3))
4 /

Type created.

----
create or replace function fun_1
return arr
as
x arr;
begin
x.ename:=''mostafa'';
x.empno:=1;
return x;
end;
/

so how i can call this function in c#
and show values x .ename and x.empno
thank for any help

推荐答案

您需要创建一个对应的类,该类映射到Oracle UDT.

查看本文 [
You''ll need to create a corresponding class that maps to the Oracle UDT.

Check out this article[^] to get you started. It''s the ODP.NET release for 11g, so I''m not sure if it''s a fit for you or not.

HTH...there''s also info in there about populating a dataset with the UDT result.

Cheers.


这篇关于我如何在C#中调用oracle函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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