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

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

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

        <tfoot id='E2hKz'></tfoot>

      2. ORA-01747: 无效的 user.table.column、table.column 或列规范

        ORA-01747: invalid user.table.column, table.column, or column specification(ORA-01747: 无效的 user.table.column、table.column 或列规范)
          <tbody id='MGxfu'></tbody>

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

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

          <legend id='MGxfu'><style id='MGxfu'><dir id='MGxfu'><q id='MGxfu'></q></dir></style></legend>

                • <bdo id='MGxfu'></bdo><ul id='MGxfu'></ul>
                  本文介绍了ORA-01747: 无效的 user.table.column、table.column 或列规范的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  在循环中调用立即执行时得到上述错误

                  Get the above error when the execute immediate is called in a loop

                  Update CustomersPriceGroups set  1AO00=:disc  Where cuno=:cuno
                      Parameters:   disc=66 cuno=000974
                  Update CustomersPriceGroups set  1AP00=:disc  Where cuno=:cuno
                      Parameters:   disc=70.5 cuno=000974
                  Update CustomersPriceGroups set  1AQ00=:disc  Where cuno=:cuno
                      Parameters:   disc=66 cuno=000974
                  Update CustomersPriceGroups set  1ZA00=:disc  Where cuno=:cuno
                      Parameters:   disc=60 cuno=000974
                  

                  这是什么意思?

                  这是代码片段

                      c:=PriceWorx.frcPriceListCustomers('020','221');
                  LOOP
                    fetch c into comno,cuno,nama,cpls;
                    exit when c%notfound;
                    dbms_output.put_Line(cuno);
                     g:=priceWorx.frcPriceListItemGroups('020','221');
                     d:=priceworx.frcCustomerDiscounts('020','221',cuno);
                    loop
                      fetch g into comno,cpgs,n;
                      fetch d into comno,cpls,cuno,cpgs,stdt,tdat,qanp,disc,src;
                      --dbms_output.put(chr(9)||cpgs);
                      sQ:='Update saap.CustomersPriceGroups set "'|| trim(cpgs)||'"=:disc '
                         || ' Where cuno=:cuno';
                      execute immediate sQ using disc,cuno; 
                      commit;
                      dbms_output.put_line( sQ );
                      dbms_output.put_line( chr(9)||'Parameters:   disc='|| disc||' cuno='||cuno);
                      exit when g%notfound;
                    end loop;
                    close g;
                    close d;
                  end loop;
                  

                  推荐答案

                  未加引号的标识符必须以字母字符开头(请参阅 此处的规则 6).您正在尝试为名称以数字开头的列分配值 1AO001AP00 等.

                  Unquoted identifiers must begin with an alphabetic character (see rule 6 here). You're trying to assign a value to a column with a name starting with a number 1AO00, 1AP00 etc.

                  如果没有看到 CustomersPriceGroups 的表定义,我们不知道它是否有具有这些名称的列.如果是,那么它们必须被创建为带引号的标识符.如果是这样,您将不得不用引号(到处)引用它们,这并不理想 - 使代码更难阅读,更容易犯这样的错误,并且很难发现问题所在.甚至甲骨文说,在同一页上:

                  Without seeing the table definition for CustomersPriceGroups we don't know if it has columns with those names. If it does then they must have been created as quoted identifiers. If so you'll have to refer to them (everywhere) with quotes, which is not ideal - makes the code a bit harder to read, makes it easy to make a mistake like this, and can be hard to spot what's wrong. Even Oracle say, on the same page:

                  注意:Oracle 不建议对数据库使用带引号的标识符对象名称.SQL*Plus 接受这些带引号的标识符,但是使用其他管理数据库的工具时,它们可能无效对象.

                  Note: Oracle does not recommend using quoted identifiers for database object names. These quoted identifiers are accepted by SQL*Plus, but they may not be valid when using other tools that manage database objects.

                  在您的代码中,您在分配 sQ 时似乎使用了引号,但您显示的输出没有;但它也没有 saap. 架构标识符.那可能是因为您没有运行您认为的代码版本,但可能只是如果您重新输入数据而不是粘贴数据,则会丢失 - 您也没有显示 c.cuno 的早期输出.但也有可能是列名错误.

                  In you code you appear to be using quotes when you assign sQ, but the output you show doesn't; but it doesn't have the saap. schema identifier either. That may be because you're not running the version of the code you think, but might just have been lost if you retyped the data instead of pasting it - you're not showing the earlier output of c.cuno either. But it's also possible you have, say, the case of the column name wrong.

                  如果 execute 抛出错误,您将不会在循环中看到当时正在执行的命令,因为调试在它之后 - 您看到的是成功的值,而不是那个这是打破.您需要检查函数返回的所有值;我怀疑 g 正在为 cpgs 返回一个实际上不是有效列名的值.

                  If the execute is throwing the error, you won't see the command being executed that time around the loop because the debug comes after it - you're seeing the successful values, not the one that's breaking. You need to check all the values being returned by the functions; I suspect that g is returning a value for cpgs that actually isn't a valid column name.

                  正如@nineside 所说,显示更多信息,尤其是完整的异常消息,将有助于确定问题所在.

                  As @ninesided says, showing more information, particularly the full exception message, will help identify what's wrong.

                  这篇关于ORA-01747: 无效的 user.table.column、table.column 或列规范的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  How to call Oracle function or stored procedure using spring persistence framework?(如何使用 Spring 持久化框架调用 Oracle 函数或存储过程?)
                  What can cause intermittent ORA-12519 (TNS: no appropriate handler found) errors(什么会导致间歇性 ORA-12519(TNS:找不到合适的处理程序)错误)
                  SQL to return the number of working days between 2 passed in dates(SQL 返回两个传入日期之间的工作日数)
                  Oracle Date Subtraction(Oracle 日期减法)
                  Is using quot;select *quot; for a cursor in PL/SQL considered bad programming?(正在使用“选择 *PL/SQL 中的游标被认为是糟糕的编程?)
                  Using sql/plsql, how do you find out which character set a text uses?(使用 sql/plsql,你如何找出文本使用的字符集?)
                  <legend id='XLV0c'><style id='XLV0c'><dir id='XLV0c'><q id='XLV0c'></q></dir></style></legend>

                  1. <small id='XLV0c'></small><noframes id='XLV0c'>

                          • <bdo id='XLV0c'></bdo><ul id='XLV0c'></ul>

                              <tbody id='XLV0c'></tbody>

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