我正在尝试执行以下操作,
select * into temp from (select * from student);
它给了我以下错误,
ERROR at line 1:
ORA-00905: missing keyword
在我的真实示例中,子查询(select * from student)更复杂。
我想在存储过程中使用它,所以我不想创建表本身。我只想通过使用临时表使我的代码更具可读性。
最佳答案
那么也许你需要做这样的事情:
declare
type t_temp_storage is table of student%rowtype;
my_temp_storage t_temp_storage;
begin
select * bulk collect into my_temp_storage from student;
for i in 1..my_temp_storage.count
loop
dbms_output.put_line('here I am '||my_temp_storage(i).stuid);
end loop;
end;
关于oracle - 选择到Oracle中的临时表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28653276/