文章列表
DECLARE
CURSOR cur(no NUMBER) IS
SELECT ename FROM emp WHERE deptno = no;
v_name emp.ename%TYPE;
--集合
TYPE name_table_type IS TABLE OF emp.ename%TYPE INDEX BY BINARY_INTEGER;
name_table name_table_type;
--游标变量
TYPE emp_cursor_type IS REF CURSOR;
emp_cursor emp_cursor_t ...
PROCEDURE proc_02 IS
/*create table demo (id number(6) primary key ,
name varchar2(10));*/
TYPE id_table_type IS TABLE OF NUMBER(6) INDEX BY BINARY_INTEGER;
TYPE name_table_type IS TABLE OF VARCHAR2(10) INDEX BY BINARY_INTEGER;
id_table id_table_type;
name ...
PLSQL常见集合
CREATE OR REPLACE PACKAGE BODY test AS
PROCEDURE proc_01 IS
--自定义记录
TYPE emp_record_type IS RECORD(
name emp.ename%TYPE,
sal emp.sal%TYPE,
dno emp.empno%TYPE);
emp_record emp_record_type;
--表记录
dept_record dept%ROWTYPE;
--索引表,嵌套表
...