当前位置:网站首页>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;
}
边栏推荐
- 防火墙基础之外网服务器区部署和双机热备
- Laravel笔记-自定义登录中新增登录5次失败锁账户功能(提高系统安全性)
- Minimum cut edge set of undirected graph
- Performance test process and plan
- C language operators
- SAP UI5 框架的 manifest.json
- LLVM之父Chris Lattner:为什么我们要重建AI基础设施软件
- Core principles of video games
- Implementation of packaging video into MP4 format and storing it in TF Card
- Reinforcement learning - learning notes 5 | alphago
猜你喜欢
Utilisation de l'écran OLED
The mail command is used in combination with the pipeline command statement
使用.Net驱动Jetson Nano的OLED显示屏
[diy] how to make a personalized radio
Reference frame generation based on deep learning
【DSP】【第一篇】开始DSP学习
Mécanisme de fonctionnement et de mise à jour de [Widget Wechat]
OAI 5g nr+usrp b210 installation and construction
[wechat applet] operation mechanism and update mechanism
15million employees are easy to manage, and the cloud native database gaussdb makes HR office more efficient
随机推荐
PG basics -- Logical Structure Management (transaction)
Intel 48 core new Xeon run point exposure: unexpected results against AMD zen3 in 3D cache
Mtcnn face detection
(工作记录)2020年3月11日至2021年3月15日
基于深度学习的参考帧生成
使用.Net分析.Net达人挑战赛参与情况
【mysql】触发器
Kubernetes learning summary (20) -- what is the relationship between kubernetes and microservices and containers?
Web开发小妙招:巧用ThreadLocal规避层层传值
“罚点球”小游戏
Comprehensive evaluation and recommendation of the most comprehensive knowledge base management tools in the whole network: flowus, baklib, jiandaoyun, ones wiki, pingcode, seed, mebox, Yifang cloud,
Infrared thermometer based on STM32 single chip microcomputer (with face detection)
APS taps home appliance industry into new growth points
2110 summary of knowledge points and common problems in redis class
Tips for web development: skillfully use ThreadLocal to avoid layer by layer value transmission
Why do novices often fail to answer questions in the programming community, and even get ridiculed?
C language games - three chess
Activiti global process monitors activitieventlistener to monitor different types of events, which is very convenient without configuring task monitoring in acitivit
Deployment of external server area and dual machine hot standby of firewall Foundation
Pat 1078 hashing (25 points) ⼆ times ⽅ exploration method