<small id='VISrh'></small><noframes id='VISrh'>

<legend id='VISrh'><style id='VISrh'><dir id='VISrh'><q id='VISrh'></q></dir></style></legend>
  • <i id='VISrh'><tr id='VISrh'><dt id='VISrh'><q id='VISrh'><span id='VISrh'><b id='VISrh'><form id='VISrh'><ins id='VISrh'></ins><ul id='VISrh'></ul><sub id='VISrh'></sub></form><legend id='VISrh'></legend><bdo id='VISrh'><pre id='VISrh'><center id='VISrh'></center></pre></bdo></b><th id='VISrh'></th></span></q></dt></tr></i><div id='VISrh'><tfoot id='VISrh'></tfoot><dl id='VISrh'><fieldset id='VISrh'></fieldset></dl></div>

      <bdo id='VISrh'></bdo><ul id='VISrh'></ul>
    <tfoot id='VISrh'></tfoot>
      1. Oracle“ORA-01008:并非所有变量都绑定"带参数的错误

        Oracle quot;ORA-01008: not all variables boundquot; Error w/ Parameters(Oracle“ORA-01008:并非所有变量都绑定带参数的错误)
        <i id='vfbcL'><tr id='vfbcL'><dt id='vfbcL'><q id='vfbcL'><span id='vfbcL'><b id='vfbcL'><form id='vfbcL'><ins id='vfbcL'></ins><ul id='vfbcL'></ul><sub id='vfbcL'></sub></form><legend id='vfbcL'></legend><bdo id='vfbcL'><pre id='vfbcL'><center id='vfbcL'></center></pre></bdo></b><th id='vfbcL'></th></span></q></dt></tr></i><div id='vfbcL'><tfoot id='vfbcL'></tfoot><dl id='vfbcL'><fieldset id='vfbcL'></fieldset></dl></div>

        • <small id='vfbcL'></small><noframes id='vfbcL'>

            <bdo id='vfbcL'></bdo><ul id='vfbcL'></ul>

                <tbody id='vfbcL'></tbody>
            1. <legend id='vfbcL'><style id='vfbcL'><dir id='vfbcL'><q id='vfbcL'></q></dir></style></legend>

                • <tfoot id='vfbcL'></tfoot>
                  本文介绍了Oracle“ORA-01008:并非所有变量都绑定"带参数的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  这是我第一次与 Oracle 打交道,我很难理解为什么会收到此错误.

                  This is the first time I've dealt with Oracle, and I'm having a hard time understanding why I'm receiving this error.

                  我在查询的 where 子句中使用带有 C# 的 Oracle 的 ODT.NET 和以下代码:

                  I'm using Oracle's ODT.NET w/ C# with the following code in a query's where clause:

                  WHERE table.Variable1 = :VarA
                    AND (:VarB IS NULL OR table.Variable2 LIKE '%' || :VarB || '%')
                    AND (:VarC IS NULL OR table.Variable3 LIKE :VarC || '%')
                  

                  我正在添加参数值,如下所示:

                  and I'm adding the parameter values like so:

                  cmd.Parameters.Add("VarA", "24");
                  cmd.Parameters.Add("VarB", "test");
                  cmd.Parameters.Add("VarC", "1234");
                  

                  当我运行这个查询时,服务器返回:

                  When I run this query, the server returns:

                  ORA-01008: not all variables bound 
                  

                  如果我注释掉任何一个AND(...."行,查询就会成功完成.

                  If I comment out either of the 'AND (....' lines, the query completes successfully.

                  如果我只用两个参数查询,而不用三个参数查询,为什么查询会正常运行?我收到的错误甚至没有意义

                  Why would the query run through alright if I'm only querying with two parameters, but not with three? The error I'm receiving doesn't even make sense

                  推荐答案

                  oracle 的 ODP.Net 提供程序默认使用按位置绑定.将行为更改为按名称绑定.将属性 BindByName 设置为 true.比你可以忽略参数的双重定义.

                  The ODP.Net provider from oracle uses bind by position as default. To change the behavior to bind by name. Set property BindByName to true. Than you can dismiss the double definition of parameters.

                  using(OracleCommand cmd = con.CreateCommand()) {
                      ...
                      cmd.BindByName = true;
                      ...
                  }
                  

                  这篇关于Oracle“ORA-01008:并非所有变量都绑定"带参数的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  ibtmp1是非压缩的innodb临时表的独立表空间,通过innodb_temp_data_file_path参数指定文件的路径,文件名和大小,默认配置为ibtmp1:12M:autoextend,也就是说在文件系统磁盘足够的情况下,这个文件大小是可以无限增长的。 为了避免ibtmp1文件无止境的暴涨导致
                  SQL query to group by day(按天分组的 SQL 查询)
                  What does SQL clause quot;GROUP BY 1quot; mean?(SQL 子句“GROUP BY 1是什么意思?意思是?)
                  MySQL groupwise MAX() returns unexpected results(MySQL groupwise MAX() 返回意外结果)
                  MySQL SELECT most frequent by group(MySQL SELECT 按组最频繁)
                  Include missing months in Group By query(在 Group By 查询中包含缺失的月份)

                  <small id='leQJo'></small><noframes id='leQJo'>

                        <tbody id='leQJo'></tbody>
                      <legend id='leQJo'><style id='leQJo'><dir id='leQJo'><q id='leQJo'></q></dir></style></legend>
                      <tfoot id='leQJo'></tfoot>

                          • <bdo id='leQJo'></bdo><ul id='leQJo'></ul>
                          • <i id='leQJo'><tr id='leQJo'><dt id='leQJo'><q id='leQJo'><span id='leQJo'><b id='leQJo'><form id='leQJo'><ins id='leQJo'></ins><ul id='leQJo'></ul><sub id='leQJo'></sub></form><legend id='leQJo'></legend><bdo id='leQJo'><pre id='leQJo'><center id='leQJo'></center></pre></bdo></b><th id='leQJo'></th></span></q></dt></tr></i><div id='leQJo'><tfoot id='leQJo'></tfoot><dl id='leQJo'><fieldset id='leQJo'></fieldset></dl></div>