当前位置:网站首页>C # use Oracle stored procedure to obtain result set instance
C # use Oracle stored procedure to obtain result set instance
2022-07-06 20:57:00 【51CTO】
stored procedure :
create or replace PACKAGE FIRSTPAGE AS
/* TODO enter package declarations (types, exceptions, methods etc) here */
type v_cursor is REF CURSOR;
procedure getnumber(re_cursor out v_cursor);
END FIRSTPAGE;
create or replace PACKAGE BODY FIRSTPAGE AS
procedure getnumber(re_cursor out v_cursor) AS
BEGIN
/* TODO implementation required */
open re_cursor for
select * from testable;
END getnumber;
END FIRSTPAGE;
C# Code :
public DataSet GetTableByProcedure()
{
OracleConnection con = new OracleConnection(_connectionString);
OracleCommand cmd = new OracleCommand();
cmd.Connection = con;
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "firstpage.getnumber";
OracleParameter sp = new OracleParameter("re_cursor", OracleType.Cursor);
sp.Direction = ParameterDirection.Output;
cmd.Parameters.Add(sp);
OracleDataAdapter da = new OracleDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
cmd.Dispose();
con.Close();
con.Dispose();
return ds;
}
边栏推荐
- 【DSP】【第二篇】了解C6678和创建工程
- SSO single sign on
- 快过年了,心也懒了
- Entity alignment two of knowledge map
- Activiti global process monitors activitieventlistener to monitor different types of events, which is very convenient without configuring task monitoring in acitivit
- Tips for web development: skillfully use ThreadLocal to avoid layer by layer value transmission
- Math symbols in lists
- Leetcode hot topic Hot 100 day 32: "minimum coverage substring"
- Utilisation de l'écran OLED
- 每个程序员必须掌握的常用英语词汇(建议收藏)
猜你喜欢
基于深度学习的参考帧生成
[diy] how to make a personalized radio
Detailed explanation of knowledge map construction process steps
HMS Core 机器学习服务打造同传翻译新“声”态,AI让国际交流更顺畅
“罚点球”小游戏
None of the strongest kings in the monitoring industry!
How to upgrade high value-added links in the textile and clothing industry? APS to help
Design your security architecture OKR
KDD 2022 | 通过知识增强的提示学习实现统一的对话式推荐
1_ Introduction to go language
随机推荐
OLED屏幕的使用
2022 construction electrician (special type of construction work) free test questions and construction electrician (special type of construction work) certificate examination
Mécanisme de fonctionnement et de mise à jour de [Widget Wechat]
自定义限流注解
[weekly pit] information encryption + [answer] positive integer factorization prime factor
Laravel笔记-自定义登录中新增登录5次失败锁账户功能(提高系统安全性)
Math symbols in lists
2022 refrigeration and air conditioning equipment installation and repair examination contents and new version of refrigeration and air conditioning equipment installation and repair examination quest
What is the difference between procedural SQL and C language in defining variables
How to upgrade high value-added links in the textile and clothing industry? APS to help
【mysql】游标的基本使用
如何实现常见框架
None of the strongest kings in the monitoring industry!
Mtcnn face detection
Use of OLED screen
性能测试过程和计划
基于STM32单片机设计的红外测温仪(带人脸检测)
Comment faire une radio personnalisée
use. Net analysis Net talent challenge participation
What programming do children learn?