当前位置:网站首页>c#使用oracle存储过程获取结果集实例
c#使用oracle存储过程获取结果集实例
2022-07-06 12:44:00 【51CTO】
存储过程:
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#代码:
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;
}
边栏推荐
- What key progress has been made in deep learning in 2021?
- R语言可视化两个以上的分类(类别)变量之间的关系、使用vcd包中的Mosaic函数创建马赛克图( Mosaic plots)、分别可视化两个、三个、四个分类变量的关系的马赛克图
- [diy] self designed Microsoft makecode arcade, official open source software and hardware
- New database, multidimensional table platform inventory note, flowus, airtable, seatable, Vig table Vika, Feishu multidimensional table, heipayun, Zhixin information, YuQue
- R language visualizes the relationship between more than two classification (category) variables, uses mosaic function in VCD package to create mosaic plots, and visualizes the relationship between tw
- 请问sql group by 语句问题
- Tips for web development: skillfully use ThreadLocal to avoid layer by layer value transmission
- 【每周一坑】计算100以内质数之和 +【解答】输出三角形
- Design your security architecture OKR
- Xcode6 error: "no matching provisioning profiles found for application"
猜你喜欢
![[200 opencv routines] 220 Mosaic the image](/img/75/0293e10ad6de7ed86df4cacbd79b54.png)
[200 opencv routines] 220 Mosaic the image

JMeter server resource indicator monitoring (CPU, memory, etc.)

1500万员工轻松管理,云原生数据库GaussDB让HR办公更高效

小孩子学什么编程?

知识图谱之实体对齐二

use. Net analysis Net talent challenge participation

I've seen many tutorials, but I still can't write a program well. How can I break it?

Intel 48 core new Xeon run point exposure: unexpected results against AMD zen3 in 3D cache

Force deduction brush question - 98 Validate binary search tree

15million employees are easy to manage, and the cloud native database gaussdb makes HR office more efficient
随机推荐
Value of APS application in food industry
OSPF多区域配置
【DSP】【第一篇】开始DSP学习
Rhcsa Road
What key progress has been made in deep learning in 2021?
【每周一坑】计算100以内质数之和 +【解答】输出三角形
Zoom with unity mouse wheel: zoom the camera closer or farther
Variable star --- article module (1)
How to upgrade high value-added links in the textile and clothing industry? APS to help
Dynamically switch data sources
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
(work record) March 11, 2020 to March 15, 2021
看过很多教程,却依然写不好一个程序,怎么破?
How does kubernetes support stateful applications through statefulset? (07)
What programming do children learn?
PG basics -- Logical Structure Management (transaction)
【每周一坑】信息加密 +【解答】正整数分解质因数
Hardware development notes (10): basic process of hardware development, making a USB to RS232 module (9): create ch340g/max232 package library sop-16 and associate principle primitive devices
Rhcsa Road
Intel 48 core new Xeon run point exposure: unexpected results against AMD zen3 in 3D cache