Example Analysis of out parameters in Oracle
This article mainly shows you the "sample analysis of out parameters in Oracle", which is easy to understand and clear. I hope it can help you solve your doubts. Let me lead you to study and study the "sample analysis of out parameters in Oracle".
Detailed explanation of out parameters of Oracle
A concept
1. Generally speaking, the difference between a stored procedure and a stored function is that a stored function can have a return value; a stored procedure does not.
2. Procedures and functions can specify one or more output lines through out. We can use the out parameter to return multiple values in procedures and functions.
3. Both stored procedures and stored functions can have out parameters.
4. Both stored procedures and stored functions can have multiple out parameters.
5. The stored procedure can return the value through the out parameter.
6. If there is only one return value, use the stored function; otherwise, use the stored procedure.
Two examples
-- out parameters: query an employee's name, monthly salary and position / * think 1, query all the information of an employee-- > > too many out parameters? 2. Query all the information of all employees in a department-- return a collection in > > out? * / create or replace procedure queryempinformation (eno in number, pename out varchar2, psal out number, pjob out varchar2) asbeginselect ename,sal,empjob into pename,psal,pjob from emp where empno=eno;end;/
Three running results
PENAME = KINGPSAL = 10100PJOB = PRESIDENT above is all the contents of the article "sample Analysis of out parameters in Oracle". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!