项目要求先定义record
然后用record定义table
最后向table中加record
出现下面问题
哪位大虾帮偶解决下declare
type r is record
(
 x1 varchar2(3):='a',
 x2 varchar2(30):='b' 
);
type t is table of r;
begin
     insert into t
     values
     ('100',
     'oracle'
     );
end;ORA-06550: line 9, column 18:
PL/SQL: ORA-00942: table or view does not exist
ORA-06550: line 9, column 6:
PL/SQL: SQL Statement ignored

解决方案 »

  1.   

    declare
    type r is record
    (
     x1 varchar2(3):='a',
     x2 varchar2(30):='b' 
    );
    type t is table of r INDEX BY BINARY_INTEGER;
    t_a r;
    table_t t;
    begin
      table_t(1):=t_a;
      dbms_output.put_line(table_t(1).x1);
    end;
      

  2.   

    type r is record
    type t is table of r;这两个都是类型
    你要定义了变量才可以使用
      

  3.   

    declare
    type r is record
    (
     x1 varchar2(3):='a',
     x2 varchar2(30):='b' 
    );
    type t is table of r INDEX BY BINARY_INTEGER;
    t_a r;
    table_t t;
    begin
      table_t(1):=t_a;
      dbms_output.put_line(table_t(1).x1);
    end;select * from table_t
    ORA-00933: SQL command not properly ended怎么会事?
      

  4.   

    shifou lz理解错误,应该是创建一个记录类型的object,然后使用这个Object来定义一个表格。
    问清楚到底怎么回事。
      

  5.   

    select * from table_t
    ORA-00933: SQL command not properly ended--
    这种内存表是不能这么查询的
      

  6.   

    shifou lz理解错误,应该是创建一个记录类型的object,然后使用这个Object来定义一个表格。--
    是的
    这种方式的表
    可以用select  + 表函数的方法来查询