. What is the procedure of returning value for Stored Procedure in Pstgresql?
If someone wants to get a value from a stored procedure, output parameters can be used since the final values can be returned. But while going through the function and the stored procedure at DZone, I could understand that the stored procedure does not give any value. However, stored functions return value. Please let me know if the stored procedure can return value or not. Or, if it can return any value, let me know if it is possible by using the SELECT statement.
Whenever you want to find which type of procedure returns a value, you need to understand that a function always gives something back. It can be a row, a set of rows, a single value, void, etc. Only a no row cannot return anything. SELECT can create exceptions in the PL/pgSQL function. A PROCEDURE gives back only a row if it argues with INOUT mode. So, if you consider a DOP statement to run ad-hoc PL/pgSQL code when you do not want to pass anything, see what happens. So, if you want to get anything from a stored procedure, you need to use the INTO keyword while assigning the parameter. Here is the code: