Oracle 中表类型的光标
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1362837/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-18 18:54:30 来源:igfitidea点击:
Cursor on table type in Oracle
提问by Micha? Ziober
I have a table declaration:
我有一个表声明:
TYPE PERSON_TYPE AS OBJECT (ID NUMBER(38), NAME VARCHAR2(20));
TYPE PERSON_TYPE_TABLE AS TABLE OF PERSON_TYPE;
Can I declare cursor which will be work with my table type in Oracle?
我可以在 Oracle 中声明适用于我的表类型的游标吗?
回答by Quassnoi
DECLARE
p PERSON_TYPE_TABLE := PERSON_TYPE_TABLE(PERSON_TYPE(1, 'test'));
id INT;
name VARCHAR2(100);
CURSOR mycur
IS
SELECT *
FROM TABLE(p);
BEGIN
OPEN mycur;
FETCH mycur
INTO id, name;
CLOSE mycur;
END;