关于 Oracel 中没有临时 表 ,但是 可以用一个 select * from test的 结果 作为表 ,实现 临时表的 功能 ,例如 : select * from (select * from test)
也可以用表 类型 : temp_table type of test%rowtype index by binary_integer; ta temp_table;
还有没有别的办法.用表类型能使用SQL语句来操作吗?
使用 Ref cursor 可以返回结果集例子:Type SYS_RefCursor IS REF CURSOR;CREATE OR REPLACE PROCEDURE authors_sel ( cv_results IN OUT SYS_REFCURSOR) IS BEGIN OPEN cv_results FOR SELECT id, first_name, last_name FROM authors; END; /
使用 Ref cursor 可以返回结果集例子:Type SYS_RefCursor IS REF CURSOR;CREATE OR REPLACE PROCEDURE authors_sel ( cv_results IN OUT SYS_REFCURSOR) IS BEGIN OPEN cv_results FOR SELECT id, first_name, last_name FROM authors; END; /------------ 在oracle中如何測試調用
临时表的 功能 ,例如 :
select * from
(select * from test)
temp_table type of test%rowtype
index by binary_integer;
ta temp_table;
cv_results IN OUT SYS_REFCURSOR)
IS
BEGIN
OPEN cv_results FOR
SELECT id, first_name, last_name
FROM authors;
END;
/
cv_results IN OUT SYS_REFCURSOR)
IS
BEGIN
OPEN cv_results FOR
SELECT id, first_name, last_name
FROM authors;
END;
/------------
在oracle中如何測試調用