oracle 临时表操作
步骤一:建立临时表
create global temporary table t_temp
(COL varchar2(30))
on commit preserve rows;
执行该语句;
步骤二:建procedure(在包体里面,定义就不写了),调用若满足function check_st_cursor_status,则给临时表赋值
procedure init_temp_table as
cursor st_cursor is
select * from st_table;
begin
for cur in st_cursor loop
if (check_st_cursor_status(cur.stid)) then
insert into t_temp (COL) values (cur.stid);
commit;
end if;
end loop;
EXCEPTION
when others THEN
dbms_output.put_line(Sqlerrm);
rollback;
end init_temp_table;
步骤三:
通过调用function,返回临时表里的数据集
在执行到加红语句时,cur.stid确实有值,可是,读临时表,里面却没有数据???
请大家帮忙,如何在临时表里赋值。
我的分比较少,不好意思。
谢谢:)
create global temporary table t_temp
(COL varchar2(30))
on commit preserve rows;
执行该语句;
步骤二:建procedure(在包体里面,定义就不写了),调用若满足function check_st_cursor_status,则给临时表赋值
procedure init_temp_table as
cursor st_cursor is
select * from st_table;
begin
for cur in st_cursor loop
if (check_st_cursor_status(cur.stid)) then
insert into t_temp (COL) values (cur.stid);
commit;
end if;
end loop;
EXCEPTION
when others THEN
dbms_output.put_line(Sqlerrm);
rollback;
end init_temp_table;
步骤三:
通过调用function,返回临时表里的数据集
在执行到加红语句时,cur.stid确实有值,可是,读临时表,里面却没有数据???
请大家帮忙,如何在临时表里赋值。
我的分比较少,不好意思。
谢谢:)
...全文
相关推荐
oracle临时表操作学习资料
在Oracle数据库中还有一种类型的表,叫做临时表。这个临时表跟永久表最大的区别就是表中的数据不会永远的存在。当一个会话结束或者事务结束的时候,这个临时表中的数据,不用用户自己删除,数据库自己会自动清除。
不让临时表空间影响ORACLE数据库性能
不让临时表空间影响ORACLE数据库性能
Oracle 临时表空间使用注意
Oracle 临时表空间使用注意 Oracle 临时表空间使用注意 Oracle 临时表空间使用注意
oracle创建临时表空间文档及工具
oracle创建临时表空间文档及一键导入、导出工具,非常方便
Oracle 12CR2查询转换教程之临时表转换详解
主要给大家介绍了关于Oracle 12CR2查询转换教程之临时表转换的相关资料,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧


