Home > Database > Mysql Tutorial > body text

Oracle 方法返回集合类型[table]

WBOY
Release: 2016-06-07 17:27:51
Original
942 people have browsed it

以scott.emp 为例,根据职位(MGR)编号,查出该职位编号的所有信息 先创建类型: 相当于每一行记录的类型 可以理解为 scott.emp%r

CREATE OR REPLACE FUNCTION fn_test1(num VARCHAR2)
RETURN mtab
IS
mytab mtab;
BEGIN
SELECT my_record(EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) BULK COLLECT INTO mytab FROM scott.emp WHERE mgr=num;
RETURN mytab;
END;

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template