How to pass Boolean parameter to Procedure
345144Oct 21 2003 — edited Oct 21 2003I 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