Since Oracle stored procedures do not return values, all their return values are replaced by the out parameter, and the list is no exception. However, because it is a set, it cannot be used as a general
Since Oracle stored procedures do not return values, all their return values are replaced by the out parameter, and the list is no exception. However, because it is a set, it cannot be used as a general
Stored Procedure with returned values (list result set)
Case: Write a process, enter the Department number, and return the information of all employees of the Department.
The analysis of this question is as follows:
Since Oracle stored procedures do not return values, all their return values are replaced by the out parameter, and the list is no exception. However, because it is a set, general parameters cannot be used, you must use a package. Therefore, there are two parts:
1) create a package. As follows:
Create or replace package testpackage as type test_cursor is ref cursor;
End testpackage;
In this package, I defined a cursor type test_cursor.
The following is the write creation process.
Create or replace procedure chenchuang_pro
(ChenNo in number p_cursor out testpackage. test_cursor) is
Begin
Open p_cursor for select * from emp wheredeptno = chenNo;
End;
Ref cursor: cursor type
,