<bdo id='CWDfa'></bdo><ul id='CWDfa'></ul>
  • <tfoot id='CWDfa'></tfoot>
    <legend id='CWDfa'><style id='CWDfa'><dir id='CWDfa'><q id='CWDfa'></q></dir></style></legend>

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

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

        ORA-00947 全局声明类型时值不足

        ORA-00947 Not enough values while declaring type globally(ORA-00947 全局声明类型时值不足)
        <legend id='6veHV'><style id='6veHV'><dir id='6veHV'><q id='6veHV'></q></dir></style></legend>

                  <bdo id='6veHV'></bdo><ul id='6veHV'></ul>
                  <tfoot id='6veHV'></tfoot>

                  <small id='6veHV'></small><noframes id='6veHV'>

                    <tbody id='6veHV'></tbody>
                  <i id='6veHV'><tr id='6veHV'><dt id='6veHV'><q id='6veHV'><span id='6veHV'><b id='6veHV'><form id='6veHV'><ins id='6veHV'></ins><ul id='6veHV'></ul><sub id='6veHV'></sub></form><legend id='6veHV'></legend><bdo id='6veHV'><pre id='6veHV'><center id='6veHV'></center></pre></bdo></b><th id='6veHV'></th></span></q></dt></tr></i><div id='6veHV'><tfoot id='6veHV'></tfoot><dl id='6veHV'><fieldset id='6veHV'></fieldset></dl></div>
                  本文介绍了ORA-00947 全局声明类型时值不足的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                   create table foo(
                     id number,
                     status varchar2(10)
                   );
                  

                  表已创建.

                  insert into foo values( 1, 'open' );
                  insert into foo values( 2, 'close' );
                  insert into foo values( 3, 'open' );
                  insert into foo values( 4, 'open' );
                  insert into foo values( 5, 'close' );
                  
                  create type foo_obj is object (
                        id number,
                        status varchar2(10)
                      );
                     /
                  
                   create type foo_nt
                       as table of foo_obj;
                    /
                  
                   create or replace package test_bulk
                   is 
                  
                   procedure temp;
                  
                   end;
                   /
                  
                   create or replace package body test_bulk
                   is 
                  
                   procedure  temp
                     is 
                     v_nt  foo_nt;
                     begin
                       select id ,status 
                       bulk collect into v_nt
                       from foo;
                  
                     end temp;
                  
                     end test_bulk;
                  

                  这是一个非常奇怪的情况,当我全局创建一个类型对象和该类型的嵌套表并创建一个嵌套表类型的变量并批量收集到该变量时我得到

                  This is a very odd situation, when I create a type object and nested table of that type Globally and create a variable of the nested table type and bulk collect into that variable I get

                  ORA-00947: 值不够错误

                  ORA-00947: not enough values error

                  但是,当我声明一个记录类型和该记录类型的嵌套表,然后在包内声明一个嵌套表的变量时,那么上面的批量收集工作并且不会抛出错误

                  However, when I declare a record type and nested table of that record type And then a variable of the nested table Inside the package , then the above bulk collect works and it will not throw error

                  谁能帮我解决这个问题?

                  Can anyone help me out with this?

                  推荐答案

                  您不能只是将值放入对象表中 - 您需要将值转换为适当类型的对象,然后插入对象.试试

                  You can't just put values into a table of objects - you need to convert the values into objects of the appropriate type and then insert the objects. Try

                  procedure temp is
                    v_nt  foo_nt;
                  begin
                    select FOO_OBJ(id ,status)
                      bulk collect into v_nt
                      from foo;
                  end temp;
                  

                  未在动物身上进行过测试 - 你会是第一个!

                  Not tested on animals - you'll be first!

                  分享和享受.

                  这篇关于ORA-00947 全局声明类型时值不足的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  How to redirect the output of DBMS_OUTPUT.PUT_LINE to a file?(如何将 DBMS_OUTPUT.PUT_LINE 的输出重定向到文件?)
                  How do I get column datatype in Oracle with PL-SQL with low privileges?(如何使用低权限的 PL-SQL 在 Oracle 中获取列数据类型?)
                  Get a list of all functions and procedures in an Oracle database(获取 Oracle 数据库中所有函数和过程的列表)
                  Why cannot I create triggers on objects owned by SYS?(为什么我不能在 SYS 拥有的对象上创建触发器?)
                  Returning result even for elements in IN list that don#39;t exist in table(即使对于表中不存在的 IN 列表中的元素也返回结果)
                  Reset Sequence in oracle 11g(oracle 11g 中的重置序列)

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

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

                        1. <tfoot id='TDQ9Q'></tfoot>

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