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!

How to pass Boolean parameter to Procedure

345144Oct 21 2003 — edited Oct 21 2003
I need to pass a Boolean parameter to Stored Procedure. For YES I have to select persons only with type id = 18. For NO i have to select persons with type id <> 18.
Here is a procedure:

CREATE OR REPLACE PROCEDURE ms_test_008
(isManager in BOOLEAN,
p_out out pakbatch.batchcur)

IS
begin

OPEN p_out
FOR
SELECT * FROM person
WHERE trunc(registrationdate)=TO_DATE('10/20/2003')
and persontypeid=18;
END;

and here is how I try to get a result set from SQL+ :

variable var1 refcursor
exec ms_test_008(yes,:var1);
print var1


My questions:

1. How to properly declare it in declaration area of procedure.
2. How to include it in WHERE clause.
3. How to pass parameters via SQL+ to retrive a result set.

Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 18 2003
Added on Oct 21 2003
4 comments
4,584 views