oracle存储过程返回多条记录

上传人:xiao****1972 文档编号:84900071 上传时间:2019-03-05 格式:DOCX 页数:5 大小:13.82KB
返回 下载 相关 举报
oracle存储过程返回多条记录_第1页
第1页 / 共5页
oracle存储过程返回多条记录_第2页
第2页 / 共5页
oracle存储过程返回多条记录_第3页
第3页 / 共5页
oracle存储过程返回多条记录_第4页
第4页 / 共5页
oracle存储过程返回多条记录_第5页
第5页 / 共5页
亲,该文档总共5页,全部预览完了,如果喜欢就下载吧!
资源描述

《oracle存储过程返回多条记录》由会员分享,可在线阅读,更多相关《oracle存储过程返回多条记录(5页珍藏版)》请在金锄头文库上搜索。

1、oracle存储过程返回多条记录createtableuserTabel( useridnumber(10), usernamevarchar2(100),constraintPK_USERIDPRIMARYKEY(userid);commit;insertintouserTabelvalues(1,Albert);insertintouserTabelvalues(2,reboot) ;insertintouserTabelvalues(3,Jeff);-创建包以游标的形式返回userTabel的结果集createorreplacepackage pkg_AAis-Author : ADMI

2、NISTRATOR-Created : 2008-07-17 8:35:52-Purpose :-Public type declarations type mycurisrefcursor;procedurefun_GetRecords(cur_return out mycur);endpkg_AA;createorreplacepackage body pkg_AAis-Function and procedure implementationsprocedurefun_GetRecords(cur_return out mycur)isbeginopencur_returnforsele

3、ct*fromUsertabel;endfun_GetRecords;endpkg_AA;usingSystem;usingSystem.Collections;usingSystem.Configuration;usingSystem.Data;usingSystem.Linq;usingSystem.Web;usingSystem.Web.Security;usingSystem.Web.UI;usingSystem.Web.UI.HtmlControls;usingSystem.Web.UI.WebControls;usingSystem.Web.UI.WebControls.WebPa

4、rts;usingSystem.Xml.Linq;usingSystem.Data.OracleClient;publicpartialclassOracleCursor_Default : System.Web.UI.PageprotectedvoidPage_Load(objectsender, EventArgs e) if(!IsPostBack) this.BindGridView(); privatevoidBindGridView() OracleConnection conn=newOracleConnection(ConfigurationManager.Connection

5、StringsConnectionString.ConnectionString); OracleCommand comm=newOracleCommand(pkg_AA.fun_GetRecords, conn); comm.Parameters.Add(cur_return, OracleType.Cursor).Direction=ParameterDirection.Output; comm.CommandType=CommandType.StoredProcedure; DataSet ds=newDataSet();using(OracleDataAdapter da=newOracleDataAdapter(comm) da.Fill(ds); this.GridView1.DataSource=ds.Tables0.DefaultView;this.GridView1.DataBind();

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 大杂烩/其它

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号