| 订阅 | 在线投稿
分享
 
 
当前位置: 王朝网络 >> oracle >> Oracle shu ju ku fan hui cursor wen ti de jie jue fang fa
 

Oracle shu ju ku fan hui cursor wen ti de jie jue fang fa

2008-07-30 06:50:48 编辑來源:互联网 评论
 
本文为【Oracle数据库返回cursor问题的解决方法】的拼音翻译版
  zhe pian lun tan wen zhang ( sai di wang ji shu she qu ) zhe chong jie shao le Oracle shu ju ku fan hui cursor wen ti de jie jue fang fa , xiang xi nei rong qing shen kao xia wen :
  zuo tian shi yong Data Block cao zuo oracle fan hui cursor 。 qi jian chan sheng le yi dian wen ti , hen shi yu men , zhao le yi xia wu ye mei you jie jue 。 zao shang shui bu zhe , qi lai ji xu zhao 。 jie guo zhao dao le jie jue de fang fa 。 qi shi ye shi guai zi ji mei you hen hao de kan wen dang 。 zai ci ji lu yi xia 。 yi shi bie de tong zhi zai chu xian wo de wen ti de shi hou , hen rong yi de zhao dao jie jue de fang fa 。
  wen ti shi zhe yang de :
  wo zai oracle li mian you zhe yang yi ge guo cheng
  PROCEDURE ListAllStatic_Users (cur_Static_User OUT T_CURSOR)
  IS
  BEGIN
  OPEN cur_Static_User FOR
  Select * FROM Static_User ;
  END ListAllStatic_Users;
  wo zai cheng xu li mian ru xia tiao yong :
  Database db = DatabaseFactory.CreateDatabase("oraserver");
  string sqlCommand = "Static_UserPackage.ListAllStatic_Users";
  DBCommandWrapper dbCommandWrapper =db.GetStoredProcCommandWrapper(sqlCommand);
  DataSet dsCustomers = db.ExecuteDataSet(dbCommandWrapper);
  DataGrid1.DataSource=dsCstomers;
  DataGrid1.DataBind();
  jie guo chu xian ru xia wen ti :
  ORA-06550: di 1 xing , di 7 lie : PLS-00306: tiao yong 'LISTALLSTATIC_USERS' shi shen shu ge shu huo lei xing cuo wu orA-06550: di 1 xing , di 7 lie : PL/SQL: Statement ignored
  shuo ming : zhi xing dang qian Web qing qiu qi jian , chu xian wei chu li de yi chang 。 qing jian cha dui zhan gen zong xin xi , yi le jie you guan gai cuo wu yi ji dai ma zhong dao zhi cuo wu de chu chu de xiang xi xin xi 。
  yi chang xiang xi xin xi : System.Data.OracleClient.OracleException: orA-06550: di 1 xing , di 7 lie : PLS-00306: tiao yong 'LISTALLSTATIC_USERS' shi shen shu ge shu huo lei xing cuo wu orA-06550: di 1 xing , di 7 lie : PL/SQL: Statement ignored
  yuan cuo wu :
  xing 44:
  xing 45: DataSet dsCustomers = db.ExecuteDataSet(dbCommandWrapper); xing 46: DataGrid1.DataSource=dsCustomers;
  xing 47: DataGrid1.DataBind();
  wo yi wei shi wo de shen shu mei you nong dui , yu shi jiu jia le yi ju :
  dbCommandWrapper.AddOutParameter("cur_Static_User",DbType.Object,500);
  jie guo huan shi yi yang de 。 hou lai ye shi yan le
  OracleCommandWrapper.AddParameter(string,DbType,int,ParameterDirection,bool,byte,byte,string,DataRowVersion,object);
  zhe ge fang fa lai tian jia , ye shi bu xing 。
  hou lai jiu shang wang zhao le hen chang shi jian ye mei you shen me jin zhan 。 jin tian zao shang qi lai , huan shi yi chou mo zhan , ou er de da kai Enterprise Library an zhuang mu lu de Enterprise Library Release Notes.rtf wen jian , fa xian li mian you zhe me yi duan
  2.4 Data Access Application Block: Default oracle cursor cur_OUT
  
  The managed provider for oracle requires you to explicitly bind your reference cursor in your parameter collection. This means you must explicitly create an output parameter for the cursor in your application code. However, that code will not be portable with database systems that do not require a parameter for the cursor. The oracleDatabase allows you to create commands without specifying a cursor. It will create a cursor, named cur_OUT, for commands that execute a stored procedure and do not include an output parameter for the cursor. This means that you can name your reference cursor as "cur_OUT" and the Data Access Application Block will bind it for you; you do not need to explicitly create an output parameter for the cursor. If your stored procedures use a cursor with a name other than "cur_OUT," you must explicitly add a parameter for each cursor to the command. Similarly, if your stored procedure contains multiple cursors, you must explicitly add each cursor parameter to the command.
  zhe xia wo jiu ming bai le 。 zai wo de oracle han shu zhong , wo de ming zi cur_Static_User he mo ren de ming zi cur_OUT bu pi pei 。
  yu shi wo jiu gai le wo de cun chu guo cheng de shen shu ming cheng ,cur_Static_User gai wei cur_OUT。
  wen ti jiu jie jue le 。
  jing guo shi yan , ye ke yi yong ru xia fang fa yong zi ji de shen shu ming , er bu yong mo ren de shen shu ming 。
  ye ke yi , zai yi ge PROCEDURE zhong fan hui duo ge CURSOR
  wo de cun chu guo cheng :
  Procedure STATIC_USER_SelectAll
  ( cur_OUT_f OUT T_OUT, cur_OUT_g OUT T_OUT)
  AS
  Begin
  OPEN cur_OUT_f FOR Select * from STATIC_USER;
  OPEN cur_OUT_g FOR Select * from STATIC_ROLE;
  End;
  dai ma ru xia :
  Database db = DatabaseFactory.CreateDatabase("oraserver");
  string sqlCommand = "Static_UserPackage.STATIC_USER_SelectAll";
  Microsoft.Practices.EnterpriseLibrary.Data.Oracle.OracleCommandWrapper dbCommandWrapper =(Microsoft.Practices.EnterpriseLibrary.Data.Oracle.OracleCommandWrapper)db.GetStoredProcCommandWrapper(sqlCommand);
  dbCommandWrapper.AddParameter("cur_OUT_f", OracleType.Cursor, 0, ParameterDirection.Output, true, 0, 0, String.Empty, DataRowVersion.Default, Convert.DBNull);
  dbCommandWrapper.AddParameter("cur_OUT_g", OracleType.Cursor, 0, ParameterDirection.Output, true, 0, 0, String.Empty, DataRowVersion.Default, Convert.DBNull);
  DataSet dsCustomers = db.ExecuteDataSet(dbCommandWrapper);
  DataGrid1.DataSource=dsCustomers.Tables[0];
  DataGrid1.DataBind();
  DataGrid2.DataSource=dsCustomers.Tables[1];
  DataGrid2.DataBind();【原文】【汉音对照
 
 
 
 
 
 
 
 
日版宠物情人插曲《Winding Road》歌词

日版宠物情人2017的插曲,很带节奏感,日语的,女生唱的。 最后听见是在第8集的时候女主手割伤了,然后男主用嘴帮她吸了一下,插曲就出来了。 歌手:Def...

兄弟共妻,我成了他们夜里的美食

老钟家的两个儿子很特别,就是跟其他的人不太一样,魔一般的执着。兄弟俩都到了要结婚的年龄了,不管自家老爹怎么磨破嘴皮子,兄弟俩说不娶就不娶,老父母为兄弟两操碎了心...

如何磨出破洞牛仔裤?牛仔裤怎么剪破洞?

把牛仔裤磨出有线的破洞 1、具体工具就是磨脚石,下面垫一个硬物,然后用磨脚石一直磨一直磨,到把那块磨薄了,用手撕开就好了。出来的洞啊很自然的。需要猫须的话调几...

我就是扫描下图得到了敬业福和爱国福

先来看下敬业福和爱国福 今年春节,支付宝再次推出了“五福红包”活动,表示要“把欠大家的敬业福都还给大家”。 今天该活动正式启动,和去年一样,需要收集“五福”...

冰箱异味产生的原因和臭味去除的方法

有时候我们打开冰箱就会闻到一股异味,冰箱里的这种异味是因为一些物质发出的气味的混合体,闻起来让人恶心。 产生这些异味的主要原因有以下几点。 1、很多人有这种习...

 
 
zhe pian lun tan wen zhang ( sai di wang ji shu she qu ) zhe chong jie shao le Oracle shu ju ku fan hui cursor wen ti de jie jue fang fa , xiang xi nei rong qing shen kao xia wen : zuo tian shi yong Data Block cao zuo oracle fan hui cursor 。 qi jian chan sheng le yi dian wen ti , hen shi yu men , zhao le yi xia wu ye mei you jie jue 。 zao shang shui bu zhe , qi lai ji xu zhao 。 jie guo zhao dao le jie jue de fang fa 。 qi shi ye shi guai zi ji mei you hen hao de kan wen dang 。 zai ci ji lu yi xia 。 yi shi bie de tong zhi zai chu xian wo de wen ti de shi hou , hen rong yi de zhao dao jie jue de fang fa 。 wen ti shi zhe yang de : wo zai oracle li mian you zhe yang yi ge guo cheng PROCEDURE ListAllStatic_Users (cur_Static_User OUT T_CURSOR) IS BEGIN OPEN cur_Static_User FOR Select * FROM Static_User ; END ListAllStatic_Users; wo zai cheng xu li mian ru xia tiao yong : Database db = DatabaseFactory.CreateDatabase("oraserver"); string sqlCommand = "Static_UserPackage.ListAllStatic_Users"; DBCommandWrapper dbCommandWrapper =db.GetStoredProcCommandWrapper(sqlCommand); DataSet dsCustomers = db.ExecuteDataSet(dbCommandWrapper); DataGrid1.DataSource=dsCstomers; DataGrid1.DataBind(); jie guo chu xian ru xia wen ti : ORA-06550: di 1 xing , di 7 lie : PLS-00306: tiao yong 'LISTALLSTATIC_USERS' shi shen shu ge shu huo lei xing cuo wu orA-06550: di 1 xing , di 7 lie : PL/SQL: Statement ignored shuo ming : zhi xing dang qian Web qing qiu qi jian , chu xian wei chu li de yi chang 。 qing jian cha dui zhan gen zong xin xi , yi le jie you guan gai cuo wu yi ji dai ma zhong dao zhi cuo wu de chu chu de xiang xi xin xi 。 yi chang xiang xi xin xi : System.Data.OracleClient.OracleException: orA-06550: di 1 xing , di 7 lie : PLS-00306: tiao yong 'LISTALLSTATIC_USERS' shi shen shu ge shu huo lei xing cuo wu orA-06550: di 1 xing , di 7 lie : PL/SQL: Statement ignored yuan cuo wu : xing 44: xing 45: DataSet dsCustomers = db.ExecuteDataSet(dbCommandWrapper); xing 46: DataGrid1.DataSource=dsCustomers; xing 47: DataGrid1.DataBind(); wo yi wei shi wo de shen shu mei you nong dui , yu shi jiu jia le yi ju : dbCommandWrapper.AddOutParameter("cur_Static_User",DbType.Object,500); jie guo huan shi yi yang de 。 hou lai ye shi yan le OracleCommandWrapper.AddParameter(string,DbType,int,ParameterDirection,bool,byte,byte,string,DataRowVersion,object); zhe ge fang fa lai tian jia , ye shi bu xing 。 hou lai jiu shang wang zhao le hen chang shi jian ye mei you shen me jin zhan 。 jin tian zao shang qi lai , huan shi yi chou mo zhan , ou er de da kai Enterprise Library an zhuang mu lu de Enterprise Library Release Notes.rtf wen jian , fa xian li mian you zhe me yi duan 2.4 Data Access Application Block: Default oracle cursor cur_OUT The managed provider for oracle requires you to explicitly bind your reference cursor in your parameter collection. This means you must explicitly create an output parameter for the cursor in your application code. However, that code will not be portable with database systems that do not require a parameter for the cursor. The oracleDatabase allows you to create commands without specifying a cursor. It will create a cursor, named cur_OUT, for commands that execute a stored procedure and do not include an output parameter for the cursor. This means that you can name your reference cursor as "cur_OUT" and the Data Access Application Block will bind it for you; you do not need to explicitly create an output parameter for the cursor. If your stored procedures use a cursor with a name other than "cur_OUT," you must explicitly add a parameter for each cursor to the command. Similarly, if your stored procedure contains multiple cursors, you must explicitly add each cursor parameter to the command. zhe xia wo jiu ming bai le 。 zai wo de oracle han shu zhong , wo de ming zi cur_Static_User he mo ren de ming zi cur_OUT bu pi pei 。 yu shi wo jiu gai le wo de cun chu guo cheng de shen shu ming cheng ,cur_Static_User gai wei cur_OUT。 wen ti jiu jie jue le 。 jing guo shi yan , ye ke yi yong ru xia fang fa yong zi ji de shen shu ming , er bu yong mo ren de shen shu ming 。 ye ke yi , zai yi ge PROCEDURE zhong fan hui duo ge CURSOR wo de cun chu guo cheng : Procedure STATIC_USER_SelectAll ( cur_OUT_f OUT T_OUT, cur_OUT_g OUT T_OUT) AS Begin OPEN cur_OUT_f FOR Select * from STATIC_USER; OPEN cur_OUT_g FOR Select * from STATIC_ROLE; End; dai ma ru xia : Database db = DatabaseFactory.CreateDatabase("oraserver"); string sqlCommand = "Static_UserPackage.STATIC_USER_SelectAll"; Microsoft.Practices.EnterpriseLibrary.Data.Oracle.OracleCommandWrapper dbCommandWrapper =(Microsoft.Practices.EnterpriseLibrary.Data.Oracle.OracleCommandWrapper)db.GetStoredProcCommandWrapper(sqlCommand); dbCommandWrapper.AddParameter("cur_OUT_f", OracleType.Cursor, 0, ParameterDirection.Output, true, 0, 0, String.Empty, DataRowVersion.Default, Convert.DBNull); dbCommandWrapper.AddParameter("cur_OUT_g", OracleType.Cursor, 0, ParameterDirection.Output, true, 0, 0, String.Empty, DataRowVersion.Default, Convert.DBNull); DataSet dsCustomers = db.ExecuteDataSet(dbCommandWrapper); DataGrid1.DataSource=dsCustomers.Tables[0]; DataGrid1.DataBind(); DataGrid2.DataSource=dsCustomers.Tables[1]; DataGrid2.DataBind();
󰈣󰈤
  免责声明:本文仅代表作者个人观点,与王朝网络无关。王朝网络登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述,其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
越来越漂亮的楚楚(7)
越来越漂亮的楚楚(6)
越来越漂亮的楚楚(5)
越来越漂亮的楚楚(4)
共长一色
水中莲
峰林晚照
远离喧嚣——山村小景
 
>>返回首页<<
 为你推荐
 
 
 转载本文
 UBB代码 HTML代码
复制到剪贴板...
 
 热帖排行
 
 
 
 
©2005- 王朝网络 版权所有