Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Procedure with Return statement

EV259May 7 2013 — edited May 7 2013
Hi,

Below is my code. Am trying to return a value without a out parameter in the procedure. Is out parameter is mandatory to return a value in a procedure. Please help.
CREATE OR REPLACE
PROCEDURE P123(
    PID NUMBER)
AS
  VCOUNT NUMBER;
BEGIN
  SELECT COUNT(*) INTO VCOUNT FROM EMP WHERE EMPNO=PID;
  IF (VCOUNT=1) THEN
    RETURN 1;
  ELSE
    RETURN 0;
  END IF;
END;
Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 4 2013
Added on May 7 2013
10 comments
904 views