项目要求先定义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
然后用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
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;
type t is table of r;这两个都是类型
你要定义了变量才可以使用
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怎么会事?
问清楚到底怎么回事。
ORA-00933: SQL command not properly ended--
这种内存表是不能这么查询的
是的
这种方式的表
可以用select + 表函数的方法来查询